chiark / gitweb /
[PATCH] update the man pages and correct Usage: hints
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Sun, 28 Nov 2004 12:41:15 +0000 (13:41 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 06:00:29 +0000 (23:00 -0700)
Add UDEV_LOG to the man udev man page. Remove mention of specific
variables from the udevd/udevsend man page as we changed to pass
the whole environment.

Correct printed Usage: of udevtest and udevinfo.

Init the config in udevtest earlier to accept input with and without
the sysfs mount point.

udev.8.in
udevd.8
udevinfo.c
udevtest.8
udevtest.c

index 728ddb1a45355c5d3abeb84e2d1599427092f3c5..7bdf560970ff46ddd830fb80f3d1ba26da67fb83 100644 (file)
--- a/udev.8.in
+++ b/udev.8.in
@@ -4,22 +4,24 @@ udev \- Linux configurable dynamic device naming support
 .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
@@ -34,7 +36,6 @@ provides a dynamic device directory containing only the files for actually
 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
@@ -373,9 +374,12 @@ The name of a program must end with
 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
diff --git a/udevd.8 b/udevd.8
index 1de7a3cba2f7ae1a7085141c356f9566b9a6a128..1a5940fef5c3d06179d23415a31ea29168f0bcd1 100644 (file)
--- a/udevd.8
+++ b/udevd.8
@@ -3,19 +3,6 @@
 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
@@ -24,15 +11,19 @@ events. The events generated by the kernel may arrive in random order
 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
index fe847b875f0d08406db8bdf1544e62f952fd2f7d..340496b42b339b707137f65322c51633f23266e4 100644 (file)
@@ -439,7 +439,7 @@ exit:
        }
 
 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"
index 6be7e089cf05da94eb684473715f60a6c60a6d13..13b57f03b626845d6fc1387c940719f6b62854f5 100644 (file)
@@ -2,7 +2,8 @@
 .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
index 37ec767e138ad189073255fa209065082e213c75..9cc23f0ac70be903fb54edd9e4215d004c3e8870 100644 (file)
@@ -55,19 +55,23 @@ int main(int argc, char *argv[], char *envp[])
        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 */
@@ -86,13 +90,10 @@ int main(int argc, char *argv[], char *envp[])
                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*/