[ostree] switchroot: remount rootfs read/write



commit feca75a9306a3bf90e4acfa2e51b8cce70e426f9
Author: Colin Walters <walters verbum org>
Date:   Wed Feb 8 22:23:25 2012 -0500

    switchroot: remount rootfs read/write
    
    See rationale in comment.

 src/switchroot/ostree-switch-root.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/switchroot/ostree-switch-root.c b/src/switchroot/ostree-switch-root.c
index 151b50f..54c0495 100644
--- a/src/switchroot/ostree-switch-root.c
+++ b/src/switchroot/ostree-switch-root.c
@@ -181,6 +181,16 @@ main(int argc, char *argv[])
   ostree_subinit = argv[3];
   before_init_argc++;
 
+  /* For now, we just remount the root filesystem read/write.  This is
+   * kind of ugly, but to do this properly we'd basically have to have
+   * to be fully integrated into the init process.
+   */
+  if (mount (NULL, root_mountpoint, NULL, MS_MGC_VAL|MS_REMOUNT, NULL) < 0)
+    {
+      perrorv ("Failed to remount %s read/write", root_mountpoint);
+      exit (1);
+    }
+
   snprintf (destpath, sizeof(destpath), "%s/ostree/%s",
 	    root_mountpoint, ostree_target);
   if (stat (destpath, &stbuf) < 0)



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