X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=init%2Fdo_mounts.c;h=4efa1e5385e3a1b110b29b46ceccedf36a8c4138;hp=b290aadb1d3f2a0b1448a06df90bb05f75aed42f;hb=5b0bf5e25efe;hpb=3b9f6cb8a1ec791be79c6c7595fea922f12d1e64 diff --git a/init/do_mounts.c b/init/do_mounts.c index b290aadb1d3f..4efa1e5385e3 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -7,8 +7,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -23,6 +25,7 @@ int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */ int root_mountflags = MS_RDONLY | MS_SILENT; char * __initdata root_device_name; static char __initdata saved_root_name[64]; +static int __initdata root_wait; dev_t ROOT_DEV; @@ -214,6 +217,16 @@ static int __init root_dev_setup(char *line) __setup("root=", root_dev_setup); +static int __init rootwait_setup(char *str) +{ + if (*str) + return 0; + root_wait = 1; + return 1; +} + +__setup("rootwait", rootwait_setup); + static char * __initdata root_mount_data; static int __init root_data_setup(char *str) { @@ -285,7 +298,11 @@ void __init mount_block_root(char *name, int flags) { char *fs_names = __getname(); char *p; +#ifdef CONFIG_BLOCK char b[BDEVNAME_SIZE]; +#else + const char *b = name; +#endif get_fs_names(fs_names); retry: @@ -303,20 +320,29 @@ retry: /* * Allow the user to distinguish between failed sys_open * and bad superblock on root device. + * and give them a list of the available devices */ +#ifdef CONFIG_BLOCK __bdevname(ROOT_DEV, b); +#endif printk("VFS: Cannot open root device \"%s\" or %s\n", root_device_name, b); - printk("Please append a correct \"root=\" boot option\n"); + printk("Please append a correct \"root=\" boot option; here are the available partitions:\n"); + printk_all_partitions(); panic("VFS: Unable to mount root fs on %s", b); } + printk("List of all partitions:\n"); + printk_all_partitions(); printk("No filesystem could mount root, tried: "); for (p = fs_names; *p; p += strlen(p)+1) printk(" %s", p); printk("\n"); - panic("VFS: Unable to mount root fs on %s", __bdevname(ROOT_DEV, b)); +#ifdef CONFIG_BLOCK + __bdevname(ROOT_DEV, b); +#endif + panic("VFS: Unable to mount root fs on %s", b); out: putname(fs_names); } @@ -387,8 +413,10 @@ void __init mount_root(void) change_floppy("root floppy"); } #endif +#ifdef CONFIG_BLOCK create_dev("/dev/root", ROOT_DEV); mount_block_root("/dev/root", root_mountflags); +#endif } /* @@ -421,11 +449,20 @@ void __init prepare_namespace(void) root_device_name += 5; } - is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR; - if (initrd_load()) goto out; + /* wait for any asynchronous scanning to complete */ + if ((ROOT_DEV == 0) && root_wait) { + printk(KERN_INFO "Waiting for root device %s...\n", + saved_root_name); + while (driver_probe_done() != 0 || + (ROOT_DEV = name_to_dev_t(saved_root_name)) == 0) + msleep(100); + } + + is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR; + if (is_floppy && rd_doload && rd_load_disk(0)) ROOT_DEV = Root_RAM0;