Ubuntu Core custom Plymouth theme

I’m not sure if this is the right place but I’m trying to create a custom Plymouth theme for Ubuntu Core and I am finding the documentation a little confusing.

So far I have created a custom model file and built a working image. Then I have added a vendor logo to the /splash directory and this works but I need to customise this further.

I have cloned core-splash, customised it and build the gadget snap.

The confusing things I’d like to understand are:

  1. This is a gadget snap but when I add it to my model I get an error saying only one gadget is allowed.
  2. Adding as a normal snap seems to do nothing - I see the old splash sccreen
  3. The core-splash file paths seem to be completely different to the documentation, particularly the organize section in snapcraft.yaml and the ThemeDir in plymouthd.conf
  4. What is the $GADGET variable supposed to be as I cannot find it documented anywhere?
  5. The docs say use vendor.plymouth but the example code uses ubuntu-core.plymouth

Any help with this is appreciated!

You should not need to do that, AFAIK all the bits in there are nowadays part of the core snap… (@abeato may correct me)

No, this snap only contains the plymouth binary, all helper scripts and the default fallback Ubuntu theme, it is not a gadget…

Yes, as the README says, this snap is to be consumed by the core snap at build time, you should not add (or use) it anywhere (see above)

This should have better been written as <gadget> it only means to represent the top level of the snap…

If you look at the code of the core-splash snap you will see that to will use vendor.plymouth if that exists, else it uses ubuntu-core.plymouth

@ogra Thank you for your reply. So if I want to customise the Plymouth theme do you have any pointers to how I do it? I have the new theme - I just don’t know where to put it.

Hi @relvin

I have successfully added a custom theme in a few different gadget snaps.

Essentially. you need to add your custom theme content via a part in your existing gadget snap, and you just need to add it to the correct path. Once you have done that, assuming you have also set kernel parmas quiet splash via the gadget too, it should work if the theme is valid.

Don’t forget, the only supported plymouth plugin type is scripts [ script.so ], and you must be using at least Ubuntu Core 22.

For example, say you have a git repo with your theme content, something like:

./themes/theme-foo/splash/plymouth/themes/vendor/vendor.plymouth
./themes/theme-foo/splash/plymouth/themes/vendor/vendor.script
./themes/theme-foo/splash/plymouth/themes/vendor/something-1.png
./themes/theme-foo/splash/plymouth/themes/vendor/something-2.png
~~~8<~~~
./themes/theme-bar/splash/plymouth/themes/vendor/vendor.plymouth
./themes/theme-bar/splash/plymouth/themes/vendor/vendor.script
./themes/theme-bar/splash/plymouth/themes/vendor/otherthing-1.png
./themes/theme-bar/splash/plymouth/themes/vendor/otherthing-2.png

You scripts [ vendor.script ] are up to you of course, and your plymouth configs [ vendor.plymouth ] , might look something like as follows:

[Plymouth Theme]
Name=Foo Theme
Description=The Theme Of Foo
ModuleName=script

[script]
ImageDir=/run/mnt/gadget/splash/plymouth/themes/vendor/
ScriptFile=/run/mnt/gadget/splash/plymouth/themes/vendor/vendor.script

Add a part to your gadget to include one of the themes from the repo, similar to the following:

  boot-splash:
    plugin: dump
    source: {git-url-to-splash-theme}
    organize:
      themes/theme-foo/splash: splash
    stage:
      - splash

Then build and test.

If you want to test outside of boot/shutdown, you can do the following:

In one shell:

plymouthd --no-daemon --debug

In another shell:

plymouth --show-splash
plymouth display-message --text="Just testing"

Hope that helps.

Cheers, Just

2 Likes