How to implement a customized boot process with splash page and no messages in Debian Stretch

This article illustrates how to achieve a customized boot process with a boot image shown. A Debian Stretch lite operating system is assumed.

Danger ahead !!

Many if not all, of suggestions contained in this article could, if misapplied, easily make your system unreachable or ill behaving in many unexpected ways. So, before you start to do changes on some system travelling on next ESA deep space probe or sitting on Mt. Everest top, try them at home on a serial console equipped test system.

Moreover, keep in mind that when everything else fails, you can physically dismount the SD card and edit the offending files off-line.

How to hide all the boot messages and prompts

The first step is meant to get rid of all messages and prompts at the boot.

Edit the following files and carefully make the changes in bold.

sudo nano /boot/cmdline.txt 

dwc_otg.lpm_enable=0 console=serial1,115200 console=tty3 root=PARTUUID=6b391ee6-02 rootfstype=ext4 elevator=deadline rootwait consoleblank=0 loglevel=3 quiet logo.nologo  vt.global_cursor_default=0
sudo nano /boot/config.txt 

# custom splash

Next run the following commands that remove the login prompt and Debian native screen saver:

sudo systemctl disable getty@tty1
sudo systemctl mask plymouth-start.service

Next reboot and check: you should see no messages anymore (black screen).

sudo systemctl reboot

Install and run a customized splash screen

Create under /home/pi an images/ directory and copy there the splash screen bitmap:

mkdir images
cp splash.png images/

Install the fim graphical utility that is able to copy a bitmap into the frame buffer memory area:

sudo apt-get install fim

Create a dedicated service

sudo systemctl edit boot-splashscreen-2.service --force

with the following contents:

Description=boot splash screen

# Do not put here any After/Before clauses, just let systemd do its job !



ExecStart=/usr/bin/fim -q -a /home/pi/images/splash.png 

ExecStartPost=/bin/sleep 3


Test the service

sudo systemctl start boot-splashscreen-2.service

enable the service

sudo systemctl enable boot-splashscreen-2.service

reboot to check everything is as expected:

sudo systemctl reboot

What is expected is a full black screen at the start, after few seconds the splash screen is shown. If you didn't configre any other grapphical application, it will stay there till the next reboot/halt.

Using the following command we can verify that the boot splash panel has been started just whene we want.

pi@cm3panel:~ $ sudo systemd-analyze critical-chain

The boot splash is shown in red (bold mine), just after and well before the achievement of sysinit, as per its service file. @13.296s
└─ @13.295s
  └─ssh.service @13.046s +248ms
    └─ @13.039s
      └─dhcpcd.service @4.928s +8.109s
        └─ @4.921s
          └─ @4.921s
            └─triggerhappy.socket @4.921s
              └─ @4.920s
                └─systemd-timesyncd.service @4.678s +242ms
                  └─systemd-tmpfiles-setup.service @4.649s +23ms
                    └─boot-splashscreen-2.service @1.630s +3.015s
                      └─ @1.616s
                        └─boot.mount @1.601s +14ms
                          └─systemd-fsck@dev-disk-by\x2dpartuuid-6b391ee6\x2d01.service @1.322s +274ms
                            └─dev-disk-by\x2dpartuuid-6b391ee6\x2d01.device @1.294s

What is delaying my bootstrap process ?

In case you need a very short boot time (e.g. if you are using the CM3-Panel as an appliance controller), the following suggestions could help

  • Disable plymouth-* services
  • Disable any other service not strictly needed (e.g. lightttpd)
  • Put a static IP address instead of using DHCP client daemon (due to protocol mandatory timeout it takes up to 8 seconds to start)
  • Disable avahi-daemon (due to protocol mandatory timeout it takes up to 8 seconds to start)

dhcpcd.service is lasting forever, how can I speedup it?

In the current Raspbian lite images, the dhcpcd.service has a so-called drop-in file, i.e. a file that is changing the package prrovided systemd .service file. Specifically, the option -w is getting added: it causes the process dhcpcd to wait till all the interfaces achieve an IP address.

$ sudo systemctl cat dhcpcd.service 

# /lib/systemd/system/dhcpcd.service
Description=dhcpcd on all interfaces

ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b
ExecStop=/sbin/dhcpcd -x


# /etc/systemd/system/dhcpcd.service.d/wait.conf
ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w

Removing that option the service is able to start in less than one second instead of 12. Of course, that could even trigger anomalous behavior, so it is advisable to use this configuration only on systems where the network services are not critical to the appliance working.


Andrea Montefusco
Currently employed as network architect, always Internet working man, real C/C++ programmer in the past, network and Unix system engineer as needed, HAM Radio enthusiast (former IW0RDI, now IW0HDV), aeromodeller (a person who builds and flies model airplanes) since 1976 (ex FAI10655). - - -