.SH SYNOPSIS
.BI udev " hotplug-subsystem"
.P
-The environment must provide the following variables:
+The following variables are read from the environment:
.TP
.B ACTION
.IR add " or " remove
-signifies the connection or disconnection of a device.
-.TP
+signifies the addition or the removal of a device.
+.P
.B DEVPATH
The sysfs devpath of the device without the mountpoint but a leading slash.
.P
-Additional optional environment variables:
-.TP
+.B SUBSYSTEM
+The subsystem the device belongs to. Alternatively the subsystem may
+be passed as the first argument.
+.P
.B UDEV_CONFIG_FILE
Overrides the default location of the
.B udev
config file.
-.TP
+.P
.B UDEV_NO_DEVD
The default behavior of
.B udev
present devices. It creates or removes device node files usually located in
the /dev directory, or it renames network interfaces.
.br
-
.P
As part of the
.B hotplug
suffix, to be recognized.
.br
In addition to the hotplug environment variables,
+.B UDEV_LOG
+is set if udev is configured to use the syslog facility. Executed programs may
+want to follow that setting.
.B DEVNAME
is exported to make the name of the created node, or the name the network
-device is renamed to, available to the executed program. The programs in every
+device is renamed to, available to the executed program. The programs in every
directory are sorted in lexical order, while the directories are searched in
the following order:
.sp
udevd, udevdsend \- udev event serializer daemon and udev event sender
.SH SYNOPSIS
.BI udevsend " hotplug-subsystem"
-.sp
-The environment must provide the following variables:
-.TP
-.B ACTION
-.IR add " or " remove
-signifies the connection or disconnection of a device.
-.TP
-.B DEVPATH
-The sysfs devpath of the device without the mountpoint but a leading slash.
-.TP
-.B SEQNUM
-The sequence number of the event provided by the kernel.
-If unset, the event bypasses the queue and will be executed immediately.
.SH "DESCRIPTION"
.B udevd
allows the serialization of
in userspace, that makes it neccessary to reorder them.
.br
.B udevd
-takes care of the kernel supplied sequence number and arranges the events for
-execution in the correct order. Missing sequences delay the execution of the
-following events until a timeout is reached.
+takes care of the kernel supplied
+.B SEQNUM
+sequence number and arranges the events for execution in the correct order.
+Missing sequences delay the execution of the following events until a timeout
+is reached. Events without any sequence number are bypassing the queue and
+will be executed immediately.
.br
For each event a
.BR udev (8)
-instance is executed in the background. All further events for the same device
-are delayed until the execution is finished. This way there will never be more
-than one instance running for a single device at the same time.
+instance is executed in the background with the complete environment received
+by the hotplug event. All further events for the same device are delayed until
+the execution is finished. This way there will never be more than one instance
+running for a single device at the same time.
.br
.B udevd
receives the events from
}
help:
- printf("Usage: [-anpqrdVh]\n"
+ printf("Usage: udevinfo [-anpqrdVh]\n"
" -q TYPE query database for the specified value:\n"
" 'name' name of device node\n"
" 'symlink' pointing to node\n"
.SH NAME
udevtest \- simulates a udev run to test the configured rules
.SH SYNOPSIS
-.BI udevtest " sysfs_device_path"
+.B udevtest
+.IR "sysfs_device_path " [ subsystem ]
.SH "DESCRIPTION"
.B udevtest
simulates a
char *devpath;
char path[SYSFS_PATH_MAX];
char temp[NAME_SIZE];
- char *subsystem = "";
struct udevice udev;
+ char *subsystem = NULL;
info("version %s", UDEV_VERSION);
- if (argv[1] == NULL) {
- info("udevinfo expects the DEVPATH of the sysfs device as a argument");
+ if (argc < 2 || argc > 3) {
+ info("Usage: udevtest <devpath> [subsystem]");
return 1;
}
+ /* initialize our configuration */
+ udev_init_config();
+
/* remove sysfs_path if given */
- if (strncmp(argv[1], sysfs_path, strlen(sysfs_path)) == 0)
- devpath = argv[1] + strlen(sysfs_path);
+ if (strncmp(argv[1], sysfs_path, strlen(sysfs_path)) == 0) {
+ devpath = &argv[1][strlen(sysfs_path)] ;
+ }
else
if (argv[1][0] != '/') {
/* prepend '/' if missing */
return 2;
}
- /* initialize our configuration */
- udev_init_config();
-
/* initialize the naming deamon */
namedev_init();
- if (argv[2] != NULL)
+ if (argc == 3)
subsystem = argv[2];
/* fill in values and test_run flag*/