Demi Marie Obenour <demiobenour@gmail.com> writes:
diff --git a/host/rootfs/image/etc/s6-rc/systemd-udevd/run b/host/rootfs/image/etc/s6-rc/systemd-udevd/run new file mode 100644 index 0000000000000000000000000000000000000000..a3b74cffe5af191d099ce9314b29669652762092 --- /dev/null +++ b/host/rootfs/image/etc/s6-rc/systemd-udevd/run @@ -0,0 +1,14 @@ +#!/bin/execlineb -P +# SPDX-License-Identifier: EUPL-1.2+ +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com> +s6-setlock /run/sd-notify-wrapper/systemd-udevd.lock +# Save stdin to restore it later.
Stray comment.
+s6-ipcserver-socketbinder -b0 -m -a 0600 /run/sd-notify-wrapper/systemd-udevd.sock +background { + fdmove 1 3 + sd-notify-adapter +} +fdclose 3 +redirfd -r 0 /dev/null +export NOTIFY_SOCKET /run/sd-notify-wrapper/systemd-udevd.sock +systemd-udevd
diff --git a/host/rootfs/image/etc/udev/rules.d/99-spectrum.rules b/host/rootfs/image/etc/udev/rules.d/99-spectrum.rules new file mode 100644 index 0000000000000000000000000000000000000000..6facab361e82fa48e8e018b69b611693b0a277d0 --- /dev/null +++ b/host/rootfs/image/etc/udev/rules.d/99-spectrum.rules @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: EUPL-1.2+ +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com> + +ACTION=="remove", GOTO="spectrum-end" +ENV{PCI_CLASS}!="2????", GOTO="spectrum-end" + +# systemd-udevd unsets PATH, so fix that. +RUN+="/usr/bin/env PATH=/usr/bin /usr/libexec/net-add" +LABEL="spectrum-end"
Would it not be easier to follow without the gotos, where we just have a single rule that runs net-add when ACTION isn't remove and PCI_CLASS is as expected? This structure wouldn't hold up when we handle letting the VMM know if a device has been removed, because it would have to go after "spectrum-end", and same if we wanted to handle other types of devices.