chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] make the udev object available to more processing stages
[elogind.git]
/
udevstart.c
diff --git
a/udevstart.c
b/udevstart.c
index e05680aa93d051859c46f8508901b655358376e8..0433e568d448ebbde9f2fd9a23cb7f0f28fa6b1a 100644
(file)
--- a/
udevstart.c
+++ b/
udevstart.c
@@
-92,16
+92,10
@@
static int add_device(char *devpath, char *subsystem)
struct udevice udev;
char path[SYSFS_PATH_MAX];
struct sysfs_class_device *class_dev;
struct udevice udev;
char path[SYSFS_PATH_MAX];
struct sysfs_class_device *class_dev;
- char *argv[3];
- /* fake argument vector and environment for callouts and dev.d/ */
- argv[0] = "udev";
- argv[1] = subsystem;
- argv[2] = NULL;
-
- main_argv = argv;
+ /* set environment for callouts and dev.d/ */
setenv("DEVPATH", devpath, 1);
setenv("DEVPATH", devpath, 1);
- setenv("
ACTION", "add"
, 1);
+ setenv("
SUBSYSTEM", subsystem
, 1);
snprintf(path, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
class_dev = sysfs_open_class_device_path(path);
snprintf(path, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
class_dev = sysfs_open_class_device_path(path);
@@
-291,7
+285,12
@@
static void udev_scan_class(void)
int udev_start(void)
{
int udev_start(void)
{
+ /* set environment for callouts and dev.d/ */
+ setenv("ACTION", "add", 1);
+ setenv("UDEVSTART", "1", 1);
+
udev_scan_class();
udev_scan_block();
udev_scan_class();
udev_scan_block();
+
return 0;
}
return 0;
}