Commit 43b16820 authored by Al Viro's avatar Al Viro

make sure that /linuxrc has std{in,out,err}

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b2ddedcd
...@@ -36,6 +36,10 @@ __setup("noinitrd", no_initrd); ...@@ -36,6 +36,10 @@ __setup("noinitrd", no_initrd);
static int init_linuxrc(struct subprocess_info *info, struct cred *new) static int init_linuxrc(struct subprocess_info *info, struct cred *new)
{ {
sys_unshare(CLONE_FS | CLONE_FILES); 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 */ /* move initrd over / and chdir/chroot in initrd root */
sys_chdir("/root"); sys_chdir("/root");
sys_mount(".", "/", NULL, MS_MOVE, NULL); sys_mount(".", "/", NULL, MS_MOVE, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment