Commit 6f178056 authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman

[PATCH] take me home, hotplug_path[]

Move hotplug_path[] out of kmod.[ch] to kobject_uevent.[ch] where
it belongs now. At some time in the future we should fix the remaining bad
hotplug calls (no SEQNUM, no netlink uevent):

  ./drivers/input/input.c (no DEVPATH on some hotplug events!)
  ./drivers/pnp/pnpbios/core.c
  ./drivers/s390/crypto/z90main.c
Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent e07d4e61
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/kmod.h> #include <linux/kobject_uevent.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/device.h> #include <linux/device.h>
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/kmod.h> #include <linux/kobject_uevent.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/dmi.h> #include <linux/dmi.h>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/ioctl32.h> #include <linux/ioctl32.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/kobject_uevent.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/version.h> #include <linux/version.h>
......
...@@ -37,8 +37,4 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; } ...@@ -37,8 +37,4 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait); extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait);
extern void usermodehelper_init(void); extern void usermodehelper_init(void);
#ifdef CONFIG_HOTPLUG
extern char hotplug_path [];
#endif
#endif /* __LINUX_KMOD_H__ */ #endif /* __LINUX_KMOD_H__ */
...@@ -11,6 +11,11 @@ ...@@ -11,6 +11,11 @@
#ifndef _KOBJECT_EVENT_H_ #ifndef _KOBJECT_EVENT_H_
#define _KOBJECT_EVENT_H_ #define _KOBJECT_EVENT_H_
#define HOTPLUG_PATH_LEN 256
/* path to the hotplug userspace helper executed on an event */
extern char hotplug_path[];
/* /*
* If you add an action here, you must also add the proper string to the * If you add an action here, you must also add the proper string to the
* lib/kobject_uevent.c file. * lib/kobject_uevent.c file.
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kmod.h> /* for hotplug_path */
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/stop_machine.h> #include <linux/stop_machine.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
......
...@@ -115,29 +115,6 @@ int request_module(const char *fmt, ...) ...@@ -115,29 +115,6 @@ int request_module(const char *fmt, ...)
EXPORT_SYMBOL(request_module); EXPORT_SYMBOL(request_module);
#endif /* CONFIG_KMOD */ #endif /* CONFIG_KMOD */
#ifdef CONFIG_HOTPLUG
/*
hotplug path is set via /proc/sys
invoked by hotplug-aware bus drivers,
with call_usermodehelper
argv [0] = hotplug_path;
argv [1] = "usb", "scsi", "pci", "network", etc;
... plus optional type-specific parameters
argv [n] = 0;
envp [*] = HOME, PATH; optional type-specific parameters
a hotplug bus should invoke this for device add/remove
events. the command is expected to load drivers when
necessary, and may perform additional system setup.
*/
char hotplug_path[KMOD_PATH_LEN] = "/sbin/hotplug";
EXPORT_SYMBOL(hotplug_path);
#endif /* CONFIG_HOTPLUG */
struct subprocess_info { struct subprocess_info {
struct completion *complete; struct completion *complete;
char *path; char *path;
......
...@@ -394,7 +394,7 @@ static ctl_table kern_table[] = { ...@@ -394,7 +394,7 @@ static ctl_table kern_table[] = {
.ctl_name = KERN_HOTPLUG, .ctl_name = KERN_HOTPLUG,
.procname = "hotplug", .procname = "hotplug",
.data = &hotplug_path, .data = &hotplug_path,
.maxlen = KMOD_PATH_LEN, .maxlen = HOTPLUG_PATH_LEN,
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dostring, .proc_handler = &proc_dostring,
.strategy = &sysctl_string, .strategy = &sysctl_string,
......
...@@ -177,6 +177,7 @@ static inline int send_uevent(const char *signal, const char *obj, ...@@ -177,6 +177,7 @@ static inline int send_uevent(const char *signal, const char *obj,
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
u64 hotplug_seqnum; u64 hotplug_seqnum;
static spinlock_t sequence_lock = SPIN_LOCK_UNLOCKED; static spinlock_t sequence_lock = SPIN_LOCK_UNLOCKED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment