summaryrefslogtreecommitdiff
path: root/init/do_mounts_initrd.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-19 22:29:54 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-01-19 22:29:54 +0400
commit43b16820249396aea7eb57c747106e211e54bed5 (patch)
treea113c730fbd40470f6c2cb40993c154fd0630571 /init/do_mounts_initrd.c
parentb2ddedcd21f44a5873ee3d6ff6118a2318e01e18 (diff)
downloadlinux-43b16820249396aea7eb57c747106e211e54bed5.tar.xz
make sure that /linuxrc has std{in,out,err}
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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);
static int init_linuxrc(struct subprocess_info *info, struct cred *new)
{
sys_unshare(CLONE_FS | CLONE_FILES);
+ /* stdin/stdout/stderr for /linuxrc */
+ sys_open("/dev/console", O_RDWR, 0);
+ sys_dup(0);
+ sys_dup(0);
/* move initrd over / and chdir/chroot in initrd root */
sys_chdir("/root");
sys_mount(".", "/", NULL, MS_MOVE, NULL);