How to install a Snap package in Image #mickledore #snapd
Hello,
I have a snap package provided by a vendor that I would like to include in my Debian Bookworm 12 image (built with Yocto). How do I create a recipe that can run Snapd to install a pre-built snap package? Are there any examples of how to deploy a pre-built snap package during the image build process? I want to avoid having to manually run snap on the package after the image is deployed.
DART-MX8M-PLUS - Debian Bookworm 12.5 based on Yocto Mickledore 4.2 with NXP BSP L6.1.36_2.1.0
Thanks!
David
Hi David,
Quoted 3 lines · David
Hello,
I have a snap package provided by a vendor that I would like to include in my Debian Bookworm 12 image (built with Yocto). How do I create a recipe that can run Snapd to install a pre-built snap package? Are there any examples of how to deploy a pre-built snap package during the image build process? I want to avoid having to manually run snap on the package after the image is deployed. DART-MX8M-PLUS - Debian Bookworm 12.5 based on Yocto Mickledore 4.2 with NXP BSP L6.1.36_2.1.0
For my understanding, have you tried manually first to prove that it could work? I guess you already built snapd using meta-snapd or meta-snappy (https://layers.openembedded.org/layerindex/branch/master/recipes/?q=snapd)
By the way, trying to install Debian packages won't work, or at least the installed binaries are not expected to work because they were built against different libraries. However, this might work with a snap container if all the library prerequisites are indeed included, in particular the standard C library.
Cheers
Michael.
Signature · 3 lines
Michael Opdenacker Root Commit https://rootcommit.com
Michael,
Thanks for your reply! Yes, I have deployed the snap on my target machine manually after having installed snapd. Now I am looking for a way to run snap packages during the image build, as well as deploy rpm and/or deb packages. I've deployed these packages manually on the target machine. My problem is that I don't know how to write recipes for automating these tasks at build time.
David
Hi David
Quoted 2 lines · David
Michael,
Thanks for your reply! Yes, I have deployed the snap on my target machine manually after having installed snapd.
But did you check that the snap worked as expected?
Quoted 1 line
Now I am looking for a way to run snap packages during the image build, as well as deploy rpm and/or deb packages.
Do you mean deploying rpm and deb packages from other distros like Fedora and Debian? Those are extremely likely to break, as the binaries were built against different C libraries. RPM and DEB are package formats, they don't provide binary compatibility.
Quoted 1 line
I've deployed these packages manually on the target machine. My problem is that I don't know how to write recipes for automating these tasks at build time.
I guess you should write a class which the recipes would inherit. You may ask the meta-snapd or meta-snappy people for advice. Cheers
Michael.
Signature · 3 lines
Michael Opdenacker Root Commit https://rootcommit.com