From: Al Viro Date: Sat, 19 Jan 2013 18:29:54 +0000 (-0500) Subject: make sure that /linuxrc has std{in,out,err} X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=43b16820249396aea7eb57c747106e211e54bed5;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git make sure that /linuxrc has std{in,out,err} Signed-off-by: Al Viro --- 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);