aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-14 15:28:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-14 15:28:02 -0400
commit2d51b75370d83535883c66521b03fcd6a1f1f68d (patch)
tree68e7bb018a80207781719795828434dfcf3b9bf6 /init
parent93f78da405685a756beeaeae4b5e41fcec39eab3 (diff)
parentce52aebd0219edc7a783278fbe80a6ccca0556c0 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-fastboot
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-fastboot: raid, fastboot: hide RAID autodetect option if MD is compiled as a module raid: make RAID autodetect default a KConfig option warning: fix init do_mounts_md c fastboot: make the RAID autostart code print a message just before waiting fastboot: make the raid autodetect code wait for all devices to init fastboot: Fix bootgraph.pl initcall name regexp fastboot: fix issues and improve output of bootgraph.pl Add a script to visualize the kernel boot process / time
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts_md.c40
-rw-r--r--init/main.c2
2 files changed, 32 insertions, 10 deletions
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 693d24694a6c..48b3fadd83ed 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -12,7 +12,12 @@
12 * The code for that is here. 12 * The code for that is here.
13 */ 13 */
14 14
15static int __initdata raid_noautodetect, raid_autopart; 15#ifdef CONFIG_MD_AUTODETECT
16static int __initdata raid_noautodetect;
17#else
18static int __initdata raid_noautodetect=1;
19#endif
20static int __initdata raid_autopart;
16 21
17static struct { 22static struct {
18 int minor; 23 int minor;
@@ -252,6 +257,8 @@ static int __init raid_setup(char *str)
252 257
253 if (!strncmp(str, "noautodetect", wlen)) 258 if (!strncmp(str, "noautodetect", wlen))
254 raid_noautodetect = 1; 259 raid_noautodetect = 1;
260 if (!strncmp(str, "autodetect", wlen))
261 raid_noautodetect = 0;
255 if (strncmp(str, "partitionable", wlen)==0) 262 if (strncmp(str, "partitionable", wlen)==0)
256 raid_autopart = 1; 263 raid_autopart = 1;
257 if (strncmp(str, "part", wlen)==0) 264 if (strncmp(str, "part", wlen)==0)
@@ -264,17 +271,32 @@ static int __init raid_setup(char *str)
264__setup("raid=", raid_setup); 271__setup("raid=", raid_setup);
265__setup("md=", md_setup); 272__setup("md=", md_setup);
266 273
274static void autodetect_raid(void)
275{
276 int fd;
277
278 /*
279 * Since we don't want to detect and use half a raid array, we need to
280 * wait for the known devices to complete their probing
281 */
282 printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
283 printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
284 while (driver_probe_done() < 0)
285 msleep(100);
286 fd = sys_open("/dev/md0", 0, 0);
287 if (fd >= 0) {
288 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
289 sys_close(fd);
290 }
291}
292
267void __init md_run_setup(void) 293void __init md_run_setup(void)
268{ 294{
269 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0)); 295 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
296
270 if (raid_noautodetect) 297 if (raid_noautodetect)
271 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n"); 298 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=autodetect will force)\n");
272 else { 299 else
273 int fd = sys_open("/dev/md0", 0, 0); 300 autodetect_raid();
274 if (fd >= 0) {
275 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
276 sys_close(fd);
277 }
278 }
279 md_setup_drive(); 301 md_setup_drive();
280} 302}
diff --git a/init/main.c b/init/main.c
index 3820323c4c84..27f6bf6108e9 100644
--- a/init/main.c
+++ b/init/main.c
@@ -708,7 +708,7 @@ int do_one_initcall(initcall_t fn)
708 int result; 708 int result;
709 709
710 if (initcall_debug) { 710 if (initcall_debug) {
711 printk("calling %pF\n", fn); 711 printk("calling %pF @ %i\n", fn, task_pid_nr(current));
712 t0 = ktime_get(); 712 t0 = ktime_get();
713 } 713 }
714 714