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
36static int init_linuxrc(struct subprocess_info *info, struct cred *new)36static int init_linuxrc(struct subprocess_info *info, struct cred *new)
37{37{
38 sys_unshare(CLONE_FS | CLONE_FILES);38 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);
39 /* move initrd over / and chdir/chroot in initrd root */43 /* move initrd over / and chdir/chroot in initrd root */
40 sys_chdir("/root");44 sys_chdir("/root");
41 sys_mount(".", "/", NULL, MS_MOVE, NULL);45 sys_mount(".", "/", NULL, MS_MOVE, NULL);