meta-snappy icon indicating copy to clipboard operation
meta-snappy copied to clipboard

Support read-only filesystem

Open om26er opened this issue 4 years ago • 1 comments

It is often desirable to make the rootfs of a Yocto based image read-only. However for snapd to work "correctly" there are certain paths that must be read-write. In our approach we use OverlayFS for a few mount points, so that the newly installed snaps and their systemd units get written to a persistent "data" partition transparently.

Is that approach "correct" does UbuntuCore use a similar technique as well ?

I think meta-snappy should have a recipe to enable that as well.

om26er avatar Jan 27 '21 12:01 om26er

FWIW, we achieved this stuff by editing the /sbin/init symlink to be a full-fledged shell script that in the end does exec /lib/systemd/systemd. The script then creates all the required directories (mkdir) and then mounts both overlays and binds. Most of the paths were inspired by writable-paths file in UbuntuCore.

That approach allowed us to not change initramfs at all. Some environments like RaspberryPi Yocto doesn't use initramfs by default and I believe same is the case of Qemu yocto image.

om26er avatar Feb 08 '21 13:02 om26er