diff --git a/[refs] b/[refs] index a1b5a9b7c3a8..ffe08d0dd2ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2329e392accdb1b277927e8d9cbf568ba3f3856d +refs/heads/master: 2bd3a997befc226ab4b504f05c5cbba305f3e0e6 diff --git a/trunk/init/do_mounts_initrd.c b/trunk/init/do_mounts_initrd.c index 614241b5200c..2b108538d0d9 100644 --- a/trunk/init/do_mounts_initrd.c +++ b/trunk/init/do_mounts_initrd.c @@ -30,11 +30,7 @@ static int __init do_linuxrc(void * shell) extern char * envp_init[]; sys_close(old_fd);sys_close(root_fd); - sys_close(0);sys_close(1);sys_close(2); sys_setsid(); - (void) sys_open("/dev/console",O_RDWR,0); - (void) sys_dup(0); - (void) sys_dup(0); return kernel_execve(shell, argv, envp_init); } diff --git a/trunk/init/main.c b/trunk/init/main.c index 4cb47a159f02..106e02d7ffa5 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -806,11 +806,6 @@ static noinline int init_post(void) system_state = SYSTEM_RUNNING; numa_default_policy(); - if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) - printk(KERN_WARNING "Warning: unable to open an initial console.\n"); - - (void) sys_dup(0); - (void) sys_dup(0); current->signal->flags |= SIGNAL_UNKILLABLE; @@ -873,6 +868,12 @@ static int __init kernel_init(void * unused) do_basic_setup(); + /* Open the /dev/console on the rootfs, this should never fail */ + if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) + printk(KERN_WARNING "Warning: unable to open an initial console.\n"); + + (void) sys_dup(0); + (void) sys_dup(0); /* * check if there is an early userspace init. If yes, let it do all * the work