Retry up to 20 times if mounting the root device fails. This fixes booting from usb-storage devices, which no longer make their partitions immediately available. From: William Park Signed-off-by: Daniel Drake --- linux-2.6.10/init/do_mounts.c 2005-01-05 01:11:25.118879648 +0000 +++ linux-dsd/init/do_mounts.c 2005-01-05 01:04:19.001659312 +0000 @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -278,9 +279,14 @@ char *fs_names = __getname(); char *p; char b[BDEVNAME_SIZE]; + int tryagain = 20; get_fs_names(fs_names); retry: + if (!ROOT_DEV) { + ROOT_DEV = name_to_dev_t(saved_root_name); + create_dev(name, ROOT_DEV, root_device_name); + } for (p = fs_names; *p; p += strlen(p)+1) { int err = do_mount_root(name, p, flags, root_mount_data); switch (err) { @@ -297,9 +303,13 @@ * and bad superblock on root device. */ __bdevname(ROOT_DEV, b); - printk("VFS: Cannot open root device \"%s\" or %s\n", - root_device_name, b); - printk("Please append a correct \"root=\" boot option\n"); + if (--tryagain) { + printk (KERN_WARNING "VFS: Waiting %dsec for root device...\n", tryagain); + ssleep (1); + goto retry; + } + printk (KERN_CRIT "VFS: Cannot open root device \"%s\" or %s\n", root_device_name, b); + printk (KERN_CRIT "Please append a correct \"root=\" boot option\n"); panic("VFS: Unable to mount root fs on %s", b); }