aboutsummaryrefslogtreecommitdiffstats
path: root/init/do_mounts_initrd.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/do_mounts_initrd.c')
-rw-r--r--init/do_mounts_initrd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 5e4ded51788e..f9acf71b9810 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -36,6 +36,10 @@ __setup("noinitrd", no_initrd);
36static int init_linuxrc(struct subprocess_info *info, struct cred *new) 36static int init_linuxrc(struct subprocess_info *info, struct cred *new)
37{ 37{
38 sys_unshare(CLONE_FS | CLONE_FILES); 38 sys_unshare(CLONE_FS | CLONE_FILES);
39 /* stdin/stdout/stderr for /linuxrc */
40 sys_open("/dev/console", O_RDWR, 0);
41 sys_dup(0);
42 sys_dup(0);
39 /* move initrd over / and chdir/chroot in initrd root */ 43 /* move initrd over / and chdir/chroot in initrd root */
40 sys_chdir("/root"); 44 sys_chdir("/root");
41 sys_mount(".", "/", NULL, MS_MOVE, NULL); 45 sys_mount(".", "/", NULL, MS_MOVE, NULL);