summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2005-01-25 04:43:39 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-25 04:43:39 -0800
commitdc4e2ff6a18de15c56c2a124e71c14f122aaa8ea (patch)
tree07a2b25144112954cef40e555ae3197d44e87133 /init
parentdfd247c1eb872ca224d62209e0285b40aa19e7f2 (diff)
[PATCH] Configurable delay before mounting root device
Adds a boot parameter which can be used to specify a delay (in seconds) before the root device is decoded/discovered/mounted. Example usage for 10 second delay: rootdelay=10 Useful for usb-storage devices which no longer make their partitions immediately available, and for other storage devices which require some "spin-up" time. Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 51bf20ebcf..185794fcd0 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -6,6 +6,7 @@
#include <linux/suspend.h>
#include <linux/root_dev.h>
#include <linux/security.h>
+#include <linux/delay.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_fs_sb.h>
@@ -228,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)
{
@@ -387,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]) {