summaryrefslogtreecommitdiffstats
path: root/tools/busybox-patches/unionfs-run-init.diff
blob: 14df85b8bd835e971b6b4985eb154b1ec0d9d860 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff -ru ../busybox-1.6.0.orig/util-linux/switch_root.c ./util-linux/switch_root.c
--- ../busybox-1.6.0.orig/util-linux/switch_root.c	2007-06-01 13:48:41.000000000 +0200
+++ ./util-linux/switch_root.c	2007-06-15 12:31:40.000000000 +0200
@@ -105,6 +105,10 @@
 	// 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("."))
 		bb_error_msg_and_die("error moving root");
 	xchdir("/");