Migrate hotplug plugin to a conditional system/hotplug.conf file

This is the first example of the just minted advanced stanza syntax with
if-statements, conflict handling, and nowarn flags.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-02-28 00:49:55 +01:00
parent 84ddac65e5
commit 7af257cccf
4 changed files with 20 additions and 121 deletions
+4
View File
@@ -1,6 +1,10 @@
systemdir = $(system_path)
dist_system_DATA =
if BUILD_HOTPLUG_PLUGIN
dist_system_DATA += hotplug.conf
endif
if BUILD_TESTSERV_PLUGIN
dist_system_DATA += testserv.conf
endif
+16
View File
@@ -0,0 +1,16 @@
# System hotplug can be handled by udev or mdev
# Either we have systemd-udevd or eudev, on the rare occasion we find
# both, we opt for the latter. Remember, you can override this by a
# custom hotplug.conf in /etc/finit.d/ or /etc/finit.d/enabled/.
service nowarn [S12345789] cgroup.system name:udevd pid:udevd log /lib/systemd/systemd-udevd -- Device event managing daemon
service nowarn [S12345789] cgroup.system name:udevd pid:udevd log udevd -- Device event managing daemon
# Wait for udevd to start, then wait a couple of seconds for it to become ready
run if:udevd cgroup.init [S] <pid/udevd> sleep 2 --
run if:udevd cgroup.init :1 [S] <pid/udevd> log udevadm trigger -c add -t devices -- Requesting device events
run if:udevd cgroup.init :2 [S] <pid/udevd> log udevadm trigger -c add -t subsystems -- Requesting subsystem events
task if:udevd [S] <pid/udevd> /lib/udev/udev-finish -- Finalizing udev
# If udevd is not available, try mdev
run conflict:udevd [S] mdev -s -- Populating device tree