diff options
author | Danilo Krummrich <danilo.krummrich@bmw.de> | 2021-06-14 17:46:00 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-22 15:54:10 +0900 |
commit | 678f2b16676cd566c50bdec78350f732a9a3ee41 (patch) | |
tree | 9ccea2693aa03b61766f8597f2a459a701d34d2f /man/udevadm.xml | |
parent | d8b50e5df7e01983279e70c6d970fb60d053df97 (diff) | |
download | systemd-678f2b16676cd566c50bdec78350f732a9a3ee41.tar.gz |
udevadm: trigger: implement --initialized-match/nomatch arguments
systemd-udev-trigger.service by default triggeres all devices regardless
of whether they were already recognized by systemd-udevd.
There are machines (especially in embedded environments) where
systemd-udev-trigger.service is configured to run at a later stage of
the boot sequence, which can lead to quite a lot of devices being
triggered although they were already recognized by systemd-udevd.
Re-triggering a lot of devices is a relatively expensive operation and
therefore should be avoided if unnecessary.
Therefore this patch introduces --initialized-nomatch, which filters out
devices that are already present in the udev database. For consistance
reasons --initialized-match is implemented as well, which filters out devices
that are *not* already present in the udev database.
Replaces #19949.
Diffstat (limited to 'man/udevadm.xml')
-rw-r--r-- | man/udevadm.xml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/man/udevadm.xml b/man/udevadm.xml index 24ed4a29c7..af48571122 100644 --- a/man/udevadm.xml +++ b/man/udevadm.xml @@ -396,6 +396,35 @@ </listitem> </varlistentry> <varlistentry> + <term><option>--initialized-match</option></term> + <term><option>--initialized-nomatch</option></term> + <listitem> + <para>When <option>--initialized-match</option> is specified, trigger events for devices + that are already initialized by <command>systemd-udevd</command>, and skip devices that + are not initialized yet.</para> + <para>When <option>--initialized-nomatch</option> is specified, trigger events for devices + that are not initialized by <command>systemd-udevd</command> yet, and skip devices that + are already initialized.</para> + <para>Here, initialized devices are those for which at least one udev rule already + completed execution – for any action but <literal>remove</literal> — that set a property + or other device setting (and thus has an entry in the udev device database). Devices are + no longer considered initialized if a <literal>remove</literal> action is seen for them + (which removes their entry in the udev device database). Note that devices that have no + udev rules are never considered initialized, but might still be announced via the sd-device + API (or similar). Typically, it is thus essential that applications which intend to use + such a match, make sure a suitable udev rule is installed that sets at least one property + on devices that shall be matched.</para> + <para>WARNING: <option>--initialized-nomatch</option> can potentially save a significant + amount of time compared to re-triggering all devices in the system and e.g. can be used to + optimize boot time. However, this is not safe to be used in a boot sequence in general. + Especially, when udev rules for a device depend on its parent devices (e.g. + <literal>ATTRS</literal> or <literal>IMPORT{parent}</literal> keys, see + <citerefentry><refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for more details), the final state of the device becomes easily unstable with this option. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><option>-w</option></term> <term><option>--settle</option></term> <listitem> |