I came across usplash recently as a solution to setting up a custom bootsplash screen. It installed and worked fine, but there didn’t seem to be any way to customise the splash screen. There are plenty of HowTo’s for how to customise it in Ubuntu (like this one) but they didn’t work for Debian.

The reason is that the Debian build doesn’t use a shared library for the bootsplash screen. Instead, it’s compiled in and so will always use the testcard theme.

Changing it is pretty simple though. Firstly,

apt-get install usplash libbogl0 libbogl-dev libgd2-noxpm libgd2-noxpm-dev
apt-get source usplash

I’m presuming you already have ~/bs.png that you want to use for the bootsplash. This should have a 16 colour palette and be of the required resolution.

Next, cd into the usplash source directory and copy your bootsplash image into it.

cd usplash-0.3e
cp ~/bs.png usplash-artwork.png

For this example, I’m setting up a usplash-artwork theme.

Next, use pngtobogl to convert the png image to C code.

pngtobogl usplash-artwork.png >usplash-artwork.c

The easiest way to set up the theme is copy usplash-testcard-theme.c and edit it for your own theme. In this case, you’ll want to search for any occurances of testcard and change it to artwork. Do this with sed, awk or whatever editor you use (which, of course, should be ViM!!). The code you’ll want to change is pretty obvious in the file too. To change the colours, edit the hex values for the palette indexes. Your image should have 16 colours, and each hex value, 0×0 through 0xf, will represent one of those 16 colours. The rest are positions and sizes for the progress bar, text box and text.

Lastly, edit usplash.c and again search and replace testcard with artwork.

sed -e ‘s/testcard/artwork/g’ usplash-testcard-theme.c >usplash-artwork-theme.c
vim usplash-artwork-theme.c
** Edit the palette, progress bar, text box and text details **
vim usplash.c
** Search and replace testcard for artwork **

Now, you’re ready to compile usplash again. Just run make in the source directory. Shortly afterwards, the usplash binary is there. Next thing is to “install” it! As root do

cd /sbin
cp usplash usplash.bak
cp ~/usplash-0.3e/usplash .
update-initramfs -u

This backs up your previous usplash binary, copies in your newly compiled one and updates the kernel’s initrd to contain your newly created bootsplash image.

Lastly, reboot to see the bootsplash screen.

Tip: you can test the image without rebooting by just running your usplash binary as long as X isn’t running. It obviously won’t have any progress bar animation or text, but you’ll get a good idea of how it’ll look during boot.

Edit – 2007-08-13

Two minor updates to this. Firstly, if you run usplash just after compiling, and you get a bogl_init failed message, it’s probably because you’re not using framebuffer support. You’ll need to edit /boot/grub/menu.1st as follows :

# defoptions=quiet splash vga=791

Leave the ‘#’ in place. It’s picked up when you run update-grub and added to the kernel line for each configured kernel. So, update it now with update-grub.

The different options for vga= are :

  • 785 – 640×480
  • 788 – 800×600
  • 791 – 1024×768
  • 794 – 1280×1024

The second issue is that when you boot, the bootsplash screen is ended prematurely and a load of the usual boot-text is shown. To fix this, edit /etc/init.d/console-screen.sh and find the text unicode_stop 2> /dev/null|| true and comment it out, so it looks like

#unicode_stop 2> /dev/null|| true

Now your bootsplash screen should run right to the end of boot.



Possibly related:


You must be logged in to post a comment.

Name (required)

Email (required)

Website

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Share your wisdom