[gnome-build-meta/valentindavid/pinebook-pro: 25/25] ostree: Do not make root private



commit 262547d3d8dfc50e0f1721a4b5b1b84a97958aa8
Author: Valentin David <valentin david codethink co uk>
Date:   Mon Apr 27 13:20:21 2020 +0000

    ostree: Do not make root private

 files/ostree/ostree-shared-root.patch | 38 +++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
---
diff --git a/files/ostree/ostree-shared-root.patch b/files/ostree/ostree-shared-root.patch
new file mode 100644
index 00000000..a5a19364
--- /dev/null
+++ b/files/ostree/ostree-shared-root.patch
@@ -0,0 +1,38 @@
+diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c
+index c25d3fe9..0e5dca57 100644
+--- a/src/switchroot/ostree-prepare-root.c
++++ b/src/switchroot/ostree-prepare-root.c
+@@ -173,15 +173,6 @@ main(int argc, char *argv[])
+         err (EXIT_FAILURE, "failed to umount proc from /proc");
+     }
+ 
+-  /* Work-around for a kernel bug: for some reason the kernel
+-   * refuses switching root if any file systems are mounted
+-   * MS_SHARED. Hence remount them MS_PRIVATE here as a
+-   * work-around.
+-   *
+-   * https://bugzilla.redhat.com/show_bug.cgi?id=847418 */
+-  if (mount (NULL, "/", NULL, MS_REC|MS_PRIVATE, NULL) < 0)
+-    err (EXIT_FAILURE, "failed to make \"/\" private mount");
+-
+   /* Make deploy_path a bind mount, so we can move it later */
+   if (mount (deploy_path, deploy_path, NULL, MS_BIND, NULL) < 0)
+     err (EXIT_FAILURE, "failed to make initial bind mount %s", deploy_path);
+@@ -300,17 +291,6 @@ main(int argc, char *argv[])
+         err (EXIT_FAILURE, "couldn't remove temporary sysroot /sysroot.tmp");
+     }
+ 
+-  /* The /sysroot mount needs to be private to avoid having a mount for e.g. /var/cache
+-   * also propagate to /sysroot/ostree/deploy/$stateroot/var/cache
+-   *
+-   * Now in reality, today this is overridden by systemd: the *actual* way we fix this up
+-   * is in ostree-remount.c.  But let's do it here to express the semantics we want
+-   * at the very start (perhaps down the line systemd will have compile/runtime option
+-   * to say that the initramfs environment did everything right from the start).
+-   */
+-  if (mount ("none", "sysroot", NULL, MS_PRIVATE, NULL) < 0)
+-    err (EXIT_FAILURE, "remounting 'sysroot' private");
+-
+   if (running_as_pid1)
+     {
+       execl ("/sbin/init", "/sbin/init", NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]