We are building a Yocto-based image, which comes with snapd preinstalled (fully confined). Now we need to include a few snaps in the rootfs. The easier way would be to just use
snap download <snap_name>, however that won’t be possible because
snapd is not available in our build environment. I am assuming we could get away with using curl/jq by calling a similar endpoint like https://search.apps.ubuntu.com/api/v1/package/firefox, however where do we get the
.assert file ?
This may actually be part of a larger problem i.e. what to do once we have the snap downloaded, how do we install it on first boot (or during image build). Also, we are going to have our rootfs read-only, then how are subsequent updates going to work (bind-mount a rw location to /var/lib/snapd/snaps, but creating a mix of pre-seeded snaps and to-be-downloaded snaps would be a challenge)