Sideload snaps during a custom Ubuntu Core image build

Is there a way to sideload snaps (i.e. snaps that have not been published in the snap store) when building a custom Ubuntu Core image?

Further reading, for anyone else interested in this:

Official docs for building a custom Ubuntu Core image: https://core.docs.ubuntu.com/en/guides/build-device/image-building

Great blog from @ogra with more detail on building an ‘appliance’ image: https://ograblog.wordpress.com/2019/01/07/291/

the --extra-snaps option mentioned in your first link has been replaced with the --snap option, this should allow you to sideload local snaps at image build time … (see ubuntu-image snap --help) … note that for UC20 your model assertion needs to be marked “dangerous” to actually allow this …

Ah, perfect - missed that the first time around! Thanks

Is there any way to set up default/automatic snap connections when sideloading snaps into a custom image in this way? (for example using a forked pi3 gadget snap, as referenced in your blog, which seems to require the “snap ID” to set up connections)

no, the gadget connections require a snap ID, there is no way around this currently … you need to have the gadget uploaded to your brand store to have this work …