diff options
author | Colin Walters <walters@verbum.org> | 2020-05-24 15:25:08 +0000 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2020-05-24 18:46:28 +0000 |
commit | 35642259175973617da937f3cab6ce5f13c95077 (patch) | |
tree | c26c11583f0de06bda2206574a10ecad54038d9b /src/switchroot/ostree-mount-util.h | |
parent | 8801e38bba46ed586a74b733ea2e49d06ff8afd7 (diff) | |
download | ostree-35642259175973617da937f3cab6ce5f13c95077.tar.gz |
Move ro /sysroot bind mount of /etc into initramfs
We recently disabled the read-only /sysroot handling:
https://github.com/ostreedev/ostree/pull/2108/commits/e35b82fb891daee823fcce421ae8f1442b630ea2
The core problem was that a lot of services run early in the
real root and want write access to things like `/var` and `/etc`.
In trying to do remounts while the system is running we introduce
too many race conditions.
Instead, just make the `/etc` bind mount in the initramfs right
after we set up the main root. This is much more natural really,
and avoids all race conditions since nothing is running in the
sysroot yet.
The main awkward part is that since we're not linking
`ostree-prepare-root` to GLib (yet) we have a hacky parser
for the config file. But, this is going to be fine I think.
In order to avoid parsing the config twice, pass state from
`ostree-prepare-root` to `ostree-remount` via a file in `/run`.
Diffstat (limited to 'src/switchroot/ostree-mount-util.h')
-rw-r--r-- | src/switchroot/ostree-mount-util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/switchroot/ostree-mount-util.h b/src/switchroot/ostree-mount-util.h index 0b40bb40..fb2d02b4 100644 --- a/src/switchroot/ostree-mount-util.h +++ b/src/switchroot/ostree-mount-util.h @@ -30,11 +30,13 @@ #include <unistd.h> #include <fcntl.h> #include <string.h> +#include <stdbool.h> #define INITRAMFS_MOUNT_VAR "/run/ostree/initramfs-mount-var" +#define _OSTREE_SYSROOT_READONLY_STAMP "/run/ostree-sysroot-ro.stamp" static inline int -path_is_on_readonly_fs (char *path) +path_is_on_readonly_fs (const char *path) { struct statvfs stvfsbuf; |