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