I’m trying to build a custom image, and want to include some custom stuff in the gadget. I’m trying to test whether I can even build the custom gadget and create the image with it before I try modifying it, but I’m running into trouble. Here’s what I’ve done so far:
Build the universal pi-gadget without modifying it, just by running snapcraft in the directory.
Edit my model.json to call the pi gadget without an id (so that it won’t pull from the snap store).
Build the custom UC20 image with ubuntu-image, and using --extra-snaps locally-built-pi-gadget.snap
Write the image to the SD card using Raspberry Pi Imager.
When I try to boot the Pi from the SD card, I just get a completely blank screen, no rainbow screen, no other output. I’ve tried both HDMI ports on the Pi just to make sure.
What’s interesting, is if I use the pi gadget (20/stable) from the snap store, instead of the one built locally, the Pi boots the custom image just fine.
I was under the impression that the pi gadget in the snap store is built using the code from the github repo, but maybe I’m wrong on that?
I tried the target arch params from the readme:
sudo snapcraft snap --target-arch=arm64 --destructive-mode --enable-experimental-target-arch
But it fails to build, it looks like there are some 404s when it’s trying to grab the main arm64 package (it seems to try three times): Err:35 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages 404 Not Found [IP: 91.189.91.38 80]
And then it finally fails with:
make: *** [Makefile:79: multiverse] Error 100
make: Leaving directory '/home/keith/git/pi-gadget/parts/gadget/src'
Failed to run 'override-build': Exit code was 2.
I will try installing Ubuntu 20.04 directly on the Pi and then see if I can get it to build there. Thanks for your help so far!
if you happen to have an UC20 image around already (from former testing or whatnot), note that you can also easily build snaps on UbuntuCore using an lxd container: