~gsthnz/public-inbox

1

Read-only root with overlayfs under systemd

Josemaria Malgosa Sanahuja <josem.malgosa@upct.es>
Details
Message ID
<d20622a1-9da9-2838-83dd-bc4a6b18dd31@upct.es>
DKIM signature
missing
Download raw message
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!
Details
Message ID
<1f54b214-1739-5d74-5518-aa8cbc7910e1@gsthnz.com>
In-Reply-To
<d20622a1-9da9-2838-83dd-bc4a6b18dd31@upct.es> (view parent)
DKIM signature
pass
Download raw message
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
Reply to thread Export thread (mbox)