diff options
| author | Hannes Reinecke <hare@suse.de> | 2004-08-22 22:46:30 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-22 22:46:30 -0700 |
| commit | e5f29853e9797a740708e0d38cecda5be168ac8a (patch) | |
| tree | 300086c4432f53eca1e99480f44dd9b4958232eb | |
| parent | 0a50caad8db2a2a4ab547d8e280ad29560fef37d (diff) | |
[PATCH] Enable all events for initramfs
Currently most driver events are not sent out when using initramfs as
driver_init() (which triggers the events) is called before init_workqueues.
This patch rearranges the init calls so that the hotplug event queue is
enabled prior to calling driver_init(), hence we're getting all hotplug
events again.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | include/linux/kmod.h | 1 | ||||
| -rw-r--r-- | init/main.c | 6 | ||||
| -rw-r--r-- | kernel/kmod.c | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index a484f52445cb..588f4c6ebe29 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -35,6 +35,7 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; } #define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait); +extern void usermodehelper_init(void); #ifdef CONFIG_HOTPLUG extern char hotplug_path []; diff --git a/init/main.c b/init/main.c index e62a5694183d..46fe75c96308 100644 --- a/init/main.c +++ b/init/main.c @@ -31,6 +31,7 @@ #include <linux/tty.h> #include <linux/gfp.h> #include <linux/percpu.h> +#include <linux/kmod.h> #include <linux/kernel_stat.h> #include <linux/security.h> #include <linux/workqueue.h> @@ -605,6 +606,10 @@ static void __init do_initcalls(void) */ static void __init do_basic_setup(void) { + /* drivers will send hotplug events */ + init_workqueues(); + usermodehelper_init(); + driver_init(); #ifdef CONFIG_SYSCTL @@ -614,7 +619,6 @@ static void __init do_basic_setup(void) /* Networking initialization needs a process context */ sock_init(); - init_workqueues(); do_initcalls(); } diff --git a/kernel/kmod.c b/kernel/kmod.c index 579269c38a3b..5e7c44a0cbaa 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -272,10 +272,8 @@ int call_usermodehelper(char *path, char **argv, char **envp, int wait) } EXPORT_SYMBOL(call_usermodehelper); -static __init int usermodehelper_init(void) +void __init usermodehelper_init(void) { khelper_wq = create_singlethread_workqueue("khelper"); BUG_ON(!khelper_wq); - return 0; } -core_initcall(usermodehelper_init); |
