prepare-root: Fix composefs + ostree admin unlock --hotfix compat
authorColin Walters <walters@verbum.org>
Wed, 3 Jan 2024 19:01:38 +0000 (14:01 -0500)
committerColin Walters <walters@verbum.org>
Wed, 3 Jan 2024 19:01:38 +0000 (14:01 -0500)
commita1c1c0b500d23ff129adbfe9486a067788b24969
tree2879393f812f990259211fd821139ea179811f06
parent40b143f494f50e46c736eedf002c20468816281c
prepare-root: Fix composefs + ostree admin unlock --hotfix compat

There's a test case for `ostree admin unlock --hotfix` that
runs in FCOS, not here; it breaks when enabling composefs.

The reason is because the composefs is mounted readonly, and
we tried to remount it writable.  Instead of trying to remount
the rootfs writable at this point forcibly, honor the
*real* sysroot readonly state flag from the underlying FS before
we mounted the composefs.

Note that in FCOS derivatives we always have the root mounted
writable via `rw` on the kernel cmdline and this is the default
general expectation now with ostree usage.
src/switchroot/ostree-prepare-root.c