diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/init/main.c b/init/main.c index 85d69dffe864..63534a141b4e 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -70,6 +70,8 @@ | |||
70 | #include <linux/perf_event.h> | 70 | #include <linux/perf_event.h> |
71 | #include <linux/file.h> | 71 | #include <linux/file.h> |
72 | #include <linux/ptrace.h> | 72 | #include <linux/ptrace.h> |
73 | #include <linux/blkdev.h> | ||
74 | #include <linux/elevator.h> | ||
73 | 75 | ||
74 | #include <asm/io.h> | 76 | #include <asm/io.h> |
75 | #include <asm/bugs.h> | 77 | #include <asm/bugs.h> |
@@ -604,7 +606,7 @@ asmlinkage void __init start_kernel(void) | |||
604 | pidmap_init(); | 606 | pidmap_init(); |
605 | anon_vma_init(); | 607 | anon_vma_init(); |
606 | #ifdef CONFIG_X86 | 608 | #ifdef CONFIG_X86 |
607 | if (efi_enabled) | 609 | if (efi_enabled(EFI_RUNTIME_SERVICES)) |
608 | efi_enter_virtual_mode(); | 610 | efi_enter_virtual_mode(); |
609 | #endif | 611 | #endif |
610 | thread_info_cache_init(); | 612 | thread_info_cache_init(); |
@@ -632,7 +634,7 @@ asmlinkage void __init start_kernel(void) | |||
632 | acpi_early_init(); /* before LAPIC and SMP init */ | 634 | acpi_early_init(); /* before LAPIC and SMP init */ |
633 | sfi_init_late(); | 635 | sfi_init_late(); |
634 | 636 | ||
635 | if (efi_enabled) { | 637 | if (efi_enabled(EFI_RUNTIME_SERVICES)) { |
636 | efi_late_init(); | 638 | efi_late_init(); |
637 | efi_free_boot_services(); | 639 | efi_free_boot_services(); |
638 | } | 640 | } |
@@ -794,6 +796,17 @@ static void __init do_pre_smp_initcalls(void) | |||
794 | do_one_initcall(*fn); | 796 | do_one_initcall(*fn); |
795 | } | 797 | } |
796 | 798 | ||
799 | /* | ||
800 | * This function requests modules which should be loaded by default and is | ||
801 | * called twice right after initrd is mounted and right before init is | ||
802 | * exec'd. If such modules are on either initrd or rootfs, they will be | ||
803 | * loaded before control is passed to userland. | ||
804 | */ | ||
805 | void __init load_default_modules(void) | ||
806 | { | ||
807 | load_default_elevator_module(); | ||
808 | } | ||
809 | |||
797 | static int run_init_process(const char *init_filename) | 810 | static int run_init_process(const char *init_filename) |
798 | { | 811 | { |
799 | argv_init[0] = init_filename; | 812 | argv_init[0] = init_filename; |
@@ -802,7 +815,7 @@ static int run_init_process(const char *init_filename) | |||
802 | (const char __user *const __user *)envp_init); | 815 | (const char __user *const __user *)envp_init); |
803 | } | 816 | } |
804 | 817 | ||
805 | static void __init kernel_init_freeable(void); | 818 | static noinline void __init kernel_init_freeable(void); |
806 | 819 | ||
807 | static int __ref kernel_init(void *unused) | 820 | static int __ref kernel_init(void *unused) |
808 | { | 821 | { |
@@ -845,7 +858,7 @@ static int __ref kernel_init(void *unused) | |||
845 | "See Linux Documentation/init.txt for guidance."); | 858 | "See Linux Documentation/init.txt for guidance."); |
846 | } | 859 | } |
847 | 860 | ||
848 | static void __init kernel_init_freeable(void) | 861 | static noinline void __init kernel_init_freeable(void) |
849 | { | 862 | { |
850 | /* | 863 | /* |
851 | * Wait until kthreadd is all set-up. | 864 | * Wait until kthreadd is all set-up. |
@@ -900,4 +913,7 @@ static void __init kernel_init_freeable(void) | |||
900 | * we're essentially up and running. Get rid of the | 913 | * we're essentially up and running. Get rid of the |
901 | * initmem segments and start the user-mode stuff.. | 914 | * initmem segments and start the user-mode stuff.. |
902 | */ | 915 | */ |
916 | |||
917 | /* rootfs is available now, try loading default modules */ | ||
918 | load_default_modules(); | ||
903 | } | 919 | } |