Skip to content

Commit 43b1682

Browse files
author
Al Viro
committed
make sure that /linuxrc has std{in,out,err}
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b2ddedc commit 43b1682

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎init/do_mounts_initrd.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ __setup("noinitrd", no_initrd);
3636
static int init_linuxrc(struct subprocess_info *info, struct cred *new)
3737
{
3838
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);
3943
/* move initrd over / and chdir/chroot in initrd root */
4044
sys_chdir("/root");
4145
sys_mount(".", "/", NULL, MS_MOVE, NULL);

0 commit comments

Comments
 (0)