Skip to content

Commit

Permalink
make sure that /linuxrc has std{in,out,err}
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jan 19, 2013
1 parent b2ddedc commit 43b1682
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions init/do_mounts_initrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 43b1682

Please sign in to comment.