]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/udev.xml
pkgconfig: define variables relative to ${prefix}/${rootprefix}/${sysconfdir}
[thirdparty/systemd.git] / man / udev.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7 Copyright © 2014 Jason St. John
8 -->
9
10 <refentry id="udev">
11 <refentryinfo>
12 <title>udev</title>
13 <productname>systemd</productname>
14 </refentryinfo>
15
16 <refmeta>
17 <refentrytitle>udev</refentrytitle>
18 <manvolnum>7</manvolnum>
19 </refmeta>
20
21 <refnamediv>
22 <refname>udev</refname>
23 <refpurpose>Dynamic device management</refpurpose>
24 </refnamediv>
25
26 <refsect1><title>Description</title>
27 <para>udev supplies the system software with device events, manages permissions
28 of device nodes and may create additional symlinks in the <filename>/dev</filename>
29 directory, or renames network interfaces. The kernel usually just assigns unpredictable
30 device names based on the order of discovery. Meaningful symlinks or network device
31 names provide a way to reliably identify devices based on their properties or
32 current configuration.</para>
33
34 <para>The udev daemon, <citerefentry><refentrytitle>systemd-udevd.service</refentrytitle>
35 <manvolnum>8</manvolnum></citerefentry>, receives device uevents directly from
36 the kernel whenever a device is added or removed from the system, or it changes its
37 state. When udev receives a device event, it matches its configured set of rules
38 against various device attributes to identify the device. Rules that match may
39 provide additional device information to be stored in the udev database or
40 to be used to create meaningful symlink names.</para>
41
42 <para>All device information udev processes is stored in the udev database and
43 sent out to possible event subscribers. Access to all stored data and the event
44 sources is provided by the library libudev.</para>
45 </refsect1>
46
47 <refsect1><title>Rules Files</title>
48 <para>The udev rules are read from the files located in the
49 system rules directory <filename>/usr/lib/udev/rules.d</filename>,
50 the volatile runtime directory <filename>/run/udev/rules.d</filename>
51 and the local administration directory <filename>/etc/udev/rules.d</filename>.
52 All rules files are collectively sorted and processed in lexical order,
53 regardless of the directories in which they live. However, files with
54 identical filenames replace each other. Files in <filename>/etc</filename>
55 have the highest priority, files in <filename>/run</filename> take precedence
56 over files with the same name in <filename>/usr/lib</filename>. This can be
57 used to override a system-supplied rules file with a local file if needed;
58 a symlink in <filename>/etc</filename> with the same name as a rules file in
59 <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
60 disables the rules file entirely. Rule files must have the extension
61 <filename>.rules</filename>; other extensions are ignored.</para>
62
63 <para>Every line in the rules file contains at least one key-value pair.
64 Except for empty lines or lines beginning with <literal>#</literal>, which are ignored.
65 There are two kinds of keys: match and assignment.
66 If all match keys match against their values, the rule gets applied and the
67 assignment keys get the specified values assigned.</para>
68
69 <para>A matching rule may rename a network interface, add symlinks
70 pointing to the device node, or run a specified program as part of
71 the event handling.</para>
72
73 <para>A rule consists of a comma-separated list of one or more key-value pairs.
74 Each key has a distinct operation, depending on the used operator. Valid
75 operators are:</para>
76 <variablelist>
77 <varlistentry>
78 <term><literal>==</literal></term>
79 <listitem>
80 <para>Compare for equality.</para>
81 </listitem>
82 </varlistentry>
83
84 <varlistentry>
85 <term><literal>!=</literal></term>
86 <listitem>
87 <para>Compare for inequality.</para>
88 </listitem>
89 </varlistentry>
90
91 <varlistentry>
92 <term><literal>=</literal></term>
93 <listitem>
94 <para>Assign a value to a key. Keys that represent a list are reset
95 and only this single value is assigned.</para>
96 </listitem>
97 </varlistentry>
98
99 <varlistentry>
100 <term><literal>+=</literal></term>
101 <listitem>
102 <para>Add the value to a key that holds a list of entries.</para>
103 </listitem>
104 </varlistentry>
105
106 <varlistentry>
107 <term><literal>-=</literal></term>
108 <listitem>
109 <para>Remove the value from a key that holds a list of entries.</para>
110 </listitem>
111 </varlistentry>
112
113 <varlistentry>
114 <term><literal>:=</literal></term>
115 <listitem>
116 <para>Assign a value to a key finally; disallow any later changes.</para>
117 </listitem>
118 </varlistentry>
119 </variablelist>
120
121 <para>The following key names can be used to match against device properties.
122 Some of the keys also match against properties of the parent devices in sysfs,
123 not only the device that has generated the event. If multiple keys that match
124 a parent device are specified in a single rule, all these keys must match at
125 one and the same parent device.</para>
126 <variablelist class='udev-directives'>
127 <varlistentry>
128 <term><varname>ACTION</varname></term>
129 <listitem>
130 <para>Match the name of the event action.</para>
131 </listitem>
132 </varlistentry>
133
134 <varlistentry>
135 <term><varname>DEVPATH</varname></term>
136 <listitem>
137 <para>Match the devpath of the event device.</para>
138 </listitem>
139 </varlistentry>
140
141 <varlistentry>
142 <term><varname>KERNEL</varname></term>
143 <listitem>
144 <para>Match the name of the event device.</para>
145 </listitem>
146 </varlistentry>
147
148 <varlistentry>
149 <term><varname>NAME</varname></term>
150 <listitem>
151 <para>Match the name of a network interface. It can be used once the
152 NAME key has been set in one of the preceding rules.</para>
153 </listitem>
154 </varlistentry>
155
156 <varlistentry>
157 <term><varname>SYMLINK</varname></term>
158 <listitem>
159 <para>Match the name of a symlink targeting the node. It can
160 be used once a SYMLINK key has been set in one of the preceding
161 rules. There may be multiple symlinks; only one needs to match.
162 </para>
163 </listitem>
164 </varlistentry>
165
166 <varlistentry>
167 <term><varname>SUBSYSTEM</varname></term>
168 <listitem>
169 <para>Match the subsystem of the event device.</para>
170 </listitem>
171 </varlistentry>
172 <varlistentry>
173 <term><varname>DRIVER</varname></term>
174 <listitem>
175 <para>Match the driver name of the event device. Only set this key for devices
176 which are bound to a driver at the time the event is generated.</para>
177 </listitem>
178 </varlistentry>
179 <varlistentry>
180 <term><varname>ATTR{<replaceable>filename</replaceable>}</varname></term>
181 <listitem>
182 <para>Match sysfs attribute values of the event device. Trailing
183 whitespace in the attribute values is ignored unless the specified match
184 value itself contains trailing whitespace.
185 </para>
186 </listitem>
187 </varlistentry>
188 <varlistentry>
189 <term><varname>SYSCTL{<replaceable>kernel parameter</replaceable>}</varname></term>
190 <listitem>
191 <para>Match a kernel parameter value.
192 </para>
193 </listitem>
194 </varlistentry>
195
196 <varlistentry>
197 <term><varname>KERNELS</varname></term>
198 <listitem>
199 <para>Search the devpath upwards for a matching device name.</para>
200 </listitem>
201 </varlistentry>
202
203 <varlistentry>
204 <term><varname>SUBSYSTEMS</varname></term>
205 <listitem>
206 <para>Search the devpath upwards for a matching device subsystem name.</para>
207 </listitem>
208 </varlistentry>
209
210 <varlistentry>
211 <term><varname>DRIVERS</varname></term>
212 <listitem>
213 <para>Search the devpath upwards for a matching device driver name.</para>
214 </listitem>
215 </varlistentry>
216
217 <varlistentry>
218 <term><varname>ATTRS{<replaceable>filename</replaceable>}</varname></term>
219 <listitem>
220 <para>Search the devpath upwards for a device with matching sysfs attribute values.
221 If multiple <varname>ATTRS</varname> matches are specified, all of them
222 must match on the same device. Trailing whitespace in the attribute values is ignored
223 unless the specified match value itself contains trailing whitespace.</para>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry>
228 <term><varname>TAGS</varname></term>
229 <listitem>
230 <para>Search the devpath upwards for a device with matching tag.</para>
231 </listitem>
232 </varlistentry>
233
234 <varlistentry>
235 <term><varname>ENV{<replaceable>key</replaceable>}</varname></term>
236 <listitem>
237 <para>Match against a device property value.</para>
238 </listitem>
239 </varlistentry>
240
241 <varlistentry>
242 <term><varname>TAG</varname></term>
243 <listitem>
244 <para>Match against a device tag.</para>
245 </listitem>
246 </varlistentry>
247
248 <varlistentry>
249 <term><varname>TEST{<replaceable>octal mode mask</replaceable>}</varname></term>
250 <listitem>
251 <para>Test the existence of a file. An octal mode mask can be specified
252 if needed.</para>
253 </listitem>
254 </varlistentry>
255
256 <varlistentry>
257 <term><varname>PROGRAM</varname></term>
258 <listitem>
259 <para>Execute a program to determine whether there
260 is a match; the key is true if the program returns
261 successfully. The device properties are made available to the
262 executed program in the environment. The program's standard output
263 is available in the <varname>RESULT</varname> key.</para>
264 <para>This can only be used for very short-running foreground tasks. For details,
265 see <varname>RUN</varname>.</para>
266 </listitem>
267 </varlistentry>
268
269 <varlistentry>
270 <term><varname>RESULT</varname></term>
271 <listitem>
272 <para>Match the returned string of the last <varname>PROGRAM</varname> call.
273 This key can be used in the same or in any later rule after a
274 <varname>PROGRAM</varname> call.</para>
275 </listitem>
276 </varlistentry>
277 </variablelist>
278
279 <para>Most of the fields support shell glob pattern matching and
280 alternate patterns. The following special characters are supported:</para>
281 <variablelist>
282 <varlistentry>
283 <term><literal>*</literal></term>
284 <listitem>
285 <para>Matches zero or more characters.</para>
286 </listitem>
287 </varlistentry>
288 <varlistentry>
289 <term><literal>?</literal></term>
290 <listitem>
291 <para>Matches any single character.</para>
292 </listitem>
293 </varlistentry>
294 <varlistentry>
295 <term><literal>[]</literal></term>
296 <listitem>
297 <para>Matches any single character specified within the brackets. For
298 example, the pattern string <literal>tty[SR]</literal>
299 would match either <literal>ttyS</literal> or <literal>ttyR</literal>.
300 Ranges are also supported via the <literal>-</literal> character.
301 For example, to match on the range of all digits, the pattern
302 <literal>[0-9]</literal> could be used. If the first character
303 following the <literal>[</literal> is a <literal>!</literal>,
304 any characters not enclosed are matched.</para>
305 </listitem>
306 </varlistentry>
307 <varlistentry>
308 <term><literal>|</literal></term>
309 <listitem>
310 <para>Separates alternative patterns. For example, the pattern string
311 <literal>abc|x*</literal> would match either <literal>abc</literal>
312 or <literal>x*</literal>.</para>
313 </listitem>
314 </varlistentry>
315 </variablelist>
316
317 <para>The following keys can get values assigned:</para>
318 <variablelist class='udev-directives'>
319 <varlistentry>
320 <term><varname>NAME</varname></term>
321 <listitem>
322 <para>The name to use for a network interface. See
323 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>
324 for a higher-level mechanism for setting the interface name.
325 The name of a device node cannot be changed by udev, only additional
326 symlinks can be created.</para>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry>
331 <term><varname>SYMLINK</varname></term>
332 <listitem>
333 <para>The name of a symlink targeting the node. Every matching rule adds
334 this value to the list of symlinks to be created.</para>
335 <para>The set of characters to name a symlink is limited. Allowed
336 characters are <literal>0-9A-Za-z#+-.:=@_/</literal>, valid UTF-8 character
337 sequences, and <literal>\x00</literal> hex encoding. All other
338 characters are replaced by a <literal>_</literal> character.</para>
339 <para>Multiple symlinks may be specified by separating the names by the
340 space character. In case multiple devices claim the same name, the link
341 always points to the device with the highest link_priority. If the current
342 device goes away, the links are re-evaluated and the device with the
343 next highest link_priority becomes the owner of the link. If no
344 link_priority is specified, the order of the devices (and which one of
345 them owns the link) is undefined.</para>
346 <para>Symlink names must never conflict with the kernel's default device
347 node names, as that would result in unpredictable behavior.
348 </para>
349 </listitem>
350 </varlistentry>
351
352 <varlistentry>
353 <term><varname>OWNER</varname>, <varname>GROUP</varname>, <varname>MODE</varname></term>
354 <listitem>
355 <para>The permissions for the device node. Every specified value overrides
356 the compiled-in default value.</para>
357 </listitem>
358 </varlistentry>
359
360 <varlistentry>
361 <term><varname>SECLABEL{<replaceable>module</replaceable>}</varname></term>
362 <listitem>
363 <para>Applies the specified Linux Security Module label to the device node.</para>
364 </listitem>
365 </varlistentry>
366
367 <varlistentry>
368 <term><varname>ATTR{<replaceable>key</replaceable>}</varname></term>
369 <listitem>
370 <para>The value that should be written to a sysfs attribute of the
371 event device.</para>
372 </listitem>
373 </varlistentry>
374
375 <varlistentry>
376 <term><varname>SYSCTL{<replaceable>kernel parameter</replaceable>}</varname></term>
377 <listitem>
378 <para>The value that should be written to kernel parameter.</para>
379 </listitem>
380 </varlistentry>
381
382 <varlistentry>
383 <term><varname>ENV{<replaceable>key</replaceable>}</varname></term>
384 <listitem>
385 <para>Set a device property value. Property names with a leading <literal>.</literal>
386 are neither stored in the database nor exported to events or
387 external tools (run by, for example, the <varname>PROGRAM</varname>
388 match key).</para>
389 </listitem>
390 </varlistentry>
391
392 <varlistentry>
393 <term><varname>TAG</varname></term>
394 <listitem>
395 <para>Attach a tag to a device. This is used to filter events for users
396 of libudev's monitor functionality, or to enumerate a group of tagged
397 devices. The implementation can only work efficiently if only a few
398 tags are attached to a device. It is only meant to be used in
399 contexts with specific device filter requirements, and not as a
400 general-purpose flag. Excessive use might result in inefficient event
401 handling.</para>
402 </listitem>
403 </varlistentry>
404
405 <varlistentry>
406 <term><varname>RUN{<replaceable>type</replaceable>}</varname></term>
407 <listitem>
408 <para>Add a program to the list of programs to be executed after
409 processing all the rules for a specific event, depending on
410 <literal>type</literal>:</para>
411 <variablelist>
412 <varlistentry>
413 <term><literal>program</literal></term>
414 <listitem>
415 <para>Execute an external program specified as the assigned
416 value. If no absolute path is given, the program is expected
417 to live in <filename>/usr/lib/udev</filename>; otherwise, the
418 absolute path must be specified.</para>
419 <para>This is the default if no <replaceable>type</replaceable>
420 is specified.</para>
421 </listitem>
422 </varlistentry>
423 <varlistentry>
424 <term><literal>builtin</literal></term>
425 <listitem>
426 <para>As <varname>program</varname>, but use one of the
427 built-in programs rather than an external one.</para>
428 </listitem>
429 </varlistentry>
430 </variablelist>
431 <para>The program name and following arguments are separated by spaces.
432 Single quotes can be used to specify arguments with spaces.</para>
433 <para>This can only be used for very short-running foreground tasks. Running an
434 event process for a long period of time may block all further events for
435 this or a dependent device.</para>
436 <para>Starting daemons or other long-running processes is not appropriate
437 for udev; the forked processes, detached or not, will be unconditionally
438 killed after the event handling has finished.</para>
439 <para>Note that running programs that access the network or mount/unmount
440 filesystems is not allowed inside of udev rules, due to the default sandbox
441 that is enforced on <filename>systemd-udevd.service</filename>.</para>
442 </listitem>
443 </varlistentry>
444
445 <varlistentry>
446 <term><varname>LABEL</varname></term>
447 <listitem>
448 <para>A named label to which a <varname>GOTO</varname> may jump.</para>
449 </listitem>
450 </varlistentry>
451
452 <varlistentry>
453 <term><varname>GOTO</varname></term>
454 <listitem>
455 <para>Jumps to the next <varname>LABEL</varname> with a matching name.</para>
456 </listitem>
457 </varlistentry>
458
459 <varlistentry>
460 <term><varname>IMPORT{<replaceable>type</replaceable>}</varname></term>
461 <listitem>
462 <para>Import a set of variables as device properties,
463 depending on <literal>type</literal>:</para>
464 <variablelist>
465 <varlistentry>
466 <term><literal>program</literal></term>
467 <listitem>
468 <para>Execute an external program specified as the assigned
469 value and, if it returns successfully,
470 import its output, which must be in environment key
471 format. Path specification, command/argument separation,
472 and quoting work like in <varname>RUN</varname>.</para>
473 </listitem>
474 </varlistentry>
475 <varlistentry>
476 <term><literal>builtin</literal></term>
477 <listitem>
478 <para>Similar to <literal>program</literal>, but use one of the
479 built-in programs rather than an external one.</para>
480 </listitem>
481 </varlistentry>
482 <varlistentry>
483 <term><literal>file</literal></term>
484 <listitem>
485 <para>Import a text file specified as the assigned value, the content
486 of which must be in environment key format.</para>
487 </listitem>
488 </varlistentry>
489 <varlistentry>
490 <term><literal>db</literal></term>
491 <listitem>
492 <para>Import a single property specified as the assigned value from the
493 current device database. This works only if the database is already populated
494 by an earlier event.</para>
495 </listitem>
496 </varlistentry>
497 <varlistentry>
498 <term><literal>cmdline</literal></term>
499 <listitem>
500 <para>Import a single property from the kernel command line. For simple flags
501 the value of the property is set to <literal>1</literal>.</para>
502 </listitem>
503 </varlistentry>
504 <varlistentry>
505 <term><literal>parent</literal></term>
506 <listitem>
507 <para>Import the stored keys from the parent device by reading
508 the database entry of the parent device. The value assigned to
509 <option>IMPORT{parent}</option> is used as a filter of key names
510 to import (with the same shell glob pattern matching used for
511 comparisons).</para>
512 </listitem>
513 </varlistentry>
514 </variablelist>
515 <para>This can only be used for very short-running foreground tasks. For details
516 see <option>RUN</option>.</para>
517 </listitem>
518 </varlistentry>
519
520 <varlistentry>
521 <term><varname>OPTIONS</varname></term>
522 <listitem>
523 <para>Rule and device options:</para>
524 <variablelist class='udev-directives'>
525 <varlistentry>
526 <term><option>link_priority=<replaceable>value</replaceable></option></term>
527 <listitem>
528 <para>Specify the priority of the created symlinks. Devices with higher
529 priorities overwrite existing symlinks of other devices. The default is 0.</para>
530 </listitem>
531 </varlistentry>
532 <varlistentry>
533 <term><option>string_escape=<replaceable>none|replace</replaceable></option></term>
534 <listitem>
535 <para>Usually, control and other possibly unsafe characters are replaced
536 in strings used for device naming. The mode of replacement can be specified
537 with this option.</para>
538 </listitem>
539 </varlistentry>
540 <varlistentry>
541 <term><option>static_node=</option></term>
542 <listitem>
543 <para>Apply the permissions specified in this rule to the
544 static device node with the specified name. Also, for every
545 tag specified in this rule, create a symlink
546 in the directory
547 <filename>/run/udev/static_node-tags/<replaceable>tag</replaceable></filename>
548 pointing at the static device node with the specified name.
549 Static device node creation is performed by systemd-tmpfiles
550 before systemd-udevd is started. The static nodes might not
551 have a corresponding kernel device; they are used to trigger
552 automatic kernel module loading when they are accessed.</para>
553 </listitem>
554 </varlistentry>
555 <varlistentry>
556 <term><option>watch</option></term>
557 <listitem>
558 <para>Watch the device node with inotify; when the node is
559 closed after being opened for writing, a change uevent is
560 synthesized.</para>
561 </listitem>
562 </varlistentry>
563 <varlistentry>
564 <term><option>nowatch</option></term>
565 <listitem>
566 <para>Disable the watching of a device node with inotify.</para>
567 </listitem>
568 </varlistentry>
569 </variablelist>
570 </listitem>
571 </varlistentry>
572 </variablelist>
573
574 <para>The <varname>NAME</varname>, <varname>SYMLINK</varname>,
575 <varname>PROGRAM</varname>, <varname>OWNER</varname>,
576 <varname>GROUP</varname>, <varname>MODE</varname>, <varname>SECLABEL</varname>,
577 and <varname>RUN</varname> fields support simple string substitutions.
578 The <varname>RUN</varname> substitutions are performed after all rules
579 have been processed, right before the program is executed, allowing for
580 the use of device properties set by earlier matching rules. For all other
581 fields, substitutions are performed while the individual rule is being
582 processed. The available substitutions are:</para>
583 <variablelist class='udev-directives'>
584 <varlistentry>
585 <term><option>$kernel</option>, <option>%k</option></term>
586 <listitem>
587 <para>The kernel name for this device.</para>
588 </listitem>
589 </varlistentry>
590
591 <varlistentry>
592 <term><option>$number</option>, <option>%n</option></term>
593 <listitem>
594 <para>The kernel number for this device. For example,
595 <literal>sda3</literal> has kernel number <literal>3</literal>.
596 </para>
597 </listitem>
598 </varlistentry>
599
600 <varlistentry>
601 <term><option>$devpath</option>, <option>%p</option></term>
602 <listitem>
603 <para>The devpath of the device.</para>
604 </listitem>
605 </varlistentry>
606
607 <varlistentry>
608 <term><option>$id</option>, <option>%b</option></term>
609 <listitem>
610 <para>The name of the device matched while searching the devpath
611 upwards for <option>SUBSYSTEMS</option>, <option>KERNELS</option>,
612 <option>DRIVERS</option>, and <option>ATTRS</option>.
613 </para>
614 </listitem>
615 </varlistentry>
616
617 <varlistentry>
618 <term><option>$driver</option></term>
619 <listitem>
620 <para>The driver name of the device matched while searching the
621 devpath upwards for <option>SUBSYSTEMS</option>,
622 <option>KERNELS</option>, <option>DRIVERS</option>, and
623 <option>ATTRS</option>.
624 </para>
625 </listitem>
626 </varlistentry>
627
628 <varlistentry>
629 <term><option>$attr{<replaceable>file</replaceable>}</option>, <option>%s{<replaceable>file</replaceable>}</option></term>
630 <listitem>
631 <para>The value of a sysfs attribute found at the device where
632 all keys of the rule have matched. If the matching device does not
633 have such an attribute, and a previous <option>KERNELS</option>,
634 <option>SUBSYSTEMS</option>, <option>DRIVERS</option>, or
635 <option>ATTRS</option> test selected a parent device, then the
636 attribute from that parent device is used.
637 </para>
638 <para>If the attribute is a symlink, the last element of the
639 symlink target is returned as the value.
640 </para>
641 </listitem>
642 </varlistentry>
643
644 <varlistentry>
645 <term><option>$env{<replaceable>key</replaceable>}</option>, <option>%E{<replaceable>key</replaceable>}</option></term>
646 <listitem>
647 <para>A device property value.</para>
648 </listitem>
649 </varlistentry>
650
651 <varlistentry>
652 <term><option>$major</option>, <option>%M</option></term>
653 <listitem>
654 <para>The kernel major number for the device.</para>
655 </listitem>
656 </varlistentry>
657
658 <varlistentry>
659 <term><option>$minor</option>, <option>%m</option></term>
660 <listitem>
661 <para>The kernel minor number for the device.</para>
662 </listitem>
663 </varlistentry>
664
665 <varlistentry>
666 <term><option>$result</option>, <option>%c</option></term>
667 <listitem>
668 <para>The string returned by the external program requested with
669 <varname>PROGRAM</varname>.
670 A single part of the string, separated by a space character, may be selected
671 by specifying the part number as an attribute: <literal>%c{N}</literal>.
672 If the number is followed by the <literal>+</literal> character, this part plus all remaining parts
673 of the result string are substituted: <literal>%c{N+}</literal>.</para>
674 </listitem>
675 </varlistentry>
676
677 <varlistentry>
678 <term><option>$parent</option>, <option>%P</option></term>
679 <listitem>
680 <para>The node name of the parent device.</para>
681 </listitem>
682 </varlistentry>
683
684 <varlistentry>
685 <term><option>$name</option></term>
686 <listitem>
687 <para>The current name of the device. If not changed by a rule, it is the
688 name of the kernel device.</para>
689 </listitem>
690 </varlistentry>
691
692 <varlistentry>
693 <term><option>$links</option></term>
694 <listitem>
695 <para>A space-separated list of the current symlinks. The value is
696 only set during a remove event or if an earlier rule assigned a value.</para>
697 </listitem>
698 </varlistentry>
699
700 <varlistentry>
701 <term><option>$root</option>, <option>%r</option></term>
702 <listitem>
703 <para>The udev_root value.</para>
704 </listitem>
705 </varlistentry>
706
707 <varlistentry>
708 <term><option>$sys</option>, <option>%S</option></term>
709 <listitem>
710 <para>The sysfs mount point.</para>
711 </listitem>
712 </varlistentry>
713
714 <varlistentry>
715 <term><option>$devnode</option>, <option>%N</option></term>
716 <listitem>
717 <para>The name of the device node.</para>
718 </listitem>
719 </varlistentry>
720
721 <varlistentry>
722 <term><option>%%</option></term>
723 <listitem>
724 <para>The <literal>%</literal> character itself.</para>
725 </listitem>
726 </varlistentry>
727
728 <varlistentry>
729 <term><option>$$</option></term>
730 <listitem>
731 <para>The <literal>$</literal> character itself.</para>
732 </listitem>
733 </varlistentry>
734 </variablelist>
735 </refsect1>
736
737 <refsect1>
738 <title>See Also</title>
739 <para>
740 <citerefentry>
741 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
742 </citerefentry>,
743 <citerefentry>
744 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
745 </citerefentry>,
746 <citerefentry>
747 <refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum>
748 </citerefentry>
749 </para>
750 </refsect1>
751 </refentry>