In this How to change boot splash image in CentOS 7 guide, we'll have a look at different ways to set custom splash screen on CentOS 7. By default, CentOS will display a progress bar when it's booting up. This progress bar will keep showing until the boot process is complete and you're presented with a login screen. In all Linux distributions, you can change what you see on the screen while the OS is booting up through GRUB bootloader modification. Some parts of this guide are specific to CentOS, but other parts can be a reference point for other Linux distributions. Only a few differences on the location of boot files and GRUB configuration file.
I'm assuming you're working on CentOS or Ubuntu Desktop with GUI to create a splash screen image. For any other distro, you can install the dependencies by referring to its documentation - Only applicable to those using convert tool and Gimp.
Method 1: Copying xpm.gz splash image to /boot/grub directory
If you are lazy to create your custom image for use on the splash screen, then first, download a random image on the web:
# wget http://i1-news.softpedia-static.com/images/news2/io-js-Will-Be-Merging-Back-into-Node-js-482552-2.jpg -O splash.jpg
This is a jpg image that we need to convert to png and resize it to fit our screen. Here I'm using 640x480 resolution. You can scale it to your desired screen resolution.
# convert splash.jpg -resize 600x400 -colors 14 -depth 16 -normalize -verbose linoxide.xpm splash.jpg=>linoxede.xpm JPEG 1024x768=>533x400 533x400+0+0 16-bit PseudoClass 14c 213KB 0.710u 0:00.540
For those interested in creating custom images, you can use GIMP for this work. GIMP is a free and open-source raster graphics editor used for image retouching and editing, free-form drawing, converting between different image formats, and more specialized tasks
On CentOS, install Gimp by running:
$ sudo yum install gimp
To install Gimp package on Ubuntu, run:
$ sudo apt-get install gimp
To install Gimp package on Arch, run:
$ sudo pacman -S gimp
Install 2-D Drawing Tools - tgif and fonts on CentOS
$ sudo yum install tgif xorg-x11-fonts-ISO8859-1-75dpi xorg-x11-fonts-ISO8859-1-100dpi
Install 2-D Drawing Tools - tgif and fonts on Ubuntu
$ sudo apt-get install tgif xfonts-100dpi xfonts-75dpi
Creating a Picture on Gimp
Now that we have the tools we need to get started, let's proceed to create an image used for the splash screen on Gimp.
Create an image on Gimp that fits your screen display, you might have to check screen resolution for this. In this example, I'll create an image with a resolution of 1080x920 and capacitive inch display of 10.
Open the Gimp application window, the create a new picture by navigating to File --> New
For Width, I'll use 1080, and height 920, then click OK.
On created canvas, draw your desired image, once completed, export it as linoxide.xpm
Check if the file were created successfully:
# ls -lh | grep li -rw-r--r--. 1 root root 211K Jan 19 10:34 linoxide.xpm
Compress created files:
# tar cvf linoxide.xpm.gz linoxide.xpm
Copy this file to the /boot/grub directory
# cp linoxide.xpm.gz /boot/grub
Check the current contents of /boot/grub directory:
# ls /boot/grub linoxide.xpm.gz splash.xpm.gz
Now modify grub2.conf by adding the line:
You also have to comment the line:
My grub settings look like below:
# cat /etc/default/grub GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true #GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet" GRUB_DISABLE_RECOVERY="true" GRUB_BACKGROUND="/boot/grub/linoxide.xpm.gz"
Then regenerate grub configuration file:
For CentOS 7.x, run
# grub2-mkconfig grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found background: /boot/grub/linoxide.xpm.gz Found linux image: /boot/vmlinuz-3.10.0-693.11.6.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-693.11.6.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-11caeeaf1aba438f99400d0a22b9e92a Found initrd image: /boot/initramfs-0-rescue-11caeeaf1aba438f99400d0a22b9e92a.img done
You should have settings ready for your new splash screen, proceed to reboot your OS and check if newly added screen splash will show.
Note that a .jpg or .png image can also be used without touching Gimp or doing any conversion. For this, your grub configuration file we have these lines:
# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found background: /boot/grub/linoxide.jpg Found linux image: /boot/vmlinuz-3.10.0-693.11.6.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-693.11.6.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-11caeeaf1aba438f99400d0a22b9e92a Found initrd image: /boot/initramfs-0-rescue-11caeeaf1aba438f99400d0a22b9e92a.img done
Method 2: Using Plymouth to change boot splash screen
Here I'll show you how to use Plymouth script to modify CentOS 7 splash boot screen. We'll need to install ImageMagick which provides convert package which is used to convert image from one format to another,
$ sudo yum install ImageMagick plymouth-plugin-script
Let's download an image that we'll use, here we're downloading .jpg image then we convert it to .png.
$ wget http://i1-news.softpedia-static.com/images/news2/io-js-Will-Be-Merging-Back-into-Node-js-482552-2.jpg -O splash.jpg $ convert splash.jpg splash.png $ file splash.png splash.png: PNG image data, 1024 x 768, 8-bit/color RGB, non-interlaced
Create new themes directory which will host files used for the new theme.
$ sudo mkdir /usr/share/plymouth/themes/linoxide
Copy converted splash png image to a directory created above:
# cp splash.png /usr/share/plymouth/themes/linoxide
Create new them file, here we're naming it linoxide.plymouth.
# cat /usr/share/plymouth/themes/linoxide/linoxide.plymouth [Plymouth Theme] Name=Linoxide Description=Linoxide CentOS 7 Theme ModuleName=script [script] ImageDir=/usr/share/plymouth/themes/ ScriptFile=/usr/share/plymouth/themes/linoxide/linoxide.script
Now we need to create a script which is used to generate theme.
# cat /usr/share/plymouth/themes/linoxide/linoxide.script wallpaper_image = Image("splash.png"); screen_width = Window.GetWidth(); screen_height = Window.GetHeight(); resized_wallpaper_image = wallpaper_image.Scale(screen_width,screen_height); wallpaper_sprite = Sprite(resized_wallpaper_image); wallpaper_sprite.SetZ(-100);
Now that we have everything we need, generate new ramdisk with this theme
# plymouth-set-default-theme -R linoxide
Once successful, reboot the OS and enjoy new splash screen.
In this guide, We've covered different ways of creating and using Grub splash screen on CentOS 7. You can stick to any of the methods which seem easy to set up and understand for you. A splash screen is good if you normally reboot your Computer, especially for a Desktop. It gives your machine a better look.