History

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

Al Viro committed 13 years ago

Commit 43b16821 parent b2ddedc1 file · +4 −0Browse files

Unified · Split

init/do_mounts_initrd.c+4−0
@@ -36,6 +36,10 @@ __setup("noinitrd", no_initrd); · 35 unmodified lines
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);