Hi guys, why is it so complicated to replace the boot splash screen image on ubuntu core?? I’m trying to follow the guide on the site, it writes two methods, I wanted to follow the first one, but I don’t understand … I found the path of the image, but I can’t change the image because it’s in a read-only directory… Can somebody help me? Thanks!
You’d need to rebuild the gadget snap and effectively roll out your own customised version of Ubuntu Core. The directory being read-only is part of the general defences on Ubuntu Core. Are you building Ubuntu Core yourself? If it’s more a general curiosity thing, then it’s not really trivially doable. If it’s a professional project that needs support commitment, the customised image is the only approach.
Hi james, this is the first time that approach at ubuntu core, im built a simple kiosk with ubuntu frame but i want to customize the boot splash screen logo with my logo… at moment ive only vps with armhf architecture (Oracle Ampere) and at this time im trying to follow this repo “GitHub - canonical/pi-gadget: Universal pi (pi2,pi3,pi4,cm3,cm4 and future) gadget snap for Ubuntu Core and classic systems.” but my vps report this error “craft-providers error: Timed out waiting for networking to be ready.” So, the only way is to build a new ubuntu core image for my pi5 that have inside the new boot splash screen image? the tutorial and guide for this ubuntu core are not easy to find … can you help me into the process? im stuck on this step… thanks!
i choose ubuntu core for this, effectly
I’m not entirely familiar with the best practises for Ubuntu Core images, but take a look here for a worked example: https://ubuntu.com/core/docs/create-model-assertion
Once you get this to build with no changes, try making your own signed assertion that manipulates the .IMG file to e.g add say the nano
snap. Once you’ve got that working, which will involve signing this assertion with your own private key, you can test actually deploying with it.
If you can change the image to install a snap by default, the final step then would be to change it to point the gadget snap to your own gadget snap, with an ammended logo. Usually I’d say run snapcraft
on the gadget snap repo, but in this specific instance, you might find it easier to extract the official Pi gadget snap, add your logo to it, repack it, and then sideload it with --dangerous
.
In order to do that, you’d have to also modify the security to accept unsigned packages
"grade": "signed",
But you’d then be able to point this to your new gadget snap locally, skip the signature checking on the gadget snap itself, and then use it.
That’s the high level of what needs to be done, but I thought I’d mention in advance if your plan is to use this Pi with a GUI session, say a more Raspbian-type deal with Firefox and LibreOffice, Ubuntu Core won’t be for you. It’s for IoT, servers, and Kiosk applications. There’s a pre-alpha experiment known as Ubuntu Core Desktop, which would include e.g Gnome/Plasma and work similarly to a Chromebook in how it operates, but it’s a long way off and not really ready for daily usage by anyone other than people actively developing it because it’s a huge amount of work that might never reach completion. (Although I’m keen it does, because I think Ubuntu Core Desktop for Chromebook type usecases sounds brilliant!)
Thanks man for all!!! Ok my project run on Raspberry pi5 with ubuntu core and ubuntu frame to render a web page as kiosk, I don’t need a desktop env… ok i will start now to make a simple image , but i have a doubt… to create an image for ubuntu core arm64 based do i have to create it from a pc with the same architecture? Or i can create a arm64 image from my ubuntu desktop on amd64 arch?
Thanks so much!!
From what I’ve read of the source code, building the snaps should work on ARM64 or AMD64.
You won’t be building any snaps anyway, you’re downloading existing ones and modifying one, so I don’t think there’s any need to do this on the Pi itself.
And if your code is open source, you can build it on Canonicals ARM64 servers anyway with https://snapcraft.io/docs/remote-build
Now ive just created my first ubuntu core image, signed, with ubuntu-frame added… So, the next step is to add a snap-gadget with modified splash screen? I don’t understand how I have to add this snap to my model file…
i think with …
Snaps can be optionally added at build time with the ‘–snap’ argument.
first I should create the snap of the gadget with the custom splash screen and once I have the .snap file it should be loaded when creating the image of uc
Use snap download
on the gadget snap in your model, this will download it from the store and place it in your working directory. I’m hoping this will be the ARM64 version but I wouldn’t be surprised if you had to pass a parameter to make X86_64 download ARM64, whereas on the pi itself, you might not have an issue.
Then, run unsquashfs gadet.snap
to produce a folder called squashfs-root
, if you go into this folder, you’ll see its the same folder as what becomes /snap/gadget/current
(sorry for the lack of names, I’m a bit rushed to get the proper rpi-gadget snap name).
Edit this folder in place, putting your bootup image where you need it, and then back in the top level directory (containing squashfs-root
), run snap pack squashfs-root
.
This will provide you a new .snap file, which can then be passed into the image tool and sideloads your own snap. (Unfortunately publishing it to the store to get it signed properly would require a commercial agreement).
With the modifications, hopefully then your next image will boot up with the logo you’re expecting.
Unfortunately I can’t quite remember the exact commands to pass, but generally I think you’re right with the --snap
parameters.
Just keep in mind, because your gadget snap is unsigned, you’ll need to change the security in your model to be grade: dangerous
And clone this repo instead?
Is this the official gadget snap?
That’s the source for it yes, you could build it locally by just running snapcraft
in the build dir, if you don’t use snapcraft that often and don’t want to set up LXD or Multipass for example, you can try with snapcraft remote-build --build-for=arm64
, it’ll ask you to authenticate with Launchpad, otherwise it’s just a case of waiting and you’ll be sent a snap file back when one of the servers gets round to it.
However, you’d be building the same file as what’s already on the store, which is why snap download pi --channel=24/stable
would be quicker.
Often you’d have to rebuild things to make changes, but from what I’d seen on the instructions on the customised boot page, it’s just adding an image file to the right place; so I’d presume you can just do it with an extract and rebuild of the existing snap approach which is worth knowing generally.
But if you were to build it with snapcraft, you’d clone the repo, track the “24” branch, and then run snapcraft
– you might need to install LXD first, with sudo snap install lxd
and sudo lxd init --auto
, but do be careful doing this if you have Docker installed as the two compete on network interfaces and you might need to do a manual workaround to get them to play together.
Edit: Be careful that the default branch in the repo contains instructions for branding that don’t apply to Core24, which follows the rules at Change the splash screen | Ubuntu
It seems to me the unsquashfs
way really is easiest, if it’s as simple as creating splash/vendor-logo.png
Ooook Thanks so much!! I ll try this tomorrow!! I appreciate it very much!
It looks a little different to what I expected but the Pi is a weird device.
Try
mkdir squashfs-root/splash
cp myimage.png squashfs-root/splash/vendor-logo.png
snap pack squashfs-root
This is my model, since i have patched pi gadget with my vendor-log i should delete pi-gadget object from array??
{
"type": "model",
"series": "16",
"model": "ubuntu-core-24-pi-arm64",
"architecture": "arm64",
"authority-id": "**",
"brand-id": "**",
"timestamp": "2024-10-30T13:02:11+00:00",
"base": "core24",
"grade": "dangerous",
"snaps": [
{
"name": "pi",
"type": "gadget",
"default-channel": "24/stable",
"id": "YbGa9O3dAXl88YLI6Y1bGG74pwBxZyKg"
},
{
"name": "pi-kernel",
"type": "kernel",
"default-channel": "24/stable",
"id": "jeIuP6tfFrvAdic8DMWqHmoaoukAPNbJ"
},
{
"name": "core24",
"type": "base",
"default-channel": "latest/stable",
"id": "dwTAh7MZZ01zyriOZErqd1JynQLiOGvM"
},
{
"name": "snapd",
"type": "snapd",
"default-channel": "latest/stable",
"id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4"
},
{
"name": "console-conf",
"type": "app",
"default-channel": "24/stable",
"id": "ASctKBEHzVt3f1pbZLoekCvcigRjtuqw",
"presence": "optional"
},
{
"name": "ubuntu-frame",
"type": "app",
"default-channel": "22/stable",
"id": "BPZbvWzvoMTrpec4goCXlckLe2IhfthK",
"presence": "optional"
}
]
}
I think you’ll need to modify the model, but I’m unsure how.
I’m expecting it’s a case of removing the default-channel
and id
values, which won’t match your snap since it’s modified. But I’d try keeping the name and type for the gadget snap defined, and then building with --snap mygadget.snap
.
you cannot remove the entire object or id and default channel, will not pass model assertion…
it could be the solution, I’m studying it now
I try your solution, removed “id” and “default-channel” and added pi snap to image comm ad… then late will write image on microsd card…
I’m assuming that means its accepted your modified gadget - though if it hasn’t I’d imagine someone else will be able to fill in this last step since it’s probably grabbed from the store if not. I’m not sure here, but you could try removing the gadget from the model entirely put still pass it with --snap
assuming it hasn’t worked.
This should be the point where all your work comes together and you actually get a usable boot splash, so, here’s hoping. And I’d like to say nice job on getting to this point, a lot of people would have just given up but hopefully it’s shown you some fun tooling to toy with. It’s been a while since I’ve had a reason to try Ubuntu Core but if the Desktop edition ends up using the same process (I believe the classic release is intending to move over to a similar workflow too?), I can easily imagine myself making Custom Core images for friends and family who need a “it just works” image with some extra’s on top.
In the meantime he compiled it out … now, i don’t know how to test an image without actually uploading it to the raspberry, i should try with qemu… This project is a work project, so I have to make it work… I think it wasn’t possible to completely remove the gadget, we’ll talk about it again as soon as I upload the image to the raspberry and we’ll see if it will boot