]> git.ipfire.org Git - thirdparty/systemd.git/commit
udevadm: allow trigger command to be synchronous
authorMao <littlecvr@gmail.com>
Thu, 1 Feb 2018 09:33:13 +0000 (17:33 +0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 9 Feb 2018 10:59:03 +0000 (11:59 +0100)
commit792cc203a67edb201073351f5c766fce3d5eab45
tree4e3050518771ab7139574032b196bfea5f1b8843
parent302af1c250c2c64f608187ab1efb8e4f1f442951
udevadm: allow trigger command to be synchronous

There are cases that we want to trigger and settle only specific
commands. For example, let's say at boot time we want to make sure all
the graphics devices are working correctly because it's critical for
booting, but not the USB subsystem (we'll trigger USB events later). So
we do:

  udevadm trigger --action="add" --subsystem-match="graphics"
  udevadm settle

However, we cannot block the kernel from emitting kernel events from
discovering USB devices. So if any of the USB kernel event was emitted
before the settle command, the settle command would still wait for the
entire queue to complete. And if the USB event takes a long time to be
processed, the system slows down.

The new `settle` option allows the `trigger` command to wait for only
the triggered events, and effectively solves this problem.
man/udevadm.xml
src/udev/udevadm-trigger.c