X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=init%2Fdo_mounts.c;h=185794fcd01ced4548be0c2280f536fe84f8a913;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=7f87ff74d11f629331e644077d01f1d9e95907cf;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/init/do_mounts.c b/init/do_mounts.c index 7f87ff74d..185794fcd 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -142,7 +143,7 @@ dev_t __init name_to_dev_t(char *name) int part; #ifdef CONFIG_SYSFS - sys_mkdir("/sys", 0700); + int mkdir_err = sys_mkdir("/sys", 0700); if (sys_mount("sysfs", "/sys", "sysfs", 0, NULL) < 0) goto out; #endif @@ -197,7 +198,8 @@ done: #ifdef CONFIG_SYSFS sys_umount("/sys", 0); out: - sys_rmdir("/sys"); + if (!mkdir_err) + sys_rmdir("/sys"); #endif return res; fail: @@ -227,8 +229,16 @@ static int __init fs_names_setup(char *str) return 1; } +static unsigned int __initdata root_delay; +static int __init root_delay_setup(char *str) +{ + root_delay = simple_strtoul(str, NULL, 0); + return 1; +} + __setup("rootflags=", root_data_setup); __setup("rootfstype=", fs_names_setup); +__setup("rootdelay=", root_delay_setup); static void __init get_fs_names(char *page) { @@ -386,6 +396,12 @@ void __init prepare_namespace(void) mount_devfs(); + if (root_delay) { + printk(KERN_INFO "Waiting %dsec before mounting root device...\n", + root_delay); + ssleep(root_delay); + } + md_run_setup(); if (saved_root_name[0]) {