systemd and boot splash page (Rpi4, Bullseye)

MattNYC

New Member
Joined
Sep 4, 2023
Messages
8
Reaction score
2
Credits
114
I have read other threads on setting up a boot splash image (or video) and removing the boot text on boot up, but have always come across issues because of the OS (Bullseye, 11, Lite) or because of deprecated packages (omxplayer, plymouth methods don't seem to work).

I'm hoping someone may have the key to an issue I've been sitting with for a week!

Here's my OS details:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye

Here's what I've completed so far:
in: /boot/config.txt
Code:
console=serial0,115200 console=tty3 root=PARTUUID=2da566aa-02 rootfstype=ext4 fsck.repair=yes rootwait systemd.restore_state=0 rfkill.default_state=1 loglevel=0 consoleblank=0 plymouth.enable=0 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles
*I'm not sure if Plymouth was originally in there, or just orphaned previous attempts, but the raspberry icons and initial startup (not later) boot text is removed.

in: /etc/systemd/system/splashscreen.service (a service I created to show a splash image on boot)
Code:
[Unit]
Description=Splash Screen
#Type=idle <<< I have tried with/without this, doesn't seem to fix the issue
After=local-fs.target

[Service]
ExecStart=/usr/bin/fim -a -u -q -R /opt/splashfolder -c 'while(1){display;sleep "3";next;}'
# ExecStart=/usr/bin/fbi -d /dev/fb0 --noverbose -a /opt/single image/splash.png <<< I have tried with/without this, doesn't seem to fix the issue
Type=oneshot <<< I have tried with/without this, doesn't seem to fix the issue
StandardInput=tty
StandardOutput=tty
# RemainAfterExit=no <<< I have tried with/without this, doesn't seem to fix the issue

[Install]
WantedBy=sysinit.target

I would also run the following lines of code after setting the files up above (I'm not sure if enable alone is sufficient):
systemctl enable splashscreen
systemctl start splashscreen

As you can see I have tried different things in the commented lines of code.

Originally I was trying with a single splash screen image using fbi.
This worked to a point. On boot, no text was shown, the splash image was shown, but after 2 seconds, boot text (auto login, and x server code) appears on top of the splash image which looks terrible.

My second iteration, as shown above in the uncommented code, involves using fim, and a slideshow approach with the first image being the correct splash page, and the second image in the folder being a black image (so when the auto login and x server text appear, they appear on the black image after the official splash page is shown).

This works a lot of the time, but not all the time. It seems to be affected randomly on reboot vs shutdown and restart, specifically with switching the order of the two slideshow images. It seems to randomly put the black image first, then the official splash image, then the autologin and xserver boot text appears on top of the official splash image. Simply switching the names 1.png and 2.png of the two images, doesn't solve the order of the appearance of the slideshow images, because shutdown and restart actions seem to affect the sequence showing. I'm not sure if shutdown and restart keeps a "memory" of the remaining sleep time in the code, thereby not reseting the image display order?

If anyone has any advice on how to update the systemd file above (or any alternate method) I'd appreciate it soo much

My goal would be either:
1. To not have a slideshow, just the single image for the splash, follwoed by no boot text (effectively how do I hide the autologin text and the x server text. I need these things both to happen, just invisibly.
or
2. Get my fix of having the autologin and x server boot text to appear consistently on the second black image (which it currently does part of the time with the code above) but to resolve the issue where sometimes the official splash image and the black images are displayed in different orders depending somehow on reboot or shutdown/restart actions, and I cannot identify which messes it up. It might go wrong on an uplug, and then consistently go wrong on future reboots.

Please help!

- - - -

Just to add, the inconsistencies with the order in which 1.png and 2.png are shown are not just because of reboot vs shutdown/restart.

I just ran a test with 4 "sudo reboot"s from the console and the first three were perfect (showing the official splash page for a few seconds (1.png) followed by the black page image (2.png) with the autologin and x server text on top of the second black image).

But the forth sudo reboot, switched the order, showing 2.png first (the black image), followed by the official splash page (1.png) but then all the console text was on top of this official splash page image).

Really is driving me crazy. Please help :roll: :?
 


In Debian by default there are a couple of things missing from Plymouth - 1) plymouth-themes and 2) plymouth-x11both are needed to make your own theme
 
Thanks for the reply LB.

I had read that there were issues with Plymouth and Bullseye Lite, so avoided it despite the mention in the cmdline.txt above. In fact when I remove those references to Plymouth, everything still works as described.

I'm close using FBI (for single image) or FIM (for slideshow, in my case 2 images). Just that remaining console text for auto login and x server.

FIM, in the service does get close, but why would this switch the order of images displayed arbitrarily?

Very strange.
 
Just to add, I mentioned I thought there was an issue with Plymouth and RPi4, but it's really with an issue with "dtoverlay=vc4-kms-v3d" in the boot/config.txt setting that I need for other graphics requirements, which people report as generating a blank screen with Plymouth, as described at the link below:

If there is a way to fix what I have, with FBI (single image) or FIM (slideshow of two) as run in the systemd service as shown above, then this is potentially going to save some other headaches.
 
From the Synaptic Package Manager there is: obs-advanced-scene-switcher

Advanced Scene Switcher plugin is based on the built-in Automatic Scene
Switcher. It extends its functionality by adding the following:
- Audio based scene switching (Audio tab).
- Media based scene switching (Media tab).
- System time based scene switching (Time tab).
- Sequence of automated scene switches (Scene Sequence tab).
- Cursor position based scene switching (Region).
- The option to switch to a scene after detection of being idle (Idle tab).
- Executable based scene switching (Executable tab).
- File content based scene switching (File).
- Improvements for the window title based scene switching (full-screen /
maximized detection, ignore windows).
- The ability select a different transition for each automated switch case
(Transitions tab).
- Automatically pause the scene switcher based on scene or window title
hotkey to start and stop the scene switcher.
- Trigger actions on scene change.
 
Last edited by a moderator:
Hi LB, I have a post pendind moderator approval above (because it contains a link) but it describes an issue with Plymouth and dtoverlay=vc4-kms-v3d in boot/config.txt

I appreciate your new response but I'm not sure where to start. Are you recommending I install a new package?

Do you see any route to fix FBI or FIM rmentods running in systemd to consistently show the image(s) in the same order (with FIM) or to not put the autologin and x server boot text over the single splash image (with the FBI) method as mentioned above?
 
Hi LB, I have a post pendind moderator approval above (because it contains a link) but it describes an issue with Plymouth and dtoverlay=vc4-kms-v3d in boot/config.txt

I appreciate your new response but I'm not sure where to start. Are you recommending I install a new package?

Do you see any route to fix FBI or FIM rmentods running in systemd to consistently show the image(s) in the same order (with FIM) or to not put the autologin and x server boot text over the single splash image (with the FBI) method as mentioned above?
That is a new package above will simplify things it add all those extra functions to the built in scene switcher
 
Sticking with all the same code, files and settings I pasted up top, I can get the splash images to be consistently in the correct order if I execute the following line before every reboot (cli: sudo reboot) and before every plug pull (essentially: shutdown and restart):

systemctl daemon-reload

Is there a convenient place to run this code every time the rpi starts so that the event of a reboot/shutdown/restart, the next boot wil show the thwo splash images in the correct order? (unless anyone can help with the dream outcome of hiding the autologin and x server boot text)
 
Where you put your script depends on who the intended user is. If it is just you, put it in ~/bin and make sure ~/bin is in your PATH. If any user on the system should be able to run the script, put it in /usr/local/bin.

Do Not put scripts you write yourself in /bin or /usr/bin. Those directories are intended for programs managed by the operating system.

Hope this helps
 
Thanks LB - I created a script and ran it on boot, but it doesn't seem to be solving the issue.

It feels as though I'm building something complex to solve a simple issue, adding to the load.
Do you, or anyone else reading this know:

1. How to hide RPi's autologin text on login? (I don't want to disable login, I just want it to be invisible with no text on boot)

and/or

2. Why using FIM as pasted high above, with a folder with two images, show the images consistently, but in changing orders?

It's so baffling and frustrating why these two things cannot easily be solved.
 
I do not know if you can just hide the login as far as I know it is either on or off - maybe check the lightdm.conf file to see if what you want is there /etc/lightdm/lightdm.conf
 
I'm now only missing the hiding of the xorg boot messages that came after the autologin messages. If anyone else can help.

As for the solution to hide the autologin message, here's the solution I found:
Code:
4. Remove login message
Create ‘.hushlogin’ file in home directory.

touch ~/.hushlogin
It removes login message below [1]:

Last login: Tue Nov 21 14:51:56 2017
Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l
 
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
 
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Followed by:
Code:
5. Remove autologin message by modify autologin service
5-1. Open “[email protected]/autologin.conf”.

sudo nano /etc/systemd/system/[email protected]/autologin.conf
5-2. Replace the line below:

ExecStart=-/sbin/agetty --autologin pi --noclear %I xterm-256color
with:

ExecStart=-/sbin/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM
It removes autologin message below:

Raspbian GNU/Linux 9 raspberrypi tty1
raspberrypi login: pi (automatic login)

So I reverted back to a single splash page image using fbi in a service, and now everything is almost perfect, I just need to hide the xorg messages and someone mentioned the following, but am not sure where the .ini file is or how to make this happen:
Code:
x_cmd = /usr/bin/X > /dev/null 2>&1
&
x_cmd = /usr/bin/X -keeptty > ~/.xorg.log 2>&1

In the config.ini file
 
LB - thank you for your assistance.

While directly I wasn't able to use your solutions, you kept me going, researching and approaching a solution.

In case anyone reading now, or in the future searched and stumbled upon this thread, here's the solution that worked for me (I think I included all the steps below, but maybe forgetting "sudo systemctl enable [email protected]" at some point, or was that disable!?:rolleyes:)

To remove the boot up text re: xorg/startx, I only had to edit the .bash_profile for the logged in user, adding &> /dev/null to the end of the file, making it:
Code:
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor &> /dev/null

To still autologin, but without the boot text showing it:
Code:
1. touch ~/.hushlogin in the home directory
2. Open “[email protected]/autologin.conf”
sudo nano /etc/systemd/system/[email protected]/autologin.conf
3. Replace:
ExecStart=-/sbin/agetty --autologin pi --noclear %I xterm-256color
with:
ExecStart=-/sbin/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM

To get a splash page in place as the only thing shown on boot, before going into the startx window/chromium kiosk:
1. Make a splash screen image and save it in a directory (e.g. /var/www/splash/1.png)
2. Create a systemd service (e.g. splashscreen.service):
Code:
nano /etc/systemd/system/splashscreen.service
3. Paste in the following and save:
Code:
[Unit]
Description=Splash Screen
After=local-fs.target
[Service]
ExecStart=/usr/bin/fbi -d /dev/fb0 --noverbose -a /var/www/splash/1.png
Type=oneshot
StandardInput=tty
StandardOutput=tty
[Install]
WantedBy=sysinit.target
4. Enable the service:
Code:
systemctl enable splashscreen

One last thing is that my /boot/cmdline.txt file was changed to include quiet splash, console=tty3, loglevel=0, logo.nologo, and I cannot remember the full extent to which these solved my issue described here, or if they just solved removing the pre-splash page boot text, rainbow image and raspberry icons.
Code:
console=serial0,115200 console=tty3 root=PARTUUID=USEYOURID rootfstype=ext4 fsck.repair=yes rootwait systemd.restore_state=0 rfkill.default_state=1 loglevel=0 consoleblank=0 logo.nologo vt.global_cursor_default=0 quiet splash

I really hope this helps someone, I appreciate this forum and I appreciate your assistance LB.
 
Last edited:

Staff online


Top