diff options
Diffstat (limited to 'meta/packages/linux/linux-moblin-2.6.27-rc6/0030-fastboot-retry-mounting-the-root-fs-if-we-can-t-fin.patch')
-rw-r--r-- | meta/packages/linux/linux-moblin-2.6.27-rc6/0030-fastboot-retry-mounting-the-root-fs-if-we-can-t-fin.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-moblin-2.6.27-rc6/0030-fastboot-retry-mounting-the-root-fs-if-we-can-t-fin.patch b/meta/packages/linux/linux-moblin-2.6.27-rc6/0030-fastboot-retry-mounting-the-root-fs-if-we-can-t-fin.patch new file mode 100644 index 0000000000..e2c3737935 --- /dev/null +++ b/meta/packages/linux/linux-moblin-2.6.27-rc6/0030-fastboot-retry-mounting-the-root-fs-if-we-can-t-fin.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From db62cd29f9b9142c19c574ca00916f66ff22ed4a Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Sun, 20 Jul 2008 13:01:28 -0700 | ||
4 | Subject: [PATCH] fastboot: retry mounting the root fs if we can't find init | ||
5 | |||
6 | currently we wait until all device init is done before trying to mount | ||
7 | the root fs, and to consequently execute init. | ||
8 | |||
9 | In preparation for relaxing the first delay, this patch adds a retry | ||
10 | attempt in case /sbin/init is not found. Before retrying, the code | ||
11 | will wait for all device init to complete. | ||
12 | |||
13 | While this patch by itself doesn't gain boot time yet (it needs follow on | ||
14 | patches), the alternative already is to panic()... | ||
15 | |||
16 | Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> | ||
17 | --- | ||
18 | init/main.c | 19 +++++++++++++++++++ | ||
19 | 1 files changed, 19 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/init/main.c b/init/main.c | ||
22 | index 3575b84..73785a4 100644 | ||
23 | --- a/init/main.c | ||
24 | +++ b/init/main.c | ||
25 | @@ -853,6 +853,7 @@ static void run_init_process(char *init_filename) | ||
26 | */ | ||
27 | static int noinline init_post(void) | ||
28 | { | ||
29 | + int retry_count = 1; | ||
30 | free_initmem(); | ||
31 | unlock_kernel(); | ||
32 | mark_rodata_ro(); | ||
33 | @@ -873,6 +874,7 @@ static int noinline init_post(void) | ||
34 | ramdisk_execute_command); | ||
35 | } | ||
36 | |||
37 | +retry: | ||
38 | /* | ||
39 | * We try each of these until one succeeds. | ||
40 | * | ||
41 | @@ -885,6 +887,23 @@ static int noinline init_post(void) | ||
42 | "defaults...\n", execute_command); | ||
43 | } | ||
44 | run_init_process("/sbin/init"); | ||
45 | + | ||
46 | + if (retry_count > 0) { | ||
47 | + retry_count--; | ||
48 | + /* | ||
49 | + * We haven't found init yet... potentially because the device | ||
50 | + * is still being probed. We need to | ||
51 | + * - flush keventd and friends | ||
52 | + * - wait for the known devices to complete their probing | ||
53 | + * - try to mount the root fs again | ||
54 | + */ | ||
55 | + flush_scheduled_work(); | ||
56 | + while (driver_probe_done() != 0) | ||
57 | + msleep(100); | ||
58 | + prepare_namespace(); | ||
59 | + goto retry; | ||
60 | + } | ||
61 | + | ||
62 | run_init_process("/etc/init"); | ||
63 | run_init_process("/bin/init"); | ||
64 | run_init_process("/bin/sh"); | ||
65 | -- | ||
66 | 1.5.4.3 | ||
67 | |||