Oh I've done it, but it was a complete and utter PITA.
First, the usual plymouth files, mytheme.plymouth:
[Plymouth Theme]
Name=My theme
Description=Raspberry Pi theme
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/mytheme
ScriptFile=/usr/share/plymouth/themes/mytheme/mytheme.script
And then mytheme.script
screen_width = Window.GetWidth();
screen_height = Window.GetHeight();
theme_image = Image("mytheme.png");
resized_wallpaper_image = theme_image.Scale(screen_width, screen_height);
sprite = Sprite(resized_wallpaper_image);
sprite.SetZ(-100);
message_sprite = Sprite();
message_sprite.SetPosition(screen_width * 0.1, screen_height * 0.8, 10000);
fun message_callback (text) {
my_image = Image.Text(text, 1, 1, 1);
message_sprite.SetImage(my_image);
}
Plymouth.SetUpdateStatusFunction(message_callback);
These then go in the relevant places in /usr/share/plymouth/themes/mytheme
along with mytheme.png.
Then you enable mytheme with the plymouth-set-default-theme
command.
Now some trickery. plymouth can only read the first 1024 bytes of the kernel cmdline... but, the Rpi loader PREPENDS things to /proc/cmdline, so you may THINK you did it right, but if you cat /proc/cmdline
later, you may find that your settings in fact fall off the 1024 byte limit. So you have to add the quiet splash and plymouth ignore settings very early in cmdline.txt.
I have my cmdline.txt set to this (but we use the adafruit touch screen, so ymmv):
dwc_otg.lpm_enable=0 console=tty3 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles fbcon=map:10 fbcon=font:VGA8x8
Now, you also must use an initramfs, because the splash screen is enabled from the early startup scripts. This is usually as easy as running update-initramfs
and specifying initramfs initrd.img-4.1.9-v7
(or similar) in /boot/config.txt.
In my case, I also had to update plymouth because the version that ships with Jessie would segfault in the framebuffer driver and as a result I could not get it working on the adafruit touch screen.
After that, it started working for me. But I also wanted a "safe to turn off" screen at the end, as the Rpi doesn't have hardware to turn itself off. So I added a systemd script for that:
[Unit]
Description=Tell Plymouth to show a safe-to-power-off message
DefaultDependencies=no
After=umount.target
Before=shutdown.target
[Service]
ExecStart=-/bin/plymouth update --status " SAFE TO POWER DOWN"
Type=oneshot
[Install]
WantedBy=shutdown.target
Now it has been at least 6 months since I did this, but I hope this is useful.
Edit: Add some more hints.
You can debug plymouth themes like so. Start plymouthd in debug mode, eg:
plymouthd --debug --debug-file=/tmp/plymouth-debug-out
And then you can test your theme using:
plymouth --show-splash
plymouth --quit
It was during this stage that I found out that I had a segfault.
You can also halt your boot process and drop into a shell to test this in a boot-time environment. Edit /boot/cmdline.txt and add break=top
, or see here for more info on that.
These are all tricks I used and I finally got there. But as I said, it was a PITA.