X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=init%2Fdo_mounts_initrd.c;h=614241b5200cf906c066288ac15a42df835490ce;hb=37d4008484977f60d5d37499a2670c79b214dd46;hp=a06f037fa000a932d9de7b6f8dee909e5ce01720;hpb=bdaf8529385d5126ef791e8f1914afff8cd59bcf;p=safe%2Fjmp%2Flinux-2.6 diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index a06f037..614241b 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c @@ -1,4 +1,3 @@ -#define __KERNEL_SYSCALLS__ #include #include #include @@ -7,6 +6,7 @@ #include #include #include +#include #include "do_mounts.h" @@ -35,7 +35,7 @@ static int __init do_linuxrc(void * shell) (void) sys_open("/dev/console",O_RDWR,0); (void) sys_dup(0); (void) sys_dup(0); - return execve(shell, argv, envp_init); + return kernel_execve(shell, argv, envp_init); } static void __init handle_initrd(void) @@ -55,12 +55,18 @@ static void __init handle_initrd(void) sys_mount(".", "/", NULL, MS_MOVE, NULL); sys_chroot("."); - current->flags |= PF_NOFREEZE; + /* + * In case that a resume from disk is carried out by linuxrc or one of + * its children, we need to tell the freezer not to wait for us. + */ + current->flags |= PF_FREEZER_SKIP; + pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD); - if (pid > 0) { + if (pid > 0) while (pid != sys_wait4(-1, NULL, 0, NULL)) yield(); - } + + current->flags &= ~PF_FREEZER_SKIP; /* move initrd to rootfs' /old */ sys_fchdir(old_fd);