Blame SOURCES/0001-ostree-prepare-root-Fix-etc-bind-mount.patch

471ed8
From b3c7b059eaee3123d5b2523065726e866c533fe9 Mon Sep 17 00:00:00 2001
471ed8
From: Jonathan Lebon <jonathan@jlebon.com>
471ed8
Date: Fri, 28 Aug 2020 12:35:28 -0400
471ed8
Subject: [PATCH] ostree-prepare-root: Fix /etc bind mount
471ed8
471ed8
We were bind-mounting the initramfs' `/etc` (to itself) instead of the
471ed8
target deployment `/etc` (to itself). Since we're already `chdir`'ed
471ed8
into it, we can just drop the leading slash.
471ed8
---
471ed8
 src/switchroot/ostree-prepare-root.c | 2 +-
471ed8
 1 file changed, 1 insertion(+), 1 deletion(-)
471ed8
471ed8
diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c
471ed8
index f7e4fe47..6351babb 100644
471ed8
--- a/src/switchroot/ostree-prepare-root.c
471ed8
+++ b/src/switchroot/ostree-prepare-root.c
471ed8
@@ -251,7 +251,7 @@ main(int argc, char *argv[])
471ed8
        * sysroot, we still need a writable /etc.  And to avoid race conditions
471ed8
        * we ensure it's writable in the initramfs, before we switchroot at all.
471ed8
        */
471ed8
-      if (mount ("/etc", "/etc", NULL, MS_BIND, NULL) < 0)
471ed8
+      if (mount ("etc", "etc", NULL, MS_BIND, NULL) < 0)
471ed8
         err (EXIT_FAILURE, "failed to make /etc a bind mount");
471ed8
       /* Pass on the fact that we discovered a readonly sysroot to ostree-remount.service */
471ed8
       int fd = open (_OSTREE_SYSROOT_READONLY_STAMP, O_WRONLY | O_CREAT | O_CLOEXEC, 0644);
471ed8
-- 
471ed8
2.26.2
471ed8