overlayfs-etc compatibility with volatile-bind
Hi Vyacheslav Yurkov,
overlayfs-etc generates a 'preinit' script that unconditionally remounts root to make it writable. Later systemd-fstab-generator generates a mount unit (-.mount) that restores read-only as set in /etc/fstab.
I added an entry to VOLATILE_BINDS for the /home directory. The volatile-binds recipe creates a systemd mount unit with the condition
ConditionPathIsReadWrite=!/home
The trouble is that there is no dependency between the rootfs mount unit and the /home unit. When the /home unit runs first, the condition is false, and the unit fails. If I later start the /home unit manually, it succeeds, because rootfs is read-only now.
What is the purpose of mounting root rw in 'preinit'?
Is there any other alternative to make volatile-binds do the right thing?
Thanks,
baruch
Signature · 3 lines
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -Hi Baruch
Quoted 1 line
What is the purpose of mounting root rw in 'preinit'?
I guess that was a default, which was not tested with other options combined.
Do you use read-only-rootfs image feature? I think the script can be adapted to take that into account.
Thanks,
Slava
Quoted 32 lines · On Wed, Feb 7, 2024, 10:30 Baruch Siach <[email protected]> wrote:
Hi Vyacheslav Yurkov,
overlayfs-etc generates a 'preinit' script that unconditionally remounts root to make it writable. Later systemd-fstab-generator generates a mount unit (-.mount) that restores read-only as set in
/etc/fstab.I added an entry to
VOLATILE_BINDSfor the /home directory. The volatile-binds
recipe creates a systemd mount unit with the conditionConditionPathIsReadWrite=!/home
The trouble is that there is no dependency between the rootfs mount unit and
the /home unit. When the /home unit runs first, the condition is false, and the unit fails. If I later start the /home unit manually, it succeeds, because
rootfs is read-only now.What is the purpose of mounting root rw in 'preinit'?
Is there any other alternative to make volatile-binds do the right thing?
Thanks,
baruch--
~. .~ Tk OpenSystems =}------------------------------------------------ooO--U--Ooo------------{=
- [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -