Hi gsthnz,
I'm interested in doing something similar to what you described in the
post "Read-only root with overlayfs". However, my Linux boots under
systemd instead of init.
systemd is better than init but also more complicated, so I'm not able
to mount automatically an overlayed version of the root file system.
Could you give me some clue?
Many thanks in advance!
On 3/16/23 05:41, Josemaria Malgosa Sanahuja wrote:
> Hi gsthnz,
>
> I'm interested in doing something similar to what you described in the
> post "Read-only root with overlayfs". However, my Linux boots under
> systemd instead of init.
>
> systemd is better than init but also more complicated, so I'm not able
> to mount automatically an overlayed version of the root file system.
>
> Could you give me some clue?
> Many thanks in advance!
Hello, Josemaria
Are you using buildroot to build you system? Or are you using a general
purpose distro?
You have to create a script that executes before systemd, you probably
should look into how linux loads the init and load this script instead
of the init.
In my case, I created a new "init" shell script which makes the
overlayfs mount and then chroots into the new fs with the actual init
system, in your case you should be able to run systemd instead of init.
I have little experience running systemd by hand, but it shouldn't be
too different.
I'm also not sure if systemd has this as a native feature. I've done
this for a embedded busybox system.
Feel free to mail me on any other questions you have :)
--
Gustavo Heinz