<p dir="ltr">Hi Visali,</p>
<p dir="ltr">Am 25.02.2016 20:47 schrieb "Vasiliy Tolstov" <<a href="mailto:v.tolstov@selfip.ru">v.tolstov@selfip.ru</a>>:<br>
><br>
> Hi,i want to build image that mounts readonly /usr and / readwrite.</p>
<p dir="ltr">That is really simple to do:</p>
<p dir="ltr">Just edit the kernel command line to include the appropriate flags to mount usr read-only. Documentation for the flags can be found here: <br>
<a href="https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html">https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html</a></p>
<p dir="ltr">> I have dracut , systemd and efi system.<br>
> Does somebody have examples of systemd units ?</p>
<p dir="ltr">None should be needed for such a simple setup.</p>
<p dir="ltr">> Also how /etc filled with systemd?</p>
<p dir="ltr">That should not be necessary, if / is persistent. If you want / to be a tmpfs, then it gets a bit tricky.</p>
<p dir="ltr">I currently added a unit into the initrd that extracts a tarball with the root filesystem found on the read-only usr partition. The unit doing that can be found here: <br>
<a href="https://gitlab.com/hunger/cleanroom/blob/master/type-baremetal/units/initrd-sysroot-setup.service">https://gitlab.com/hunger/cleanroom/blob/master/type-baremetal/units/initrd-sysroot-setup.service</a></p>
<p dir="ltr">That *should* not be necessary starting with systemd 229 (for the machine-id switch on the kernel commandline) and dbus 1.10 (for starting without files in /etc) anymore, but I did not verify that yet.</p>
<p dir="ltr">If there is no /etc/machine-id found on the disk, systemd should populate /etc based on the contents of /usr/share/factory.</p>
<p dir="ltr">Best Regards,<br>
Tobias</p>