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