chiark / gitweb /
man: add link_priority default value
[elogind.git] / udev.xml
index 958c10d1d6a63adf0dc0b6003e90249c53e666c6..e1986799686f366645f1da45f33f7cd01e6e7aaf 100644 (file)
--- a/udev.xml
+++ b/udev.xml
@@ -3,19 +3,6 @@
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 
 <article>
-  <articleinfo>
-    <title>xmlto</title>
-    <author>
-      <firstname>Kay</firstname>
-      <surname>Sievers</surname>
-      <email>kay.sievers@vrfy.org</email>
-    </author>
-    <copyright>
-      <year>2006</year>
-      <holder>Kay Sievers</holder>
-    </copyright>
-  </articleinfo>
-
   <section>
     <title>udev</title>
     <refentry>
@@ -28,6 +15,7 @@
       <refmeta>
         <refentrytitle>udev</refentrytitle>
         <manvolnum>7</manvolnum>
+        <refmiscinfo class="version"></refmiscinfo>
       </refmeta>
 
       <refnamediv>
 
         <para>Usually udev runs as <citerefentry><refentrytitle>udevd</refentrytitle>
         <manvolnum>8</manvolnum></citerefentry> and receives uevents directly from the
-        kernel if a device is added or removed form the system.</para>
+        kernel if a device is added or removed from the system.</para>
 
         <para>If udev receives a device event, it matches its configured rules
         against the available device attributes provided in sysfs to identify the device.
-        Rules that match, may provide additional device information or specify a device
+        Rules that match may provide additional device information or specify a device
         node name and multiple symlink names and instruct udev to run additional programs
         as part of the device event handling.</para>
       </refsect1>
         <refsect2><title>Rules files</title>
           <para>The udev rules are read from the files located in the
           <filename>/etc/udev/rules.d</filename> directory or at the location specified
-          value in the configuraton file. Every line in the rules file contains at least
-          one key value pair. There are two kind of keys, match and assignement keys.
+          value in the configuration file. Every line in the rules file contains at least
+          one key value pair. There are two kind of keys, match and assignment keys.
           If all match keys are matching against its value, the rule gets applied and the
-          assign keys get the specified value assigned. A matching rule may specify the
-          name of the device node, add a symlink pointing to the node, or run a specified
-          program as part of the event handling. If no matching rule is found, the default
-          device node name is used.</para>
+          assign keys get the specified value assigned.</para>
+
+          <para>A matching rule may specify the name of the device node, add a symlink
+          pointing to the node, or run a specified program as part of the event handling.
+          If no matching rule is found, the default device node name is used.</para>
 
-          <para>A rule may consists of a list of one or more key value pairs separated by
+          <para>A rule may consist of a list of one or more key value pairs separated by
           a comma. Each key has a distinct operation, depending on the used operator. Valid
           operators are:</para>
           <variablelist>
             <varlistentry>
               <term><option>=</option></term>
               <listitem>
-                <para>Asign a value to a key. Keys that represent a list, are reset
+                <para>Assign a value to a key. Keys that represent a list, are reset
                 and only this single value is assigned.</para>
               </listitem>
             </varlistentry>
             </varlistentry>
           </variablelist>
 
-          <para>The following key names can be used to match against device properties:</para>
+          <para>The following key names can be used to match against device properties.
+          Some of the keys also match against properties of the parent devices in sysfs,
+          not only the device that has generated the event. If multiple keys that match
+          a parent device are specified in a single rule, all these keys must match at
+          one and the same parent device.</para>
           <variablelist>
             <varlistentry>
               <term><option>ACTION</option></term>
               </listitem>
             </varlistentry>
 
+            <varlistentry>
+              <term><option>DEVPATH</option></term>
+              <listitem>
+                <para>Match the devpath of the event device.</para>
+              </listitem>
+            </varlistentry>
+
             <varlistentry>
               <term><option>KERNEL</option></term>
               <listitem>
-                <para>Match the name of the device.</para>
+                <para>Match the name of the event device.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
-              <term><option>DEVPATH</option></term>
+              <term><option>NAME</option></term>
               <listitem>
-                <para>Match the devpath of the device.</para>
+                <para>Match the name of the node or network interface. It can
+                be used once the NAME key has been set in one of the preceding
+                rules.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
               <term><option>SUBSYSTEM</option></term>
               <listitem>
-                <para>Match the subsystem of the device.</para>
+                <para>Match the subsystem of the event device.</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term><option>DRIVER</option></term>
+              <listitem>
+                <para>Match the driver name of the event device. Only set for devices
+                which are bound to a driver at the time the event is generated.</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term><option>ATTR{<replaceable>filename</replaceable>}</option></term>
+              <listitem>
+                <para>Match sysfs attribute values of the event device. Up to five
+                <option>ATTR</option> keys can be specified per rule. Trailing
+                whitespace in the attribute values is ignored, if the specified match
+                value does not contain trailing whitespace itself. Depending on the type
+                of operator, this key is also used to set the value of a sysfs attribute.
+                </para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
-              <term><option>BUS</option></term>
+              <term><option>KERNELS</option></term>
               <listitem>
-                <para>Search the devpath upwards for a matching device subsystem name.</para>
+                <para>Search the devpath upwards for a matching device name.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
-              <term><option>DRIVER</option></term>
+              <term><option>SUBSYSTEMS</option></term>
               <listitem>
-                <para>Search the devpath upwards for a matching device driver name.</para>
+                <para>Search the devpath upwards for a matching device subsystem name.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
-              <term><option>ID</option></term>
+              <term><option>DRIVERS</option></term>
               <listitem>
-                <para>Search the devpath upwards for a matching device name.</para>
+                <para>Search the devpath upwards for a matching device driver name.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
-              <term><option>SYSFS{<replaceable>filename</replaceable>}</option></term>
+              <term><option>ATTRS{<replaceable>filename</replaceable>}</option></term>
               <listitem>
                 <para>Search the devpath upwards for a device with matching sysfs attribute values.
-                Up to five <option>SYSFS</option> keys can be specified per rule. All attributes
+                Up to five <option>ATTRS</option> keys can be specified per rule, but all of them
                 must match on the same device. Trailing whitespace in the attribute values is ignored,
                 if the specified match value does not contain trailing whitespace itself.</para>
               </listitem>
               <term><option>ENV{<replaceable>key</replaceable>}</option></term>
               <listitem>
                 <para>Match against the value of an environment variable. Up to five <option>ENV</option>
-                keys can be specified per rule. This key can also be used to export a variable to
-                the environment.</para>
+                keys can be specified per rule. Depending on the type of operator, this key is also used
+                to export a variable to the environment.</para>
+              </listitem>
+            </varlistentry>
+
+            <varlistentry>
+              <term><option>TEST{<replaceable>octal mode mask</replaceable>}</option></term>
+              <listitem>
+                <para>Test the existence of a file. An octal mode mask can be specified
+                if needed.</para>
               </listitem>
             </varlistentry>
 
               <term><option>PROGRAM</option></term>
               <listitem>
                 <para>Execute external program. The key is true, if the program returns
-                without exit code zero. The whole event environment is available to the
-                executed program. The program's output printed to stdout is available for
+                with exit code zero. The whole event environment is available to the
+                executed program. The program's output printed to stdout, is available in
                 the RESULT key.</para>
               </listitem>
             </varlistentry>
             <varlistentry>
               <term><option>[]</option></term>
               <listitem>
-                <para>Matches any single character specified within the brackets.
+                <para>Matches any single character specified within the brackets. For
                 example, the pattern string 'tty[SR]' would match either 'ttyS' or 'ttyR'.
                 Ranges are also supported within this match with the '-' character.
                 For example, to match on the range of all digits, the pattern [0-9] would
               </listitem>
             </varlistentry>
 
+            <varlistentry>
+              <term><option>ATTR{<replaceable>key</replaceable>}</option></term>
+              <listitem>
+                <para>The value that should be written to a sysfs attribute of the
+                event device. Depending on the type of operator, this key is also
+                used to match against the value of a sysfs attribute.</para>
+              </listitem>
+            </varlistentry>
+
             <varlistentry>
               <term><option>ENV{<replaceable>key</replaceable>}</option></term>
               <listitem>
-                <para>Export a variable to the environment. This key can also be used to match
-                against an environment variable.</para>
+                <para>Export a variable to the environment. Depending on the type of operator,
+                this key is also to match against an environment variable.</para>
               </listitem>
             </varlistentry>
 
                 event process for a long period of time may block all further events for
                 this or a dependent device. Long running tasks need to be immediately
                 detached from the event process itself.</para>
+                <para>If the specifiefd string starts with
+                <option>socket:<replaceable>path</replaceable></option>, all current event
+                values will be passed to the specified socket, as a message in the same
+                format the kernel sends an uevent. If the first character of the specified path
+                is an @ character, an abstract namespace socket is used, instead of an existing
+                socket file.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
               <term><option>IMPORT{<replaceable>type</replaceable>}</option></term>
               <listitem>
-                <para>Import the printed result or the value of a file in environment key
-                format into the event environment. <option>program</option> will execute an
-                external program and read its output. <option>file</option> will inport a
-                text file. If no option is given, udev will determine it from the  executable
-                bit of of the file permissions.</para>
+                <para>Import a set of variables into the event environment,
+                depending on <replaceable>type</replaceable>:</para>
+                <variablelist>
+                  <varlistentry>
+                    <term><option>program</option></term>
+                    <listitem>
+                      <para>Execute an external program specified as the assigned value and
+                      import its output, which must be in environment key format.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>file</option></term>
+                    <listitem>
+                      <para>Import a text file specified as the assigned value, which must be in
+                      environment key format.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>parent</option></term>
+                    <listitem>
+                      <para>Import the stored keys from the parent device by reading
+                      the database entry of the parent device. The value assigned to
+                      <option>IMPORT{parent}</option> is used as a filter of key names
+                      to import (with the same shell-style pattern matching used for
+                      comparisons).</para>
+                    </listitem>
+                  </varlistentry>
+                </variablelist>
+                <para>If no option is given, udev will choose between <option>program</option>
+                and <option>file</option> based on the executable bit of the file
+                permissions.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
-              <term><option>WAIT_FOR_SYSFS</option></term>
+              <term><option>WAIT_FOR</option></term>
               <listitem>
-                <para>Wait for the specified sysfs file of the device to be created. Can be used
-                to fight against kernel sysfs timing issues.</para>
+                <para>Wait for a file to become available.</para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
               <term><option>OPTIONS</option></term>
               <listitem>
-                <para><option>last_rule</option> stops further rules application. No later rules
-                will have any effect.
-                <option>ignore_device</option> will ignore this event completely.
-                <option>ignore_remove</option> will ignore  any  later  remove  event  for  this
-                device. This may be useful as a workaround for broken device drivers.
-                <option>all_partitions</option> will create device nodes for all available partitions of
-                a block device. This may be useful for removable media.</para>
+                <para>Rule and device options:</para>
+                <variablelist>
+                  <varlistentry>
+                    <term><option>last_rule</option></term>
+                    <listitem>
+                      <para>Stops further rules application. No later rules will have
+                      any effect.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>ignore_device</option></term>
+                    <listitem>
+                      <para>Ignore this event completely.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>ignore_remove</option></term>
+                    <listitem>
+                      <para>Do not remove the device node when the device goes away. This may be
+                      useful as a workaround for broken device drivers.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>link_priority=<replaceable>value</replaceable></option></term>
+                    <listitem>
+                      <para>Specify the priority of the created symlinks. Devices with higher
+                      priorities overwrite existing symlinks of other devices. The default is 0.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>all_partitions</option></term>
+                    <listitem>
+                      <para>Create the device nodes for all available partitions of a block device.
+                      This may be useful for removable media devices where media changes are not
+                      detected.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>event_timeout=</option></term>
+                    <listitem>
+                      <para>Number of seconds an event will wait for operations to finish, before it
+                      will terminate itself.</para>
+                    </listitem>
+                  </varlistentry>
+                  <varlistentry>
+                    <term><option>string_escape=<replaceable>none|replace</replaceable></option></term>
+                    <listitem>
+                      <para>Usually control and other possibly unsafe characters are replaced
+                      in strings used for device naming. The mode of replacement can be specified
+                      with this option.</para>
+                    </listitem>
+                  </varlistentry>
+                </variablelist>
               </listitem>
             </varlistentry>
           </variablelist>
 
           <para>The <option>NAME</option>, <option>SYMLINK</option>, <option>PROGRAM</option>,
-          <option>OWNER</option>, <option>GROUP</option>  and  <option>RUN</option>
+          <option>OWNER</option>, <option>GROUP</option>, <option>MODE</option>  and  <option>RUN</option>
           fields support simple printf-like string substitutions. The <option>RUN</option>
           format chars gets applied after all rules have been processed, right before the program
           is executed. It allows the use of the complete environment set by earlier matching
               <term><option>$id</option>, <option>%b</option></term>
               <listitem>
                 <para>The name of the device matched while searching the devpath upwards for
-                  <option>BUS</option>, <option>ID</option> <option>DRIVER</option> and <option>SYSFS</option>.
+                  <option>SUBSYSTEMS</option>, <option>KERNELS</option>, <option>DRIVERS</option> and <option>ATTRS</option>.
                 </para>
               </listitem>
             </varlistentry>
 
             <varlistentry>
-              <term><option>$sysfs{<replaceable>file</replaceable>}</option>, <option>%s{<replaceable>file</replaceable>}</option></term>
+              <term><option>$driver</option></term>
               <listitem>
-                <para>The value of a sysfs attribute found at the current or a parent device.</para>
+                <para>The driver name of the device matched while searching the devpath upwards for
+                  <option>SUBSYSTEMS</option>, <option>KERNELS</option>, <option>DRIVERS</option> and <option>ATTRS</option>.
+                </para>
+              </listitem>
+            </varlistentry>
+
+            <varlistentry>
+              <term><option>$attr{<replaceable>file</replaceable>}</option>, <option>%s{<replaceable>file</replaceable>}</option></term>
+              <listitem>
+                <para>The value of a sysfs attribute found at the device, where
+                all keys of the rule have matched. If the matching device does not have
+                such an attribute, follow the chain of parent devices and use the value
+                of the first attribute that matches.
+                If the attribute is a symlink, the last element of the symlink target is
+                returned as the value.</para>
               </listitem>
             </varlistentry>
 
             </varlistentry>
 
             <varlistentry>
-              <term><option>$minor</option> <option>%m</option></term>
+              <term><option>$minor</option>, <option>%m</option></term>
               <listitem>
                 <para>The kernel minor number for the device.</para>
               </listitem>
               </listitem>
             </varlistentry>
 
+            <varlistentry>
+              <term><option>$name</option></term>
+              <listitem>
+                <para>The current name of the device node. If not changed by a rule, it is the
+                name of the kernel device.</para>
+              </listitem>
+            </varlistentry>
+
+            <varlistentry>
+              <term><option>$links</option></term>
+              <listitem>
+                <para>The current list of symlinks, separated by a space character. The value is
+                only set if an earlier rule assigned a value, or during a remove events.</para>
+              </listitem>
+            </varlistentry>
+
             <varlistentry>
               <term><option>$root</option>, <option>%r</option></term>
               <listitem>
               </listitem>
             </varlistentry>
 
+            <varlistentry>
+              <term><option>$sys</option>, <option>%S</option></term>
+              <listitem>
+                <para>The sysfs mount point.</para>
+              </listitem>
+            </varlistentry>
+
             <varlistentry>
               <term><option>$tempnode</option>, <option>%N</option></term>
               <listitem>
       <refsect1><title>AUTHOR</title>
         <para>Written by Greg Kroah-Hartman <email>greg@kroah.com</email> and
         Kay Sievers <email>kay.sievers@vrfy.org</email>. With much help from
-        Dan  Stekloff <email>dsteklof@us.ibm.com</email> and many others.</para>
+        Dan Stekloff and many others.</para>
       </refsect1>
 
       <refsect1>
             <refentrytitle>udevd</refentrytitle><manvolnum>8</manvolnum>
           </citerefentry>, 
           <citerefentry>
-            <refentrytitle>udevinfo</refentrytitle><manvolnum>8</manvolnum>
-          </citerefentry>, 
-          <citerefentry>
-            <refentrytitle>udevmonitor</refentrytitle><manvolnum>8</manvolnum>
+            <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
         </citerefentry></para>
       </refsect1>
     </refentry>