Archive

Boot Splash


What is a Boot Splash?

Basically a bootsplash is simply an image (or splash screen) that gets displayed whilst your system is booting. It can be used in ‘silent’ mode which will simply show you a progress bar whilst the system is booting – similar to that of Windows XP, except it actually indicates how far through the boot process you are rather than just continuously scrolling. It can also be used in ‘verbose’ mode which simply overlays the boot text on top of an image that you’ve chosen. You can (currently) see examples of both these modes at the home of the Boot Splash – http://www.bootsplash.org/

Requirements

In order to add a boot splash to your system, you’ll need to:

Note: There are a few distros which provide boot splash options for you without going through this process, at the moment I’m not sure which they are so I’d advise checking first. In particular RedHat, SuSE or Mandrake may do this for you.

Themes

Currently you’ll find a great selection of themes at: http://www.bootsplash.de/files/themes/ , at KDE Look http://www.kde-look.org/index.php?xcontentmode=35 and you should find some by searching on Google too. Some distros (for example SuSE) package their own themes too, so it might be worth checking to see if this is the case for you.

You can also make your own themes fairly easily, although how to do this is beyond the scope of this document and it is simply suggested you read the documentation available here: http://www.bootsplash.org/themeinfo.html and also look at existing themes as examples.

Patching your kernel sources

Once you’ve downloaded the kernel patch you’ll need to apply it and rebuild your kernel. I did it like this:

$ cd /usr/src/linux             [[symlinked|to /usr/src/linux-2.6.0]] $ patch -p1 < ~/patches/2.6.0/bootsplash-3.1.3-2.6.0-test9.diff $ make oldconfig                [[You'll|be asked if you want to use [[BootSplash]] - answer 'Y']]

If you are compiling your kernel for the first time and don’t have a ‘.config.old’ then you’ll probably want to run ‘make menuconfig’ to create a config file.

Note: The patches on the bootsplash site are updated infrequently and often fall behind the latest kernel version.

Before running a ‘make’ on the kernel, ensure you’ve selected the following options:

CONFIG_BLK_DEV_INITRD=y CONFIG_BOOTSPLASH=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_VGA_CONSOLE=y CONFIG_LOGO=n                     [[ You|cannot use the kernel boot logo and bootsplash together ]]

If you need help on compiling the kernel, try looking through /KernelBuilding for help. Once you’ve built the kernel, copy it into /boot/ and modify your boot loader (probably LILO or GRUB) so that you can boot the new kernel – ideally you should be able to revert to the old kernel at boot just in case you have a problem too.

Adding your theme

Once you’ve chosen or created a theme, run:

$ mkdir -pv /etc/bootsplash/themes/

which will give you a place to put your theme. In my case, I have the following directories:

/etc/bootsplash/themes/custom/           [[ No|files ]] /etc/bootsplash/themes/custom/config/    [[ Contains|only bootsplash-1024x768.cfg ]] /etc/bootsplash/themes/custom/images/    [[ Contains|bootsplash-1024x768.jpg and silent-1024x768.jpg ]]

Creating an initrd

To create the init ramdisk for your kernel to extract the boot splash image from, you’ll need to use the userspace tools that you hopefully downloaded earlier (Requirements).

Uncompress the tools archive, change into the directory that is created and run ‘make’ to build the tools. If you get an error during the make process which says something similar to:

freetype.h:20:2: #error "`ft2build.h' hasn't been included yet!"

then a simple fix is to load ttf.c in your editor, and alter the top of the file to read:

#include <assert.h>  #include <ft2build.h>              [[ <--|this line has been inserted ]] #include <freetype/freetype.h> #include <freetype/ftoutln.h>

Quit, save and run make again. This should now have built the tools that are needed to create the ramdisk for the kernel, and we’re ready to use them. If you are already using an initrd, replace ‘initrd.splash’ below, with the name of your existing ramdisk. Run the following command to create the initrd image:

 1. splash -s -f /etc/bootsplash/themes/[themename]/config/bootsplash-1024x768.cfg >> /boot/initrd.splash

Note: If you already use a ramdisk to boot your kernel, you can use the command above (with the correct name of the existing ramdisk) to append that file.

Modifying your boot loader

Getting this part wrong may render your system unbootable. Make sure you’re confident you know what to do if things go wrong (for example how to boot your system from a rescue CD), and ideally take a backup of the config file for your bootloader. We’ve created an initrd image for the kernel to use, so now we need to tell the bootloader to hand it to the kernel at boot time:

In lilo, add the lines

{{{     vga=791                      [[ This|selects 1024x768 - you may wish to modify this value ]]     initrd=/boot/initrd.splash   [[ or|the location of the ramdisk you are using instead      ]]

to the stanza for the kernel you have just compiled. Run lilo -v and check that it has run successfully. }}}

or in grub, add:

initrd (hd0,3)/boot/initrd.splash

Where hd0,3 is the partition you are booting. You’ll also need to append ‘vga=791’ to the appropriate ‘kernel’ line in your config file so that the correct vga mode is selected.

Reboot, and cross your fingers :-)

Troubleshooting

  • “At boot I see the kernel image being decompressed and then the screen goes blank! Help!”

There is a problem with your kernel’s support of console framebuffer mode and the screen will remain blank whilst the system is booting, but will reappear if X is set to load automatically at boot. Check you compiled the kernel with all the options shown above set to ‘y’ and that the mode selected (791 or 0x371 in this case) is suitable for your hardware. You can also pass the vga=normal option to your bootloader at boot time to restore your original graphics.

Leave a Reply