+--- a/arch/x86/kernel/vmlinux.lds.S
++++ b/arch/x86/kernel/vmlinux.lds.S
+@@ -244,6 +244,12 @@ SECTIONS
+ __initcall_end = .;
+ }
+
++ .root_initcall.init : AT(ADDR(.root_initcall.init) - LOAD_OFFSET) {
++ __root_initcall_start = .;
++ INITCALLS_ROOT
++ __root_initcall_end = .;
++ }
++
+ .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
+ __con_initcall_start = .;
+ *(.con_initcall.init)
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -18,10 +18,18 @@
static int kernel_init(void *);
-@@ -784,12 +785,13 @@ int do_one_initcall(initcall_t fn)
+@@ -779,12 +780,13 @@ int do_one_initcall(initcall_t fn)
extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
do_one_initcall(*call);
/* Make sure there is no pending stuff from the initcall sequence */
-@@ -873,6 +875,13 @@ static noinline int init_post(void)
+@@ -807,7 +809,7 @@ static void __init do_basic_setup(void)
+ driver_init();
+ init_irq_proc();
+ do_ctors();
+- do_initcalls();
++ do_initcalls(__early_initcall_end, __initcall_end);
+ }
+
+ static void __init do_pre_smp_initcalls(void)
+@@ -868,6 +870,13 @@ static noinline int init_post(void)
panic("No init found. Try passing init= option to kernel.");
}
static int __init kernel_init(void * unused)
{
lock_kernel();
-@@ -917,7 +926,16 @@ static int __init kernel_init(void * unu
+@@ -912,7 +921,16 @@ static int __init kernel_init(void * unu
if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
ramdisk_execute_command = NULL;
+ }
+ while (driver_probe_done() != 0)
+ msleep(100);
-+ md_run_setup();
+ do_initcalls(__root_initcall_start, __root_initcall_end);
++ md_run_setup();
+ prepare_namespace();
}