Ubuntu core custom splash screen

Hi,

Is it possible to change or add a splash screen to the ubuntu core when it boots?

Jake

What system are you using Ubuntu Core on? IIRC psplash can be modified on Ubuntu Core 16 and 18 on the Raspberry Pi by creating a custom gadget snap.

cc @ogra

I am using Ubuntu Core 18 and 20 on Intel NUCs.

https://cdimage.ubuntu.com/ubuntu-core/20/stable/current/ubuntu-core-20-amd64.img.xz

Is it possible?

you can not adjust the splash on existing images, you need to build your own gadget and an image that includes it … for UC18 i have some gadget source at:

you can either replace the logo.png in the bootsplash subdir or add a new file and point to it in the bootsplash/config file

this implementation relies on an initrd setup that is only available in UC16 and UC18 but was removed in UC20

i’m not sure what the plans are for UC20 splash support (it is a requirement for digital signage so we should at least get a reference implementation eventually), perhaps @xnox can point us to something …

1 Like

:+1: for wanting to be able to have a boot splash on UC20

Cheers,
Just

@ogra

So I just need to build the pc-splash-gadget and install the snap?

you need to build an image from scratch with that snap …

and use the --snap option of ubuntu-image to point to the locally built gadget snap file to have your own one included.

@ogra

Thank you. I have left you a message. I have build issues.

ah, sorry, seems psplash moved on since that gadget was created 2 years ago … i added a git commit reference for psplash to the snapcraft.yaml now so the patch should apply again …

Great!

I use this model to build UC image. https://raw.githubusercontent.com/snapcore/models/master/ubuntu-core-18-amd64.model

I want to add required-snaps:

what is the syntax for a list of strings? For example I will add mir-kiosk and network-manager

her is a core18 model assertion that uses required-snaps:

https://people.canonical.com/~ogra/snappy/appliances/fabrica/model-assertion/pi4-fabrica-model.json

This is my model

 "type": "model",
 "series": "16",
 "model": "ubuntu-core-18-amd64",
 "architecture": "amd64",
 "gadget": "pc",
 "kernel": "pc-kernel",
 "authority-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "brand-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "timestamp": "2021-11-23T21:03:24+00:00",
 "required-snaps": ["pc", "core18", "zerotier-one", "network-manager", "mir-kiosk"]
}

sudo ubuntu-image snap amd64.model --snap ./pc-splash-gadget/pc_16.04-0.9_amd64.snap

Fetching core
Fetching pc-kernel
Fetching core18
Fetching zerotier-one
Fetching network-manager
Fetching mir-kiosk
error: snap "pc" has unexpected type: gadget
COMMAND FAILED: snap prepare-image --snap=./pc-splash-gadget/pc_16.04-0.9_amd64.snap amd64.model /tmp/tmpl9jk8idm/unpack

What should I do?

either rename your snap to be called “pc” in snapcraft.yaml and re-build it or change your model assertion to:

 "gadget": "pc-splash-gadget",

well, did you re-sign the model after changing it ?

ubuntu@ip-172-31-0-224:~$ sudo ubuntu-image snap amd64.model --snap ./pc-splash-gadget/pc_16.04-0.9_amd64.snap
Fetching core
Fetching pc-kernel
Fetching core18
Fetching zerotier-one
Fetching network-manager
Fetching mir-kiosk
error: cannot use gadget snap because its base "core18" is different from model base ""
COMMAND FAILED: snap prepare-image --snap=./pc-splash-gadget/pc_16.04-0.9_amd64.snap amd64.model /tmp/tmpvw8y9cxo/unpack
ubuntu@ip-172-31-0-224:~$ cat amd64-model.json
{
 "type": "model",
 "series": "16",
 "model": "ubuntu-core-18-amd64",
 "architecture": "amd64",
 "gadget": "p",
 "kernel": "pc-kernel",
 "authority-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "brand-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "timestamp": "2021-11-23T21:03:24+00:00",
 "gadget": "pc",
 "required-snaps": ["core18", "zerotier-one", "network-manager", "mir-kiosk"]
}

Yes I did re-sign the model

ah, try adding

"base": "core18",

Hi @ogra,

I have made some progress. The image is build. I have written to disk on the PC and on a virtual box instance. I can see the splash screen. All I have is a black screen. How do I access it?

I cannot find much documentation.

The closest thing I found is this https://github.com/canonical-web-and-design/ubuntu-core-docs/blob/master/docs/en/guides/build-device/image-building.md

Not much help.

Jake

There is something wrong with my model.
This worked.

 "type": "model",
 "series": "16",
 "model": "ubuntu-core-18-amd64",
 "architecture": "amd64",
 "gadget": "pc",
 "kernel": "pc-kernel",
 "authority-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "brand-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "timestamp": "2021-11-23T21:03:24+00:00",
 "base": "core18"
}

I will rebuild the image and let you know what happens.

1 Like

It is working! Thank you
This is my model.

{
 "type": "model",
 "series": "16",
 "model": "ubuntu-core-18-amd64",
 "architecture": "amd64",
 "kernel": "pc-kernel",
 "authority-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "brand-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
 "timestamp": "2021-11-23T21:03:24+00:00",
 "gadget": "pc",
 "base": "core18",
 "required-snaps": ["core20", "network-manager", "zerotier-one", "docker", "mir-kiosk"]
}

to build it

sudo ubuntu-image snap ../amd64.model --snap ../pc-splash-gadget/pc_16.04-0.9_amd64.snap
1 Like

@ogra

One more question. Is there an expected size for the splash image? Also is it possible to set the background colour?