systemd/man/udev.html
2015-02-17 11:22:16 +01:00

195 lines
33 KiB
HTML

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>udev</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="udev"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>udev — Dynamic device management</p></div><div class="refsect1"><a name="idm139995108112432"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p>udev supplies the system software with device events, manages permissions
of device nodes and may create additional symlinks in the <code class="filename">/dev</code>
directory, or renames network interfaces. The kernel usually just assigns unpredictable
device names based on the order of discovery. Meaningful symlinks or network device
names provide a way to reliably identify devices based on their properties or
current configuration.</p><p>The udev daemon, <a href="systemd-udevd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-udevd.service</span>(8)</span></a>, receives device uevents directly from
the kernel whenever a device is added or removed from the system, or it changes its
state. When udev receives a device event, it matches its configured set of rules
against various device attributes to identify the device. Rules that match may
provide additional device information to be stored in the udev database or
to be used to create meaningful symlink names.</p><p>All device information udev processes is stored in the udev database and
sent out to possible event subscribers. Access to all stored data and the event
sources is provided by the library libudev.</p></div><div class="refsect1"><a name="idm139995108107888"></a><h2 id="Rules Files">Rules Files<a class="headerlink" title="Permalink to this headline" href="#Rules%20Files"></a></h2><p>The udev rules are read from the files located in the
system rules directory <code class="filename">/usr/lib/udev/rules.d</code>,
the volatile runtime directory <code class="filename">/run/udev/rules.d</code>
and the local administration directory <code class="filename">/etc/udev/rules.d</code>.
All rules files are collectively sorted and processed in lexical order,
regardless of the directories in which they live. However, files with
identical filenames replace each other. Files in <code class="filename">/etc</code>
have the highest priority, files in <code class="filename">/run</code> take precedence
over files with the same name in <code class="filename">/usr/lib</code>. This can be
used to override a system-supplied rules file with a local file if needed;
a symlink in <code class="filename">/etc</code> with the same name as a rules file in
<code class="filename">/usr/lib</code>, pointing to <code class="filename">/dev/null</code>,
disables the rules file entirely. Rule files must have the extension
<code class="filename">.rules</code>; other extensions are ignored.</p><p>Every line in the rules file contains at least one key-value pair.
Except for empty lines or lines beginning with "<code class="literal">#</code>", which are ignored.
There are two kinds of keys: match and assignment.
If all match keys match against their values, the rule gets applied and the
assignment keys get the specified values assigned.</p><p>A matching rule may rename a network interface, add symlinks
pointing to the device node, or run a specified program as part of
the event handling.</p><p>A rule consists of a comma-separated list of one or more key-value pairs.
Each key has a distinct operation, depending on the used operator. Valid
operators are:</p><div class="variablelist"><dl class="variablelist"><dt id="=="><span class="term">"<code class="literal">==</code>"</span><a class="headerlink" title="Permalink to this term" href="#=="></a></dt><dd><p>Compare for equality.</p></dd><dt id="!="><span class="term">"<code class="literal">!=</code>"</span><a class="headerlink" title="Permalink to this term" href="#!="></a></dt><dd><p>Compare for inequality.</p></dd><dt id="="><span class="term">"<code class="literal">=</code>"</span><a class="headerlink" title="Permalink to this term" href="#="></a></dt><dd><p>Assign a value to a key. Keys that represent a list are reset
and only this single value is assigned.</p></dd><dt id="+="><span class="term">"<code class="literal">+=</code>"</span><a class="headerlink" title="Permalink to this term" href="#+="></a></dt><dd><p>Add the value to a key that holds a list of entries.</p></dd><dt id="-="><span class="term">"<code class="literal">-=</code>"</span><a class="headerlink" title="Permalink to this term" href="#-="></a></dt><dd><p>Remove the value from a key that holds a list of entries.</p></dd><dt id=":="><span class="term">"<code class="literal">:=</code>"</span><a class="headerlink" title="Permalink to this term" href="#:="></a></dt><dd><p>Assign a value to a key finally; disallow any later changes.</p></dd></dl></div><p>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.</p><div class="variablelist"><dl class="variablelist"><dt id="ACTION"><span class="term"><code class="varname">ACTION</code></span><a class="headerlink" title="Permalink to this term" href="#ACTION"></a></dt><dd><p>Match the name of the event action.</p></dd><dt id="DEVPATH"><span class="term"><code class="varname">DEVPATH</code></span><a class="headerlink" title="Permalink to this term" href="#DEVPATH"></a></dt><dd><p>Match the devpath of the event device.</p></dd><dt id="KERNEL"><span class="term"><code class="varname">KERNEL</code></span><a class="headerlink" title="Permalink to this term" href="#KERNEL"></a></dt><dd><p>Match the name of the event device.</p></dd><dt id="NAME"><span class="term"><code class="varname">NAME</code></span><a class="headerlink" title="Permalink to this term" href="#NAME"></a></dt><dd><p>Match the name of a network interface. It can be used once the
NAME key has been set in one of the preceding rules.</p></dd><dt id="SYMLINK"><span class="term"><code class="varname">SYMLINK</code></span><a class="headerlink" title="Permalink to this term" href="#SYMLINK"></a></dt><dd><p>Match the name of a symlink targeting the node. It can
be used once a SYMLINK key has been set in one of the preceding
rules. There may be multiple symlinks; only one needs to match.
</p></dd><dt id="SUBSYSTEM"><span class="term"><code class="varname">SUBSYSTEM</code></span><a class="headerlink" title="Permalink to this term" href="#SUBSYSTEM"></a></dt><dd><p>Match the subsystem of the event device.</p></dd><dt id="DRIVER"><span class="term"><code class="varname">DRIVER</code></span><a class="headerlink" title="Permalink to this term" href="#DRIVER"></a></dt><dd><p>Match the driver name of the event device. Only set this key for devices
which are bound to a driver at the time the event is generated.</p></dd><dt id="ATTR{filename}"><span class="term"><code class="varname">ATTR{<em class="replaceable"><code>filename</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#ATTR%7Bfilename%7D"></a></dt><dd><p>Match sysfs attribute values of the event device. Trailing
whitespace in the attribute values is ignored unless the specified match
value itself contains trailing whitespace.
</p></dd><dt id="KERNELS"><span class="term"><code class="varname">KERNELS</code></span><a class="headerlink" title="Permalink to this term" href="#KERNELS"></a></dt><dd><p>Search the devpath upwards for a matching device name.</p></dd><dt id="SUBSYSTEMS"><span class="term"><code class="varname">SUBSYSTEMS</code></span><a class="headerlink" title="Permalink to this term" href="#SUBSYSTEMS"></a></dt><dd><p>Search the devpath upwards for a matching device subsystem name.</p></dd><dt id="DRIVERS"><span class="term"><code class="varname">DRIVERS</code></span><a class="headerlink" title="Permalink to this term" href="#DRIVERS"></a></dt><dd><p>Search the devpath upwards for a matching device driver name.</p></dd><dt id="ATTRS{filename}"><span class="term"><code class="varname">ATTRS{<em class="replaceable"><code>filename</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#ATTRS%7Bfilename%7D"></a></dt><dd><p>Search the devpath upwards for a device with matching sysfs attribute values.
If multiple <code class="varname">ATTRS</code> matches are specified, all of them
must match on the same device. Trailing whitespace in the attribute values is ignored
unless the specified match value itself contains trailing whitespace.</p></dd><dt id="TAGS"><span class="term"><code class="varname">TAGS</code></span><a class="headerlink" title="Permalink to this term" href="#TAGS"></a></dt><dd><p>Search the devpath upwards for a device with matching tag.</p></dd><dt id="ENV{key}"><span class="term"><code class="varname">ENV{<em class="replaceable"><code>key</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#ENV%7Bkey%7D"></a></dt><dd><p>Match against a device property value.</p></dd><dt id="TAG"><span class="term"><code class="varname">TAG</code></span><a class="headerlink" title="Permalink to this term" href="#TAG"></a></dt><dd><p>Match against a device tag.</p></dd><dt id="TEST{octal mode mask}"><span class="term"><code class="varname">TEST{<em class="replaceable"><code>octal mode mask</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#TEST%7Boctal%20mode%20mask%7D"></a></dt><dd><p>Test the existence of a file. An octal mode mask can be specified
if needed.</p></dd><dt id="PROGRAM"><span class="term"><code class="varname">PROGRAM</code></span><a class="headerlink" title="Permalink to this term" href="#PROGRAM"></a></dt><dd><p>Execute a program to determine whether there
is a match; the key is true if the program returns
successfully. The device properties are made available to the
executed program in the environment. The program's standard output
is available in the <code class="varname">RESULT</code> key.</p><p>This can only be used for very short-running foreground tasks. For details,
see <code class="varname">RUN</code>.</p></dd><dt id="RESULT"><span class="term"><code class="varname">RESULT</code></span><a class="headerlink" title="Permalink to this term" href="#RESULT"></a></dt><dd><p>Match the returned string of the last <code class="varname">PROGRAM</code> call.
This key can be used in the same or in any later rule after a
<code class="varname">PROGRAM</code> call.</p></dd></dl></div><p>Most of the fields support shell glob pattern matching and
alternate patterns. The following special characters are supported:</p><div class="variablelist"><dl class="variablelist"><dt id="*"><span class="term">"<code class="literal">*</code>"</span><a class="headerlink" title="Permalink to this term" href="#*"></a></dt><dd><p>Matches zero or more characters.</p></dd><dt id="?"><span class="term">"<code class="literal">?</code>"</span><a class="headerlink" title="Permalink to this term" href="#?"></a></dt><dd><p>Matches any single character.</p></dd><dt id="[]"><span class="term">"<code class="literal">[]</code>"</span><a class="headerlink" title="Permalink to this term" href="#%5B%5D"></a></dt><dd><p>Matches any single character specified within the brackets. For
example, the pattern string "<code class="literal">tty[SR]</code>"
would match either "<code class="literal">ttyS</code>" or "<code class="literal">ttyR</code>".
Ranges are also supported via the "<code class="literal">-</code>" character.
For example, to match on the range of all digits, the pattern
"<code class="literal">[0-9]</code>" could be used. If the first character
following the "<code class="literal">[</code>" is a "<code class="literal">!</code>",
any characters not enclosed are matched.</p></dd><dt id="|"><span class="term">"<code class="literal">|</code>"</span><a class="headerlink" title="Permalink to this term" href="#%7C"></a></dt><dd><p>Separates alternative patterns. For example, the pattern string
"<code class="literal">abc|x*</code>" would match either "<code class="literal">abc</code>"
or "<code class="literal">x*</code>".</p></dd></dl></div><p>The following keys can get values assigned:</p><div class="variablelist"><dl class="variablelist"><dt id="NAME"><span class="term"><code class="varname">NAME</code></span><a class="headerlink" title="Permalink to this term" href="#NAME"></a></dt><dd><p>The name to use for a network interface. See
<a href="systemd.link.html"><span class="citerefentry"><span class="refentrytitle">systemd.link</span>(5)</span></a>
for a higher-level mechanism for setting the interface name.
The name of a device node cannot be changed by udev, only additional
symlinks can be created.</p></dd><dt id="SYMLINK"><span class="term"><code class="varname">SYMLINK</code></span><a class="headerlink" title="Permalink to this term" href="#SYMLINK"></a></dt><dd><p>The name of a symlink targeting the node. Every matching rule adds
this value to the list of symlinks to be created.</p><p>The set of characters to name a symlink is limited. Allowed
characters are "<code class="literal">0-9A-Za-z#+-.:=@_/</code>", valid UTF-8 character
sequences, and "<code class="literal">\x00</code>" hex encoding. All other
characters are replaced by a "<code class="literal">_</code>" character.</p><p>Multiple symlinks may be specified by separating the names by the
space character. In case multiple devices claim the same name, the link
always points to the device with the highest link_priority. If the current
device goes away, the links are re-evaluated and the device with the
next highest link_priority becomes the owner of the link. If no
link_priority is specified, the order of the devices (and which one of
them owns the link) is undefined.</p><p>Symlink names must never conflict with the kernel's default device
node names, as that would result in unpredictable behavior.
</p></dd><dt id="OWNER, GROUP, MODE"><span class="term"><code class="varname">OWNER</code>, <code class="varname">GROUP</code>, <code class="varname">MODE</code></span><a class="headerlink" title="Permalink to this term" href="#OWNER,%20GROUP,%20MODE"></a></dt><dd><p>The permissions for the device node. Every specified value overrides
the compiled-in default value.</p></dd><dt id="SECLABEL{module}"><span class="term"><code class="varname">SECLABEL{<em class="replaceable"><code>module</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#SECLABEL%7Bmodule%7D"></a></dt><dd><p>Applies the specified Linux Security Module label to the device node.</p></dd><dt id="ATTR{key}"><span class="term"><code class="varname">ATTR{<em class="replaceable"><code>key</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#ATTR%7Bkey%7D"></a></dt><dd><p>The value that should be written to a sysfs attribute of the
event device.</p></dd><dt id="ENV{key}"><span class="term"><code class="varname">ENV{<em class="replaceable"><code>key</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#ENV%7Bkey%7D"></a></dt><dd><p>Set a device property value. Property names with a leading "<code class="literal">.</code>"
are neither stored in the database nor exported to events or
external tools (run by, for example, the <code class="varname">PROGRAM</code>
match key).</p></dd><dt id="TAG"><span class="term"><code class="varname">TAG</code></span><a class="headerlink" title="Permalink to this term" href="#TAG"></a></dt><dd><p>Attach a tag to a device. This is used to filter events for users
of libudev's monitor functionality, or to enumerate a group of tagged
devices. The implementation can only work efficiently if only a few
tags are attached to a device. It is only meant to be used in
contexts with specific device filter requirements, and not as a
general-purpose flag. Excessive use might result in inefficient event
handling.</p></dd><dt id="RUN{type}"><span class="term"><code class="varname">RUN{<em class="replaceable"><code>type</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#RUN%7Btype%7D"></a></dt><dd><p>Add a program to the list of programs to be executed after
processing all the rules for a specific event, depending on
"<code class="literal">type</code>":</p><div class="variablelist"><dl class="variablelist"><dt id="program"><span class="term">"<code class="literal">program</code>"</span><a class="headerlink" title="Permalink to this term" href="#program"></a></dt><dd><p>Execute an external program specified as the assigned
value. If no absolute path is given, the program is expected
to live in <code class="filename">/usr/lib/udev</code>; otherwise, the
absolute path must be specified.</p><p>This is the default if no <em class="replaceable"><code>type</code></em>
is specified.</p></dd><dt id="builtin"><span class="term">"<code class="literal">builtin</code>"</span><a class="headerlink" title="Permalink to this term" href="#builtin"></a></dt><dd><p>As <code class="varname">program</code>, but use one of the
built-in programs rather than an external one.</p></dd></dl></div><p>The program name and following arguments are separated by spaces.
Single quotes can be used to specify arguments with spaces.</p><p>This can only be used for very short-running foreground tasks. Running an
event process for a long period of time may block all further events for
this or a dependent device.</p><p>Starting daemons or other long-running processes is not appropriate
for udev; the forked processes, detached or not, will be unconditionally
killed after the event handling has finished.</p></dd><dt id="LABEL"><span class="term"><code class="varname">LABEL</code></span><a class="headerlink" title="Permalink to this term" href="#LABEL"></a></dt><dd><p>A named label to which a <code class="varname">GOTO</code> may jump.</p></dd><dt id="GOTO"><span class="term"><code class="varname">GOTO</code></span><a class="headerlink" title="Permalink to this term" href="#GOTO"></a></dt><dd><p>Jumps to the next <code class="varname">LABEL</code> with a matching name.</p></dd><dt id="IMPORT{type}"><span class="term"><code class="varname">IMPORT{<em class="replaceable"><code>type</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#IMPORT%7Btype%7D"></a></dt><dd><p>Import a set of variables as device properties,
depending on "<code class="literal">type</code>":</p><div class="variablelist"><dl class="variablelist"><dt id="program"><span class="term">"<code class="literal">program</code>"</span><a class="headerlink" title="Permalink to this term" href="#program"></a></dt><dd><p>Execute an external program specified as the assigned value and
import its output, which must be in environment key
format. Path specification, command/argument separation,
and quoting work like in <code class="varname">RUN</code>.</p></dd><dt id="builtin"><span class="term">"<code class="literal">builtin</code>"</span><a class="headerlink" title="Permalink to this term" href="#builtin"></a></dt><dd><p>Similar to "<code class="literal">program</code>", but use one of the
built-in programs rather than an external one.</p></dd><dt id="file"><span class="term">"<code class="literal">file</code>"</span><a class="headerlink" title="Permalink to this term" href="#file"></a></dt><dd><p>Import a text file specified as the assigned value, the content
of which must be in environment key format.</p></dd><dt id="db"><span class="term">"<code class="literal">db</code>"</span><a class="headerlink" title="Permalink to this term" href="#db"></a></dt><dd><p>Import a single property specified as the assigned value from the
current device database. This works only if the database is already populated
by an earlier event.</p></dd><dt id="cmdline"><span class="term">"<code class="literal">cmdline</code>"</span><a class="headerlink" title="Permalink to this term" href="#cmdline"></a></dt><dd><p>Import a single property from the kernel command line. For simple flags
the value of the property is set to "<code class="literal">1</code>".</p></dd><dt id="parent"><span class="term">"<code class="literal">parent</code>"</span><a class="headerlink" title="Permalink to this term" href="#parent"></a></dt><dd><p>Import the stored keys from the parent device by reading
the database entry of the parent device. The value assigned to
<code class="option">IMPORT{parent}</code> is used as a filter of key names
to import (with the same shell glob pattern matching used for
comparisons).</p></dd></dl></div><p>This can only be used for very short-running foreground tasks. For details
see <code class="option">RUN</code>.</p></dd><dt id="WAIT_FOR"><span class="term"><code class="varname">WAIT_FOR</code></span><a class="headerlink" title="Permalink to this term" href="#WAIT_FOR"></a></dt><dd><p>Wait for a file to become available or until a timeout of
10 seconds expires. The path is relative to the sysfs device;
if no path is specified, this waits for an attribute to appear.</p></dd><dt id="OPTIONS"><span class="term"><code class="varname">OPTIONS</code></span><a class="headerlink" title="Permalink to this term" href="#OPTIONS"></a></dt><dd><p>Rule and device options:</p><div class="variablelist"><dl class="variablelist"><dt id="link_priority=value"><span class="term"><code class="option">link_priority=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#link_priority=value"></a></dt><dd><p>Specify the priority of the created symlinks. Devices with higher
priorities overwrite existing symlinks of other devices. The default is 0.</p></dd><dt id="string_escape=none|replace"><span class="term"><code class="option">string_escape=<em class="replaceable"><code>none|replace</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#string_escape=none%7Creplace"></a></dt><dd><p>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.</p></dd><dt id="static_node="><span class="term"><code class="option">static_node=</code></span><a class="headerlink" title="Permalink to this term" href="#static_node="></a></dt><dd><p>Apply the permissions specified in this rule to the
static device node with the specified name. Also, for every
tag specified in this rule, create a symlink
in the directory
<code class="filename">/run/udev/static_node-tags/<em class="replaceable"><code>tag</code></em></code>
pointing at the static device node with the specified name.
Static device node creation is performed by systemd-tmpfiles
before systemd-udevd is started. The static nodes might not
have a corresponding kernel device; they are used to trigger
automatic kernel module loading when they are accessed.</p></dd><dt id="watch"><span class="term"><code class="option">watch</code></span><a class="headerlink" title="Permalink to this term" href="#watch"></a></dt><dd><p>Watch the device node with inotify; when the node is
closed after being opened for writing, a change uevent is
synthesized.</p></dd><dt id="nowatch"><span class="term"><code class="option">nowatch</code></span><a class="headerlink" title="Permalink to this term" href="#nowatch"></a></dt><dd><p>Disable the watching of a device node with inotify.</p></dd></dl></div></dd></dl></div><p>The <code class="varname">NAME</code>, <code class="varname">SYMLINK</code>,
<code class="varname">PROGRAM</code>, <code class="varname">OWNER</code>,
<code class="varname">GROUP</code>, <code class="varname">MODE</code>, and
<code class="varname">RUN</code> fields support simple string substitutions.
The <code class="varname">RUN</code> substitutions are performed after all rules
have been processed, right before the program is executed, allowing for
the use of device properties set by earlier matching rules. For all other
fields, substitutions are performed while the individual rule is being
processed. The available substitutions are:</p><div class="variablelist"><dl class="variablelist"><dt id="$kernel, %k"><span class="term"><code class="option">$kernel</code>, <code class="option">%k</code></span><a class="headerlink" title="Permalink to this term" href="#%24kernel,%20%k"></a></dt><dd><p>The kernel name for this device.</p></dd><dt id="$number, %n"><span class="term"><code class="option">$number</code>, <code class="option">%n</code></span><a class="headerlink" title="Permalink to this term" href="#%24number,%20%n"></a></dt><dd><p>The kernel number for this device. For example,
"<code class="literal">sda3</code>" has kernel number "<code class="literal">3</code>".
</p></dd><dt id="$devpath, %p"><span class="term"><code class="option">$devpath</code>, <code class="option">%p</code></span><a class="headerlink" title="Permalink to this term" href="#%24devpath,%20%p"></a></dt><dd><p>The devpath of the device.</p></dd><dt id="$id, %b"><span class="term"><code class="option">$id</code>, <code class="option">%b</code></span><a class="headerlink" title="Permalink to this term" href="#%24id,%20%b"></a></dt><dd><p>The name of the device matched while searching the devpath
upwards for <code class="option">SUBSYSTEMS</code>, <code class="option">KERNELS</code>,
<code class="option">DRIVERS</code>, and <code class="option">ATTRS</code>.
</p></dd><dt id="$driver"><span class="term"><code class="option">$driver</code></span><a class="headerlink" title="Permalink to this term" href="#%24driver"></a></dt><dd><p>The driver name of the device matched while searching the
devpath upwards for <code class="option">SUBSYSTEMS</code>,
<code class="option">KERNELS</code>, <code class="option">DRIVERS</code>, and
<code class="option">ATTRS</code>.
</p></dd><dt id="$attr{file}, %s{file}"><span class="term"><code class="option">$attr{<em class="replaceable"><code>file</code></em>}</code>, <code class="option">%s{<em class="replaceable"><code>file</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#%24attr%7Bfile%7D,%20%s%7Bfile%7D"></a></dt><dd><p>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, and a previous <code class="option">KERNELS</code>,
<code class="option">SUBSYSTEMS</code>, <code class="option">DRIVERS</code>, or
<code class="option">ATTRS</code> test selected a parent device, then the
attribute from that parent device is used.
</p><p>If the attribute is a symlink, the last element of the
symlink target is returned as the value.
</p></dd><dt id="$env{key}, %E{key}"><span class="term"><code class="option">$env{<em class="replaceable"><code>key</code></em>}</code>, <code class="option">%E{<em class="replaceable"><code>key</code></em>}</code></span><a class="headerlink" title="Permalink to this term" href="#%24env%7Bkey%7D,%20%E%7Bkey%7D"></a></dt><dd><p>A device property value.</p></dd><dt id="$major, %M"><span class="term"><code class="option">$major</code>, <code class="option">%M</code></span><a class="headerlink" title="Permalink to this term" href="#%24major,%20%M"></a></dt><dd><p>The kernel major number for the device.</p></dd><dt id="$minor, %m"><span class="term"><code class="option">$minor</code>, <code class="option">%m</code></span><a class="headerlink" title="Permalink to this term" href="#%24minor,%20%m"></a></dt><dd><p>The kernel minor number for the device.</p></dd><dt id="$result, %c"><span class="term"><code class="option">$result</code>, <code class="option">%c</code></span><a class="headerlink" title="Permalink to this term" href="#%24result,%20%c"></a></dt><dd><p>The string returned by the external program requested with
<code class="varname">PROGRAM</code>.
A single part of the string, separated by a space character, may be selected
by specifying the part number as an attribute: "<code class="literal">%c{N}</code>".
If the number is followed by the "<code class="literal">+</code>" character, this part plus all remaining parts
of the result string are substituted: "<code class="literal">%c{N+}</code>".</p></dd><dt id="$parent, %P"><span class="term"><code class="option">$parent</code>, <code class="option">%P</code></span><a class="headerlink" title="Permalink to this term" href="#%24parent,%20%P"></a></dt><dd><p>The node name of the parent device.</p></dd><dt id="$name"><span class="term"><code class="option">$name</code></span><a class="headerlink" title="Permalink to this term" href="#%24name"></a></dt><dd><p>The current name of the device. If not changed by a rule, it is the
name of the kernel device.</p></dd><dt id="$links"><span class="term"><code class="option">$links</code></span><a class="headerlink" title="Permalink to this term" href="#%24links"></a></dt><dd><p>A space-separated list of the current symlinks. The value is
only set during a remove event or if an earlier rule assigned a value.</p></dd><dt id="$root, %r"><span class="term"><code class="option">$root</code>, <code class="option">%r</code></span><a class="headerlink" title="Permalink to this term" href="#%24root,%20%r"></a></dt><dd><p>The udev_root value.</p></dd><dt id="$sys, %S"><span class="term"><code class="option">$sys</code>, <code class="option">%S</code></span><a class="headerlink" title="Permalink to this term" href="#%24sys,%20%S"></a></dt><dd><p>The sysfs mount point.</p></dd><dt id="$devnode, %N"><span class="term"><code class="option">$devnode</code>, <code class="option">%N</code></span><a class="headerlink" title="Permalink to this term" href="#%24devnode,%20%N"></a></dt><dd><p>The name of the device node.</p></dd><dt id="%%"><span class="term"><code class="option">%%</code></span><a class="headerlink" title="Permalink to this term" href="#%%"></a></dt><dd><p>The "<code class="literal">%</code>" character itself.</p></dd><dt id="$$"><span class="term"><code class="option">$$</code></span><a class="headerlink" title="Permalink to this term" href="#%24%24"></a></dt><dd><p>The "<code class="literal">$</code>" character itself.</p></dd></dl></div></div><div class="refsect1"><a name="idm139995103009584"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
<a href="systemd-udevd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-udevd.service</span>(8)</span></a>,
<a href="udevadm.html"><span class="citerefentry"><span class="refentrytitle">udevadm</span>(8)</span></a>,
<a href="systemd.link.html"><span class="citerefentry"><span class="refentrytitle">systemd.link</span>(5)</span></a>
</p></div></div></body></html>