dect
/
linux-2.6
Archived
13
0
Fork 0

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

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2013-01-19 13:29:54 -05:00
parent b2ddedcd21
commit 43b1682024
1 changed files with 4 additions and 0 deletions

View File

@ -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);