ostree-remount: Remount /etc rw if needed
authorJonathan Lebon <jonathan@jlebon.com>
Fri, 28 Aug 2020 16:35:29 +0000 (12:35 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Fri, 28 Aug 2020 18:16:46 +0000 (14:16 -0400)
commita7a751b69f2315635d6ae38a0b1344287b67079a
treebd02b1c7ef1efdc09876ce61f0de4c43b10683ce
parentb3c7b059eaee3123d5b2523065726e866c533fe9
ostree-remount: Remount /etc rw if needed

When we remount `/sysroot` as read-only, we also make `/etc` read-only.
This is usually OK because we then remount `/var` read-write, which also
flips `/etc` back to read-write... unless `/var` is a separate
filesystem and not a bind-mount to the stateroot `/var`.

Fix this by just remounting `/etc` read-write in the read-only sysroot
case.

Eventually, I think we should rework this to set everything up the way
we want from the initramfs (#2115). This would also eliminate the window
during which `/etc` is read-only while `ostree-remount` runs.
src/switchroot/ostree-remount.c