]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/udev.xml
travis: use UBSan checks from OSS-Fuzz
[thirdparty/systemd.git] / man / udev.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//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 system rules directories
49 <filename>/usr/lib/udev/rules.d</filename> and <filename>/usr/local/lib/udev/rules.d</filename>, the
50 volatile runtime directory <filename>/run/udev/rules.d</filename> and the local administration
51 directory <filename>/etc/udev/rules.d</filename>. All rules files are collectively sorted and
52 processed in lexical order, regardless of the directories in which they live. However, files with
53 identical filenames replace each other. Files in <filename>/etc</filename> have the highest priority,
54 files in <filename>/run</filename> take precedence over files with the same name under
55 <filename>/usr</filename>. This can be used to override a system-supplied rules file with a local
56 file if needed; a symlink in <filename>/etc</filename> with the same name as a rules file in
57 <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>, disables the rules file
58 entirely. Rule files must have the extension <filename>.rules</filename>; other extensions are
59 ignored.</para>
60
61 <para>Every line in the rules file contains at least one key-value pair.
62 Except for empty lines or lines beginning with <literal>#</literal>, which are ignored.
63 There are two kinds of keys: match and assignment.
64 If all match keys match against their values, the rule gets applied and the
65 assignment keys get the specified values assigned.</para>
66
67 <para>A matching rule may rename a network interface, add symlinks
68 pointing to the device node, or run a specified program as part of
69 the event handling.</para>
70
71 <para>A rule consists of a comma-separated list of one or more key-value pairs.
72 Each key has a distinct operation, depending on the used operator. Valid
73 operators are:</para>
74 <variablelist>
75 <varlistentry>
76 <term><literal>==</literal></term>
77 <listitem>
78 <para>Compare for equality.</para>
79 </listitem>
80 </varlistentry>
81
82 <varlistentry>
83 <term><literal>!=</literal></term>
84 <listitem>
85 <para>Compare for inequality.</para>
86 </listitem>
87 </varlistentry>
88
89 <varlistentry>
90 <term><literal>=</literal></term>
91 <listitem>
92 <para>Assign a value to a key. Keys that represent a list are reset
93 and only this single value is assigned.</para>
94 </listitem>
95 </varlistentry>
96
97 <varlistentry>
98 <term><literal>+=</literal></term>
99 <listitem>
100 <para>Add the value to a key that holds a list of entries.</para>
101 </listitem>
102 </varlistentry>
103
104 <varlistentry>
105 <term><literal>-=</literal></term>
106 <listitem>
107 <para>Remove the value from a key that holds a list of entries.</para>
108 </listitem>
109 </varlistentry>
110
111 <varlistentry>
112 <term><literal>:=</literal></term>
113 <listitem>
114 <para>Assign a value to a key finally; disallow any later changes.</para>
115 </listitem>
116 </varlistentry>
117 </variablelist>
118
119 <para>The following key names can be used to match against device properties.
120 Some of the keys also match against properties of the parent devices in sysfs,
121 not only the device that has generated the event. If multiple keys that match
122 a parent device are specified in a single rule, all these keys must match at
123 one and the same parent device.</para>
124 <variablelist class='udev-directives'>
125 <varlistentry>
126 <term><varname>ACTION</varname></term>
127 <listitem>
128 <para>Match the name of the event action.</para>
129 </listitem>
130 </varlistentry>
131
132 <varlistentry>
133 <term><varname>DEVPATH</varname></term>
134 <listitem>
135 <para>Match the devpath of the event device.</para>
136 </listitem>
137 </varlistentry>
138
139 <varlistentry>
140 <term><varname>KERNEL</varname></term>
141 <listitem>
142 <para>Match the name of the event device.</para>
143 </listitem>
144 </varlistentry>
145
146 <varlistentry>
147 <term><varname>NAME</varname></term>
148 <listitem>
149 <para>Match the name of a network interface. It can be used once the
150 NAME key has been set in one of the preceding rules.</para>
151 </listitem>
152 </varlistentry>
153
154 <varlistentry>
155 <term><varname>SYMLINK</varname></term>
156 <listitem>
157 <para>Match the name of a symlink targeting the node. It can
158 be used once a SYMLINK key has been set in one of the preceding
159 rules. There may be multiple symlinks; only one needs to match.
160 </para>
161 </listitem>
162 </varlistentry>
163
164 <varlistentry>
165 <term><varname>SUBSYSTEM</varname></term>
166 <listitem>
167 <para>Match the subsystem of the event device.</para>
168 </listitem>
169 </varlistentry>
170 <varlistentry>
171 <term><varname>DRIVER</varname></term>
172 <listitem>
173 <para>Match the driver name of the event device. Only set this key for devices
174 which are bound to a driver at the time the event is generated.</para>
175 </listitem>
176 </varlistentry>
177 <varlistentry>
178 <term><varname>ATTR{<replaceable>filename</replaceable>}</varname></term>
179 <listitem>
180 <para>Match sysfs attribute values of the event device. Trailing
181 whitespace in the attribute values is ignored unless the specified match
182 value itself contains trailing whitespace.
183 </para>
184 </listitem>
185 </varlistentry>
186 <varlistentry>
187 <term><varname>SYSCTL{<replaceable>kernel parameter</replaceable>}</varname></term>
188 <listitem>
189 <para>Match a kernel parameter value.
190 </para>
191 </listitem>
192 </varlistentry>
193
194 <varlistentry>
195 <term><varname>KERNELS</varname></term>
196 <listitem>
197 <para>Search the devpath upwards for a matching device name.</para>
198 </listitem>
199 </varlistentry>
200
201 <varlistentry>
202 <term><varname>SUBSYSTEMS</varname></term>
203 <listitem>
204 <para>Search the devpath upwards for a matching device subsystem name.</para>
205 </listitem>
206 </varlistentry>
207
208 <varlistentry>
209 <term><varname>DRIVERS</varname></term>
210 <listitem>
211 <para>Search the devpath upwards for a matching device driver name.</para>
212 </listitem>
213 </varlistentry>
214
215 <varlistentry>
216 <term><varname>ATTRS{<replaceable>filename</replaceable>}</varname></term>
217 <listitem>
218 <para>Search the devpath upwards for a device with matching sysfs attribute values.
219 If multiple <varname>ATTRS</varname> matches are specified, all of them
220 must match on the same device. Trailing whitespace in the attribute values is ignored
221 unless the specified match value itself contains trailing whitespace.</para>
222 </listitem>
223 </varlistentry>
224
225 <varlistentry>
226 <term><varname>TAGS</varname></term>
227 <listitem>
228 <para>Search the devpath upwards for a device with matching tag.</para>
229 </listitem>
230 </varlistentry>
231
232 <varlistentry>
233 <term><varname>ENV{<replaceable>key</replaceable>}</varname></term>
234 <listitem>
235 <para>Match against a device property value.</para>
236 </listitem>
237 </varlistentry>
238
239 <varlistentry>
240 <term><varname>TAG</varname></term>
241 <listitem>
242 <para>Match against a device tag.</para>
243 </listitem>
244 </varlistentry>
245
246 <varlistentry>
247 <term><varname>TEST{<replaceable>octal mode mask</replaceable>}</varname></term>
248 <listitem>
249 <para>Test the existence of a file. An octal mode mask can be specified
250 if needed.</para>
251 </listitem>
252 </varlistentry>
253
254 <varlistentry>
255 <term><varname>PROGRAM</varname></term>
256 <listitem>
257 <para>Execute a program to determine whether there
258 is a match; the key is true if the program returns
259 successfully. The device properties are made available to the
260 executed program in the environment. The program's standard output
261 is available in the <varname>RESULT</varname> key.</para>
262 <para>This can only be used for very short-running foreground tasks. For details,
263 see <varname>RUN</varname>.</para>
264 </listitem>
265 </varlistentry>
266
267 <varlistentry>
268 <term><varname>RESULT</varname></term>
269 <listitem>
270 <para>Match the returned string of the last <varname>PROGRAM</varname> call.
271 This key can be used in the same or in any later rule after a
272 <varname>PROGRAM</varname> call.</para>
273 </listitem>
274 </varlistentry>
275 </variablelist>
276
277 <para>Most of the fields support shell glob pattern matching and
278 alternate patterns. The following special characters are supported:</para>
279 <variablelist>
280 <varlistentry>
281 <term><literal>*</literal></term>
282 <listitem>
283 <para>Matches zero or more characters.</para>
284 </listitem>
285 </varlistentry>
286 <varlistentry>
287 <term><literal>?</literal></term>
288 <listitem>
289 <para>Matches any single character.</para>
290 </listitem>
291 </varlistentry>
292 <varlistentry>
293 <term><literal>[]</literal></term>
294 <listitem>
295 <para>Matches any single character specified within the brackets. For
296 example, the pattern string <literal>tty[SR]</literal>
297 would match either <literal>ttyS</literal> or <literal>ttyR</literal>.
298 Ranges are also supported via the <literal>-</literal> character.
299 For example, to match on the range of all digits, the pattern
300 <literal>[0-9]</literal> could be used. If the first character
301 following the <literal>[</literal> is a <literal>!</literal>,
302 any characters not enclosed are matched.</para>
303 </listitem>
304 </varlistentry>
305 <varlistentry>
306 <term><literal>|</literal></term>
307 <listitem>
308 <para>Separates alternative patterns. For example, the pattern string
309 <literal>abc|x*</literal> would match either <literal>abc</literal>
310 or <literal>x*</literal>.</para>
311 </listitem>
312 </varlistentry>
313 </variablelist>
314
315 <para>The following keys can get values assigned:</para>
316 <variablelist class='udev-directives'>
317 <varlistentry>
318 <term><varname>NAME</varname></term>
319 <listitem>
320 <para>The name to use for a network interface. See
321 <citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry>
322 for a higher-level mechanism for setting the interface name.
323 The name of a device node cannot be changed by udev, only additional
324 symlinks can be created.</para>
325 </listitem>
326 </varlistentry>
327
328 <varlistentry>
329 <term><varname>SYMLINK</varname></term>
330 <listitem>
331 <para>The name of a symlink targeting the node. Every matching rule adds
332 this value to the list of symlinks to be created.</para>
333 <para>The set of characters to name a symlink is limited. Allowed
334 characters are <literal>0-9A-Za-z#+-.:=@_/</literal>, valid UTF-8 character
335 sequences, and <literal>\x00</literal> hex encoding. All other
336 characters are replaced by a <literal>_</literal> character.</para>
337 <para>Multiple symlinks may be specified by separating the names by the
338 space character. In case multiple devices claim the same name, the link
339 always points to the device with the highest link_priority. If the current
340 device goes away, the links are re-evaluated and the device with the
341 next highest link_priority becomes the owner of the link. If no
342 link_priority is specified, the order of the devices (and which one of
343 them owns the link) is undefined.</para>
344 <para>Symlink names must never conflict with the kernel's default device
345 node names, as that would result in unpredictable behavior.
346 </para>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry>
351 <term><varname>OWNER</varname>, <varname>GROUP</varname>, <varname>MODE</varname></term>
352 <listitem>
353 <para>The permissions for the device node. Every specified value overrides
354 the compiled-in default value.</para>
355 </listitem>
356 </varlistentry>
357
358 <varlistentry>
359 <term><varname>SECLABEL{<replaceable>module</replaceable>}</varname></term>
360 <listitem>
361 <para>Applies the specified Linux Security Module label to the device node.</para>
362 </listitem>
363 </varlistentry>
364
365 <varlistentry>
366 <term><varname>ATTR{<replaceable>key</replaceable>}</varname></term>
367 <listitem>
368 <para>The value that should be written to a sysfs attribute of the
369 event device.</para>
370 </listitem>
371 </varlistentry>
372
373 <varlistentry>
374 <term><varname>SYSCTL{<replaceable>kernel parameter</replaceable>}</varname></term>
375 <listitem>
376 <para>The value that should be written to kernel parameter.</para>
377 </listitem>
378 </varlistentry>
379
380 <varlistentry>
381 <term><varname>ENV{<replaceable>key</replaceable>}</varname></term>
382 <listitem>
383 <para>Set a device property value. Property names with a leading <literal>.</literal>
384 are neither stored in the database nor exported to events or
385 external tools (run by, for example, the <varname>PROGRAM</varname>
386 match key).</para>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry>
391 <term><varname>TAG</varname></term>
392 <listitem>
393 <para>Attach a tag to a device. This is used to filter events for users
394 of libudev's monitor functionality, or to enumerate a group of tagged
395 devices. The implementation can only work efficiently if only a few
396 tags are attached to a device. It is only meant to be used in
397 contexts with specific device filter requirements, and not as a
398 general-purpose flag. Excessive use might result in inefficient event
399 handling.</para>
400 </listitem>
401 </varlistentry>
402
403 <varlistentry>
404 <term><varname>RUN{<replaceable>type</replaceable>}</varname></term>
405 <listitem>
406 <para>Add a program to the list of programs to be executed after
407 processing all the rules for a specific event, depending on
408 <literal>type</literal>:</para>
409 <variablelist>
410 <varlistentry>
411 <term><literal>program</literal></term>
412 <listitem>
413 <para>Execute an external program specified as the assigned
414 value. If no absolute path is given, the program is expected
415 to live in <filename>/usr/lib/udev</filename>; otherwise, the
416 absolute path must be specified.</para>
417 <para>This is the default if no <replaceable>type</replaceable>
418 is specified.</para>
419 </listitem>
420 </varlistentry>
421 <varlistentry>
422 <term><literal>builtin</literal></term>
423 <listitem>
424 <para>As <varname>program</varname>, but use one of the
425 built-in programs rather than an external one.</para>
426 </listitem>
427 </varlistentry>
428 </variablelist>
429 <para>The program name and following arguments are separated by spaces.
430 Single quotes can be used to specify arguments with spaces.</para>
431 <para>This can only be used for very short-running foreground tasks. Running an
432 event process for a long period of time may block all further events for
433 this or a dependent device.</para>
434 <para>Starting daemons or other long-running processes is not appropriate
435 for udev; the forked processes, detached or not, will be unconditionally
436 killed after the event handling has finished.</para>
437 <para>Note that running programs that access the network or mount/unmount
438 filesystems is not allowed inside of udev rules, due to the default sandbox
439 that is enforced on <filename>systemd-udevd.service</filename>.</para>
440 <para>Please also note that <literal>:=</literal> and <literal>=</literal> are clearing
441 both, program and builtin commands.</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 <varlistentry>
570 <term><option>db_persist</option></term>
571 <listitem>
572 <para>Set the flag (sticky bit) on the udev database entry
573 of the event device. Device properties are then kept in the
574 database even when
575 <command>udevadm info --cleanup-db</command> is called.
576 This option can be useful in certain cases
577 (e.g. Device Mapper devices) for persisting device state
578 on the transition from initramfs.</para>
579 </listitem>
580 </varlistentry>
581 </variablelist>
582 </listitem>
583 </varlistentry>
584 </variablelist>
585
586 <para>The <varname>NAME</varname>, <varname>SYMLINK</varname>,
587 <varname>PROGRAM</varname>, <varname>OWNER</varname>,
588 <varname>GROUP</varname>, <varname>MODE</varname>, <varname>SECLABEL</varname>,
589 and <varname>RUN</varname> fields support simple string substitutions.
590 The <varname>RUN</varname> substitutions are performed after all rules
591 have been processed, right before the program is executed, allowing for
592 the use of device properties set by earlier matching rules. For all other
593 fields, substitutions are performed while the individual rule is being
594 processed. The available substitutions are:</para>
595 <variablelist class='udev-directives'>
596 <varlistentry>
597 <term><option>$kernel</option>, <option>%k</option></term>
598 <listitem>
599 <para>The kernel name for this device.</para>
600 </listitem>
601 </varlistentry>
602
603 <varlistentry>
604 <term><option>$number</option>, <option>%n</option></term>
605 <listitem>
606 <para>The kernel number for this device. For example,
607 <literal>sda3</literal> has kernel number <literal>3</literal>.
608 </para>
609 </listitem>
610 </varlistentry>
611
612 <varlistentry>
613 <term><option>$devpath</option>, <option>%p</option></term>
614 <listitem>
615 <para>The devpath of the device.</para>
616 </listitem>
617 </varlistentry>
618
619 <varlistentry>
620 <term><option>$id</option>, <option>%b</option></term>
621 <listitem>
622 <para>The name of the device matched while searching the devpath
623 upwards for <option>SUBSYSTEMS</option>, <option>KERNELS</option>,
624 <option>DRIVERS</option>, and <option>ATTRS</option>.
625 </para>
626 </listitem>
627 </varlistentry>
628
629 <varlistentry>
630 <term><option>$driver</option></term>
631 <listitem>
632 <para>The driver name of the device matched while searching the
633 devpath upwards for <option>SUBSYSTEMS</option>,
634 <option>KERNELS</option>, <option>DRIVERS</option>, and
635 <option>ATTRS</option>.
636 </para>
637 </listitem>
638 </varlistentry>
639
640 <varlistentry>
641 <term><option>$attr{<replaceable>file</replaceable>}</option>, <option>%s{<replaceable>file</replaceable>}</option></term>
642 <listitem>
643 <para>The value of a sysfs attribute found at the device where
644 all keys of the rule have matched. If the matching device does not
645 have such an attribute, and a previous <option>KERNELS</option>,
646 <option>SUBSYSTEMS</option>, <option>DRIVERS</option>, or
647 <option>ATTRS</option> test selected a parent device, then the
648 attribute from that parent device is used.
649 </para>
650 <para>If the attribute is a symlink, the last element of the
651 symlink target is returned as the value.
652 </para>
653 </listitem>
654 </varlistentry>
655
656 <varlistentry>
657 <term><option>$env{<replaceable>key</replaceable>}</option>, <option>%E{<replaceable>key</replaceable>}</option></term>
658 <listitem>
659 <para>A device property value.</para>
660 </listitem>
661 </varlistentry>
662
663 <varlistentry>
664 <term><option>$major</option>, <option>%M</option></term>
665 <listitem>
666 <para>The kernel major number for the device.</para>
667 </listitem>
668 </varlistentry>
669
670 <varlistentry>
671 <term><option>$minor</option>, <option>%m</option></term>
672 <listitem>
673 <para>The kernel minor number for the device.</para>
674 </listitem>
675 </varlistentry>
676
677 <varlistentry>
678 <term><option>$result</option>, <option>%c</option></term>
679 <listitem>
680 <para>The string returned by the external program requested with
681 <varname>PROGRAM</varname>.
682 A single part of the string, separated by a space character, may be selected
683 by specifying the part number as an attribute: <literal>%c{N}</literal>.
684 If the number is followed by the <literal>+</literal> character, this part plus all remaining parts
685 of the result string are substituted: <literal>%c{N+}</literal>.</para>
686 </listitem>
687 </varlistentry>
688
689 <varlistentry>
690 <term><option>$parent</option>, <option>%P</option></term>
691 <listitem>
692 <para>The node name of the parent device.</para>
693 </listitem>
694 </varlistentry>
695
696 <varlistentry>
697 <term><option>$name</option></term>
698 <listitem>
699 <para>The current name of the device. If not changed by a rule, it is the
700 name of the kernel device.</para>
701 </listitem>
702 </varlistentry>
703
704 <varlistentry>
705 <term><option>$links</option></term>
706 <listitem>
707 <para>A space-separated list of the current symlinks. The value is
708 only set during a remove event or if an earlier rule assigned a value.</para>
709 </listitem>
710 </varlistentry>
711
712 <varlistentry>
713 <term><option>$root</option>, <option>%r</option></term>
714 <listitem>
715 <para>The udev_root value.</para>
716 </listitem>
717 </varlistentry>
718
719 <varlistentry>
720 <term><option>$sys</option>, <option>%S</option></term>
721 <listitem>
722 <para>The sysfs mount point.</para>
723 </listitem>
724 </varlistentry>
725
726 <varlistentry>
727 <term><option>$devnode</option>, <option>%N</option></term>
728 <listitem>
729 <para>The name of the device node.</para>
730 </listitem>
731 </varlistentry>
732
733 <varlistentry>
734 <term><option>%%</option></term>
735 <listitem>
736 <para>The <literal>%</literal> character itself.</para>
737 </listitem>
738 </varlistentry>
739
740 <varlistentry>
741 <term><option>$$</option></term>
742 <listitem>
743 <para>The <literal>$</literal> character itself.</para>
744 </listitem>
745 </varlistentry>
746 </variablelist>
747 </refsect1>
748
749 <refsect1>
750 <title>See Also</title>
751 <para>
752 <citerefentry>
753 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
754 </citerefentry>,
755 <citerefentry>
756 <refentrytitle>udevadm</refentrytitle><manvolnum>8</manvolnum>
757 </citerefentry>,
758 <citerefentry>
759 <refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum>
760 </citerefentry>
761 </para>
762 </refsect1>
763 </refentry>