|
48 | 48 | <cmdsynopsis> |
49 | 49 | <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command> |
50 | 50 | </cmdsynopsis> |
| 51 | + <cmdsynopsis> |
| 52 | + <command>udevadm wait <optional>options</optional> <replaceable>device|syspath</replaceable></command> |
| 53 | + </cmdsynopsis> |
51 | 54 | </refsynopsisdiv> |
52 | 55 |
|
53 | 56 | <refsect1><title>Description</title> |
|
405 | 408 | <para>When <option>--initialized-nomatch</option> is specified, trigger events for devices |
406 | 409 | that are not initialized by <command>systemd-udevd</command> yet, and skip devices that |
407 | 410 | are already initialized.</para> |
408 | | - <para>Here, initialized devices are those for which at least one udev rule already |
409 | | - completed execution – for any action but <literal>remove</literal> — that set a property |
410 | | - or other device setting (and thus has an entry in the udev device database). Devices are |
411 | | - no longer considered initialized if a <literal>remove</literal> action is seen for them |
412 | | - (which removes their entry in the udev device database). Note that devices that have no |
413 | | - udev rules are never considered initialized, but might still be announced via the sd-device |
414 | | - API (or similar). Typically, it is thus essential that applications which intend to use |
415 | | - such a match, make sure a suitable udev rule is installed that sets at least one property |
416 | | - on devices that shall be matched.</para> |
| 411 | + <para>Typically, it is essential that applications which intend to use such a match, make |
| 412 | + sure a suitable udev rule is installed that sets at least one property on devices that |
| 413 | + shall be matched. See also Initialized Devices section below for more details.</para> |
417 | 414 | <para>WARNING: <option>--initialized-nomatch</option> can potentially save a significant |
418 | 415 | amount of time compared to re-triggering all devices in the system and e.g. can be used to |
419 | 416 | optimize boot time. However, this is not safe to be used in a boot sequence in general. |
|
694 | 691 | <xi:include href="standard-options.xml" xpointer="help" /> |
695 | 692 | </variablelist> |
696 | 693 | </refsect2> |
| 694 | + |
| 695 | + <refsect2> |
| 696 | + <title>udevadm wait |
| 697 | + <arg choice="opt"><replaceable>options</replaceable></arg> |
| 698 | + <arg choice="opt"><replaceable>device|syspath</replaceable></arg> |
| 699 | + … |
| 700 | + </title> |
| 701 | + |
| 702 | + <para>Wait for devices or device symlinks being created and initialized by |
| 703 | + <command>systemd-udevd</command>. Each device path must start with |
| 704 | + <literal>/dev/</literal> or <literal>/sys/</literal>, e.g. <literal>/dev/sda</literal>, |
| 705 | + <literal>/dev/disk/by-path/pci-0000:3c:00.0-nvme-1-part1</literal>, |
| 706 | + <literal>/sys/devices/pci0000:00/0000:00:1f.6/net/eth0</literal>, or |
| 707 | + <literal>/sys/class/net/eth0</literal>. This can take multiple devices. This may be useful for |
| 708 | + waiting for devices being processed by <command>systemd-udevd</command> after e.g. partitioning |
| 709 | + or formatting the devices.</para> |
| 710 | + |
| 711 | + <variablelist> |
| 712 | + <varlistentry> |
| 713 | + <term><option>-t</option></term> |
| 714 | + <term><option>--timeout=<replaceable>SECONDS</replaceable></option></term> |
| 715 | + <listitem> |
| 716 | + <para>Maximum number of seconds to wait for the specified devices or device symlinks being |
| 717 | + created, initialized, or removed. The default value is <literal>infinity</literal>.</para> |
| 718 | + </listitem> |
| 719 | + </varlistentry> |
| 720 | + |
| 721 | + <varlistentry> |
| 722 | + <term><option>--initialized=<replaceable>BOOL</replaceable></option></term> |
| 723 | + <listitem> |
| 724 | + <para>Check if <command>systemd-udevd</command> initialized devices. Defaults to true. When |
| 725 | + false, the command only checks if the specified devices exist. Set false to this setting if |
| 726 | + there is no udev rules for the specified devices, as the devices will never be considered |
| 727 | + as initialized in that case. See Initialized Devices section below for more details.</para> |
| 728 | + </listitem> |
| 729 | + </varlistentry> |
| 730 | + |
| 731 | + <varlistentry> |
| 732 | + <term><option>--removed</option></term> |
| 733 | + <listitem> |
| 734 | + <para>When specified, the command wait for devices being removed instead of created or |
| 735 | + initialized. If this is specified, <option>--initialized=</option> will be ignored.</para> |
| 736 | + </listitem> |
| 737 | + </varlistentry> |
| 738 | + |
| 739 | + <varlistentry> |
| 740 | + <term><option>--settle</option></term> |
| 741 | + <listitem> |
| 742 | + <para>When specified, also watches the udev event queue, and wait for all queued events |
| 743 | + being processed by <command>systemd-udevd</command>.</para> |
| 744 | + </listitem> |
| 745 | + </varlistentry> |
| 746 | + |
| 747 | + <xi:include href="standard-options.xml" xpointer="help" /> |
| 748 | + </variablelist> |
| 749 | + </refsect2> |
| 750 | + </refsect1> |
| 751 | + |
| 752 | + <refsect1> |
| 753 | + <title>Initialized Devices</title> |
| 754 | + |
| 755 | + <para>Initialized devices are those for which at least one udev rule already completed execution |
| 756 | + – for any action but <literal>remove</literal> — that set a property or other device setting (and |
| 757 | + thus has an entry in the udev device database). Devices are no longer considered initialized if a |
| 758 | + <literal>remove</literal> action is seen for them (which removes their entry in the udev device |
| 759 | + database). Note that devices that have no udev rules are never considered initialized, but might |
| 760 | + still be announced via the sd-device API (or similar).</para> |
697 | 761 | </refsect1> |
698 | 762 |
|
699 | 763 | <refsect1> |
|
0 commit comments