aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-19 13:29:54 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-27 20:48:59 -0800
commitf0de17c0babe7f29381892def6b37e9181a53410 (patch)
tree79f94720ddb88a752cd442c7f8cce0bd7757a35d /init
parent8a69ca20f06d1878aa0ee8000a60d8226ab6b6a1 (diff)
make sure that /linuxrc has std{in,out,err}
commit 43b16820249396aea7eb57c747106e211e54bed5 upstream. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Cc: Barry Davis <Barry-Davis@stormagic.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'init')
-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 5e4ded51788..f9acf71b981 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);