1 diff -urN linux-2.6.26.orig/arch/x86/kernel/vmlinux_32.lds.S linux-2.6.26/arch/x86/kernel/vmlinux_32.lds.S
2 --- linux-2.6.26.orig/arch/x86/kernel/vmlinux_32.lds.S 2008-08-13 03:51:12.000000000 +0200
3 +++ linux-2.6.26/arch/x86/kernel/vmlinux_32.lds.S 2008-08-13 04:08:18.000000000 +0200
8 + .root_initcall.init : AT(ADDR(.root_initcall.init) - LOAD_OFFSET) {
9 + __root_initcall_start = .;
11 + __root_initcall_end = .;
14 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
15 __con_initcall_start = .;
17 diff -urN linux-2.6.26.orig/drivers/mtd/devices/block2mtd.c linux-2.6.26/drivers/mtd/devices/block2mtd.c
18 --- linux-2.6.26.orig/drivers/mtd/devices/block2mtd.c 2008-08-13 03:51:05.000000000 +0200
19 +++ linux-2.6.26/drivers/mtd/devices/block2mtd.c 2008-08-13 04:06:43.000000000 +0200
21 #include <linux/buffer_head.h>
22 #include <linux/mutex.h>
23 #include <linux/mount.h>
24 +#include <linux/list.h>
25 +#include <linux/delay.h>
27 #define VERSION "$Revision: 1.30 $"
30 #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)
31 #define INFO(fmt, args...) printk(KERN_INFO "block2mtd: " fmt "\n" , ## args)
34 + struct list_head list;
38 +static LIST_HEAD(retry_list);
40 /* Info for the block device */
41 struct block2mtd_dev {
46 +static int block2mtd_setup2(const char *val);
48 /* Static info about the MTD, used in cleanup_module */
49 static LIST_HEAD(blkmtd_device_list);
51 +static int add_retry(const char *val) {
52 + struct retry *r = kmalloc(sizeof(struct retry), GFP_KERNEL);
54 + INIT_LIST_HEAD(&r->list);
56 + list_add(&r->list, &retry_list);
61 +static int __init process_retries(void) {
62 + struct list_head *p, *tmp;
64 + list_for_each_safe(p, tmp, &retry_list) {
65 + struct retry *r = list_entry(p, struct retry, list);
66 + block2mtd_setup2(r->val);
73 +rootfs_initcall(process_retries);
75 static struct page *page_read(struct address_space *mapping, int index)
78 if (token[2] && (strlen(token[2]) + 1 > 80))
79 parse_err("mtd device name too long");
81 - add_device(name, erase_size, token[2]);
82 + if (add_device(name, erase_size, token[2]) == NULL) {
88 diff -urN linux-2.6.26.orig/include/asm-generic/vmlinux.lds.h linux-2.6.26/include/asm-generic/vmlinux.lds.h
89 --- linux-2.6.26.orig/include/asm-generic/vmlinux.lds.h 2008-08-13 03:51:08.000000000 +0200
90 +++ linux-2.6.26/include/asm-generic/vmlinux.lds.h 2008-08-13 04:09:04.000000000 +0200
95 - *(.initcallrootfs.init) \
101 +#define INITCALLS_ROOT \
102 + *(.initcallrootfs.init)
104 #define PERCPU(align) \
106 __per_cpu_start = .; \
107 diff -urN linux-2.6.26.orig/init/do_mounts.c linux-2.6.26/init/do_mounts.c
108 --- linux-2.6.26.orig/init/do_mounts.c 2008-08-13 03:51:11.000000000 +0200
109 +++ linux-2.6.26/init/do_mounts.c 2008-08-13 04:00:22.000000000 +0200
114 -static unsigned int __initdata root_delay;
115 -static int __init root_delay_setup(char *str)
117 - root_delay = simple_strtoul(str, NULL, 0);
121 __setup("rootflags=", root_data_setup);
122 __setup("rootfstype=", fs_names_setup);
123 -__setup("rootdelay=", root_delay_setup);
125 static void __init get_fs_names(char *page)
132 - printk(KERN_INFO "Waiting %dsec before mounting root device...\n",
134 - ssleep(root_delay);
137 - /* wait for the known devices to complete their probing */
138 - while (driver_probe_done() != 0)
143 if (saved_root_name[0]) {
144 root_device_name = saved_root_name;
145 if (!strncmp(root_device_name, "mtd", 3)) {
146 diff -urN linux-2.6.26.orig/init/main.c linux-2.6.26/init/main.c
147 --- linux-2.6.26.orig/init/main.c 2008-08-13 03:51:11.000000000 +0200
148 +++ linux-2.6.26/init/main.c 2008-08-13 04:06:01.000000000 +0200
150 #ifdef CONFIG_X86_LOCAL_APIC
153 +#include "do_mounts.h"
156 * This is one of the first .c files built. Error out early if we have compiler
157 @@ -737,12 +738,13 @@
160 extern initcall_t __initcall_start[], __initcall_end[];
161 +extern initcall_t __root_initcall_start[], __root_initcall_end[];
163 -static void __init do_initcalls(void)
164 +static void __init do_initcalls(initcall_t *start, initcall_t *end)
168 - for (call = __initcall_start; call < __initcall_end; call++)
169 + for (call = start; call < end; call++)
170 do_one_initcall(*call);
172 /* Make sure there is no pending stuff from the initcall sequence */
174 usermodehelper_init();
178 + do_initcalls(__initcall_start, __initcall_end);
181 static int __initdata nosoftlockup;
183 panic("No init found. Try passing init= option to kernel.");
186 +static unsigned int __initdata root_delay;
187 +static int __init root_delay_setup(char *str)
189 + root_delay = simple_strtoul(str, NULL, 0);
192 +__setup("rootdelay=", root_delay_setup);
193 static int __init kernel_init(void * unused)
198 if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
199 ramdisk_execute_command = NULL;
200 - prepare_namespace();
202 + printk(KERN_INFO "Waiting %desc before mounting root device...\n",
204 + ssleep(root_delay);
206 + while (driver_probe_done() != 0)
209 + do_initcalls(__root_initcall_start, __root_initcall_end);
210 + prepare_namespace();