sysroot: Handle ro /boot but rw /sysroot
authorColin Walters <walters@verbum.org>
Sat, 9 Jan 2021 18:34:27 +0000 (18:34 +0000)
committerColin Walters <walters@verbum.org>
Sun, 10 Jan 2021 13:49:44 +0000 (13:49 +0000)
commit9a526bbaa5ad6a75e3b0d8052d93934df3e7a20f
tree790a2e0384c130590c7aaeb09f6d6640c53504be
parenta1c0cffeb38fb218d9b0eac50e319fa1c79584c1
sysroot: Handle ro /boot but rw /sysroot

The recent change in https://github.com/coreos/fedora-coreos-config/pull/659
broke some of our tests that do `mount -o remount,rw /sysroot` but
leave `/boot` read-only.

We had code for having `/boot` read-only before `/sysroot` but
in practice we had a file descriptor for `/sysroot` that we opened
before the remount that would happen later on.

Clean things up here so that in the library, we also remount
`/boot` at the same time we remount `/sysroot` if either are readonly.

Delete the legacy code for remounting `/boot` rw if we're not in
a mount namespace.  I am fairly confident most users are either
using the `ostree` CLI, or they're using the mount namespace.
src/libostree/ostree-sysroot-deploy.c
src/libostree/ostree-sysroot.c
src/libotutil/otutil.h