I know you can build a Debian system with debootstrap. Using debootstrap it should be possible to create a custom image. The main partition could be read only with separate mounts for anything that need to be read write.
Using containers it should be possible to create a filesystem image. I think the tricky part it testing the image and then updating the existing partition. Maybe some custom ostree tool could do the trick. If not there is always rsync and btrfs snapshots.
Hi!
I made my own inmutable distro using buildroot (https://buildroot.org): https://simplek8s.org
This distro is just an AIO kernel image that will bootstrap everything in RAM. You can mount additional devices for data persistence (for example you can mount your storage in
/var
).deleted by creator