blob: 0014e8659376d3ccc25686f24fed68ef8496bb3a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
--- util-linux/switch_root.c.orig 2007-06-15 11:38:00.000000000 +0200
+++ util-linux/switch_root.c 2007-06-15 11:35:41.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("/");
|