Read only compressed rootfs in raw flash?

Great, I will proceed with this approach then! There does seem to be a slight lack of references for using Mender with raw flash (the documentation is a good starting point but there’s seemingly a large amount of manual integration still needed after what’s prescribed there) and I would think that using squashfs/flash would be a fairly common use case for embedded devices so, if there’s interest and I get something working, I might contribute my findings back to the community with a blog post. Will update here if I do so. :slight_smile:

I did get a fitImage with kernel, dtb and squashfs (xz compressed) booting on my hardware today, although I manually hacked it all together. Will have to look into getting it built with yocto, so thanks for your comments on that! The only other downside I didn’t mention before is that the squashfs filesystem is copied to a RAM disk on boot (as you mention above), rather than being read from flash as it would in your initial approach. I’m lucky in that I have an abundance of RAM (512MB) and a fairly small compressed rootfs (~30MB) so I think it is ok for me, but worth noting.

Because of the copy to RAM disk, I also needed to increase the ramdisk_size that the kernel used. I’m still trying to find if there’s any downside (apart from using up a chunk of memory) but, so far, it seems ok.

On the brightside, it is a bit of a simplification that Mender doesn’t need to modify bootargs in uboot in order to boot, because the bootargs of root=/dev/ram0 work regardless of which ubi volume it boots from.