summaryrefslogtreecommitdiffstats
path: root/tools/busybox-patches/unionfs-run-init.diff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/busybox-patches/unionfs-run-init.diff')
-rw-r--r--tools/busybox-patches/unionfs-run-init.diff20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/busybox-patches/unionfs-run-init.diff b/tools/busybox-patches/unionfs-run-init.diff
new file mode 100644
index 00000000..2163fa98
--- /dev/null
+++ b/tools/busybox-patches/unionfs-run-init.diff
@@ -0,0 +1,20 @@
+If we find the special directory, /rorootfs move the mount point of the later
+root fs on top. We check if we have unionfs available to make the ro fs rw.
+Unfortunately the unionfs code is incomplete (mmap issue). Thus the original
+mount point of the ro fs part is not moved accordingly.
+
+Index: busybox-1.2.2/util-linux/switch_root.c
+===================================================================
+--- busybox-1.2.2.orig/util-linux/switch_root.c
++++ busybox-1.2.2/util-linux/switch_root.c
+@@ -106,6 +106,10 @@ int switch_root_main(int argc, char *arg
+ // Overmount / with newdir and chroot into it. The chdir is needed to
+ // recalculate "." and ".." links.
+
++ if ( !lstat("/rorootfs", &st1 ) )
++ if ( mount("/rorootfs", "/", NULL, MS_MOVE, NULL) )
++ bb_error_msg_and_die("moving rorootfs");
++
+ if (mount(".", "/", NULL, MS_MOVE, NULL) || chroot(".") || chdir("/"))
+ bb_error_msg_and_die("moving root");
+