How to boot with a splash screen and a progress bar

Index


Introduction

The boot splash utility, which is part of the Gentoo gensplash project, provides a background image and a progress bar during Linux kernel boot and the services loading phase. In this page we will refer to version 1.5.3.4, available as update for STLinux-2.3 distribution

You can choose between two boot modes: silent and verbose:

  • In silent mode, a progress bar will be displayed along with the background image to inform you of the boot status.
  • In verbose mode a background image will be displayed while the kernel console output will be visible on the screen. This will happen if your linux kernel will be built with the splash screen feature enabled. If it will not, verbose mode will simply display log messages as usual.

Summarizing, splash screen is a stand alone application that, with a feature enabled on kernel, also allows to interact with the system consoles.

If you choose to initialise your system using the initramfs, documentation on how to do this can be found in the kernel source directory Documentation/early-userspace, and there are also useful references at the linuxdevices web page and the timesys web page. To fully acquire know-how about all splash available commands, it is strictly recommended to read package documentation distributed with binaries.

[Top]

What you need

To allow boot splash to fully work you need to have:

  • The splashutils target package correctly installed.
  • The framebuffer package stmfb correctly installed (see the Framebuffer driver guide or read the <stmfb_root_dir/Linux/Documentation/*.txt> files for Rel2.3).
  • To interact with shell consoles you also need to have a linux kernel built with splash option enabled.
  • Your ST board connected to the TV.

[Top]

Configuring the kernel

To use the boot splash utility you have to enable the framebuffer in your linux kernel. If you also like to display a background image for all your system consoles, you have to enable splash features in your linux kernel.

Open the kernel menuconfig and pay attention to enable (if they already aren't) the following features:

Device Drivers ---> Graphics Support ---> Support for framebuffer devices
System type ---> Memory management options ---> Big Physical Area version 2
Device Drivers ---> Character Devices ---> Virtual Terminal
Device Drivers ---> Character Devices ---> Support for console on virtual terminal
Device Drivers ---> Graphics Support ---> Console display driver support ---> Framebuffer console support
Device Drivers ---> Graphics Support ---> Enable Software Drawing
Device Drivers ---> Graphics Support ---> Console display driver support ---> Support for the Framebuffer Console Decorations

Kernel command line options

When booting the kernel, splashutils is controlled by a number of kernel command line options. They are:

bigphysarea
: This is required and must be at least set to bigphysarea=4000
console
: console=tty1 will redirect both kernel and initscript messages to tty1
CONSOLE
: CONSOLE=/dev/tty1 will redirect all initscript messages to tty1

Note: Either CONSOLE=/dev/tty1 or console=tty1 must be supplied and they are usually provided for all kernel command line.

There are also options to control the bootsplash behaviour. The options below must all follow a splash= kernel option. As usual, splash options are separated by commas and they should form a continuous configuration string. Options are:

off
: it disables silent and verbose splash
verbose
: it starts the system with a verbose splash screen
silent
: it starts the system in the silent mode (all messages for both kernel and initscripts boot are covered by a picture)
theme:foo
: theme 'foo' is used. Splash package provide documentation on how to create a new theme (usually located under /etc/splash directory).
tty:n
the n-th tty is used as the silent tty. Default silent tty is tty8

An example of a splash kernel command line setting:

splash=silent,theme:st_theme CONSOLE=/dev/tty1 or
splash=silent,theme:st_theme console=tty1


Note: if nothing is passed in command line, background console image will not start automatically, although splashutils at user level will not be affected from this command line lack. So if you only need to use splash to display something at kernel boot you need to pass no splash command line, only bigphysarea (for framebuffer initialization) and console are required.

[Top]

How splash utils work

User will switch from silent and verbose mode simply interacting with a FIFO, initialized by the splash daemon.
Once on board (using the same kernel command line options as already explained), if kernel feature is enabled, after loading framebuffer the fbcondecor_helper will start, displaying the verbose image on the current system console. Starting from now, once a new console will be opened, this image will be displayed.
To manage this, fbcondecor_ctl is provided: with it, user can set to on/off this feature and get many more informations from the system.
This regarding the interaction from kernel and user space. To manage the simple fbsplash application in user space the best thing to do is to start the daemon.

fbsplashd.static -t _theme_

where _theme_ is the preferred theme to load, located under /etc/splash directory.
Once daemon is started user can communicate with it through a FIFO in the following mode.

echo "_command_" > /lib/splash/cache/.splash

where _command_ types are explained in the new splashutils documentation (furnished with the rpm package). Using this, user can set mode, progress bar increment, many other features and also he can stop the daemon.

[Top]

Configuring the user space

To use the boot splash application you must first load the framebuffer modules. Supposing you like to display a progress bar during kernel boot, one thing you can implement is to modify the /etc/init.d/rcS script.

Here is an example of a modified rcS file for an stx7109 cut3 board:

...
insmod <path_to_stmcore>/stmcore-display-stx7109c3.ko
insmod <path_to_stmfb>/stmfb.ko display0=<your_init_parameters>
mount -t proc proc /proc
max_progress=`ls /etc/rc.d/rcS.d/S* | wc -l`
k=`expr 65534 / $max_progress`
j=$k
/sbin/fbsplashd.static -t st_theme
echo "set mode silent" > /lib/splash/cache/.splash
for i in /etc/rc.d/rcS.d/S* ; do
      ./$i
      echo "progress $j" > /lib/splash/cache/.splash
      j=`expr $j + $k`
done
...

In this example, all services are started inside the 'for' cycle. After each service starts (./$i), the progress bar is updated with the given command.

max_progress, k and j are useful variables to calculate the amount of the progress bar increment (depending on the number of services).

path_to_stmcore, path_to_stmfb and your_init_parameters are user dependent.

[Top]