udevadm: trigger: implement --initialized-match/nomatch arguments
authorDanilo Krummrich <danilo.krummrich@bmw.de>
Mon, 14 Jun 2021 15:46:00 +0000 (17:46 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 22 Mar 2022 06:54:10 +0000 (15:54 +0900)
commit678f2b16676cd566c50bdec78350f732a9a3ee41
tree9ccea2693aa03b61766f8597f2a459a701d34d2f
parentd8b50e5df7e01983279e70c6d970fb60d053df97
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.
man/udevadm.xml
shell-completion/bash/udevadm
shell-completion/zsh/_udevadm
src/udev/udevadm-trigger.c