Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d610dd52dd1da696e199e4b4545f33a2a5de5c6
Commit:     8d610dd52dd1da696e199e4b4545f33a2a5de5c6
Parent:     8993780a6e44fb4e7ed34e33458506a775356c6e
Author:     Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 11 12:12:04 2006 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Dec 11 12:12:04 2006 -0800

    Make sure we populate the initroot filesystem late enough
    
    We should not initialize rootfs before all the core initializers have
    run.  So do it as a separate stage just before starting the regular
    driver initializers.
    
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-generic/vmlinux.lds.h |    1 +
 include/linux/init.h              |    1 +
 init/initramfs.c                  |    6 ++++--
 init/main.c                       |    7 -------
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h 
b/include/asm-generic/vmlinux.lds.h
index 6e9fceb..7437cca 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -242,6 +242,7 @@
        *(.initcall4s.init)                                             \
        *(.initcall5.init)                                              \
        *(.initcall5s.init)                                             \
+       *(.initcallrootfs.init)                                         \
        *(.initcall6.init)                                              \
        *(.initcall6s.init)                                             \
        *(.initcall7.init)                                              \
diff --git a/include/linux/init.h b/include/linux/init.h
index 5eb5d24..5a593a1 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -111,6 +111,7 @@ extern void setup_arch(char **);
 #define subsys_initcall_sync(fn)       __define_initcall("4s",fn,4s)
 #define fs_initcall(fn)                        __define_initcall("5",fn,5)
 #define fs_initcall_sync(fn)           __define_initcall("5s",fn,5s)
+#define rootfs_initcall(fn)            __define_initcall("rootfs",fn,rootfs)
 #define device_initcall(fn)            __define_initcall("6",fn,6)
 #define device_initcall_sync(fn)       __define_initcall("6s",fn,6s)
 #define late_initcall(fn)              __define_initcall("7",fn,7)
diff --git a/init/initramfs.c b/init/initramfs.c
index 85f0403..4fa0f79 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,7 +526,7 @@ static void __init free_initrd(void)
 
 #endif
 
-void __init populate_rootfs(void)
+static int __init populate_rootfs(void)
 {
        char *err = unpack_to_rootfs(__initramfs_start,
                         __initramfs_end - __initramfs_start, 0);
@@ -544,7 +544,7 @@ void __init populate_rootfs(void)
                        unpack_to_rootfs((char *)initrd_start,
                                initrd_end - initrd_start, 0);
                        free_initrd();
-                       return;
+                       return 0;
                }
                printk("it isn't (%s); looks like an initrd\n", err);
                fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700);
@@ -565,4 +565,6 @@ void __init populate_rootfs(void)
 #endif
        }
 #endif
+       return 0;
 }
+rootfs_initcall(populate_rootfs);
diff --git a/init/main.c b/init/main.c
index fcd9ddc..e3f0bb2 100644
--- a/init/main.c
+++ b/init/main.c
@@ -94,7 +94,6 @@ extern void pidmap_init(void);
 extern void prio_tree_init(void);
 extern void radix_tree_init(void);
 extern void free_initmem(void);
-extern void populate_rootfs(void);
 extern void driver_init(void);
 extern void prepare_namespace(void);
 #ifdef CONFIG_ACPI
@@ -745,12 +744,6 @@ static int init(void * unused)
 
        cpuset_init_smp();
 
-       /*
-        * Do this before initcalls, because some drivers want to access
-        * firmware files.
-        */
-       populate_rootfs();
-
        do_basic_setup();
 
        /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to