summaryrefslogtreecommitdiff
path: root/src/switchroot
diff options
context:
space:
mode:
authorJonathan Lebon <jonathan@jlebon.com>2020-08-28 12:35:28 -0400
committerJonathan Lebon <jonathan@jlebon.com>2020-08-28 14:16:29 -0400
commitb3c7b059eaee3123d5b2523065726e866c533fe9 (patch)
tree978c9b5e9171ab1d941d7c84faa0301820c808ab /src/switchroot
parent22b3883aa477237d619269c6b8995df6e2a82e67 (diff)
downloadostree-b3c7b059eaee3123d5b2523065726e866c533fe9.tar.gz
ostree-prepare-root: Fix /etc bind mount
We were bind-mounting the initramfs' `/etc` (to itself) instead of the target deployment `/etc` (to itself). Since we're already `chdir`'ed into it, we can just drop the leading slash.
Diffstat (limited to 'src/switchroot')
-rw-r--r--src/switchroot/ostree-prepare-root.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c
index f7e4fe47..6351babb 100644
--- a/src/switchroot/ostree-prepare-root.c
+++ b/src/switchroot/ostree-prepare-root.c
@@ -251,7 +251,7 @@ main(int argc, char *argv[])
* sysroot, we still need a writable /etc. And to avoid race conditions
* we ensure it's writable in the initramfs, before we switchroot at all.
*/
- if (mount ("/etc", "/etc", NULL, MS_BIND, NULL) < 0)
+ if (mount ("etc", "etc", NULL, MS_BIND, NULL) < 0)
err (EXIT_FAILURE, "failed to make /etc a bind mount");
/* Pass on the fact that we discovered a readonly sysroot to ostree-remount.service */
int fd = open (_OSTREE_SYSROOT_READONLY_STAMP, O_WRONLY | O_CREAT | O_CLOEXEC, 0644);