On 9/25/25 06:53, Alyssa Ross wrote: > Demi Marie Obenour writes: > >> This replaces the mdevd uevent daemon with systemd-udevd, which supports >> much more hardware and is therefore to be preferred for a full desktop >> environment. Various Wayland compositors integrate with systemd-udevd, >> allowing them to discover devices as they appear rather than having to >> only use devices plugged in when the compositor is started. >> Additionally, systemd-udevd has quirks for various devices that are >> needed to support the wide variety of hardware end-users have. >> >> The dependency on /dev/dri/card0 being present is eliminated, and >> whatever devices the user has are now picked up by the compositor. New >> dependencies are added to ensure that udev coldplug has finished before >> any non-trivial services are started. systemd-udev-trigger.service runs >> 'udevadm trigger' and has Before=sysinit.target, so anything that is not >> an early boot service can assume 'udevadm trigger' has run. >> >> systemd-udevd doesn't set PATH to anything useful, presumably because >> under NixOS this is handled some other way. Therefore, explicitly set >> it to /usr/bin in the scripts systemd-udevd calls. >> >> The /etc/mdev/listen and /etc/mdev/wait scripts are replaced by >> 'udevadm wait', so they are deleted. The whole static-nodes target also >> goes away, as Linux handles that itself and systemd-udevd deals with >> autoloading. > > Not quite right. Linux does not create static nodes. Userspace has to. > That's why we had a service for it. (It sucks.) > >> diff --git a/host/rootfs/image/etc/s6-rc/kvm/up b/host/rootfs/image/etc/s6-rc/kvm/up >> index c02e3f90245e005b98b4de8245a1863fb49c1158..a8436de58580f2a2a6f42bb69418a319f967df47 100644 >> --- a/host/rootfs/image/etc/s6-rc/kvm/up >> +++ b/host/rootfs/image/etc/s6-rc/kvm/up >> @@ -1,4 +1,3 @@ >> # SPDX-License-Identifier: EUPL-1.2+ >> -# SPDX-FileCopyrightText: 2023 Alyssa Ross >> - >> -/etc/mdev/wait kvm >> +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour >> +udevadm wait /dev/kvm > > Any reason now not to just inline this into the services that need to wait? Avoiding redundant calls I guess? I'm not sure how expensive 'udevadm wait' is. >> 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..2501680b69eb0060b651146dffb6b3a99640c6fb >> --- /dev/null >> +++ b/host/rootfs/image/etc/s6-rc/systemd-udevd/run >> @@ -0,0 +1,11 @@ >> +#!/bin/execlineb -P >> +# SPDX-License-Identifier: EUPL-1.2+ >> +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour >> +if { rm -f /run/sd-notify-wrapper/systemd-udevd } >> +background { >> + s6-ipcserver-socketbinder -b0 -m -a 0600 /run/sd-notify-wrapper/systemd-udevd >> + fdmove 1 3 >> + sd-notify-adapter >> +} >> +export NOTIFY_SOCKET /run/sd-notify-wrapper/systemd-udevd >> +exec -a systemd-udevd udevadm > > How does systemd expect this to normally work? /usr/lib/systemd/systemd-udevd is a symlink to ../../bin/udevadm >> diff --git a/host/rootfs/image/etc/s6-rc/vm-env/contents b/host/rootfs/image/etc/s6-rc/vm-env/contents >> index 580795b1b02bb7a8dff7f872723c678141d4bb70..ed8b5c410adfc17f5bbc33932ac79d97bd7b3115 100644 >> --- a/host/rootfs/image/etc/s6-rc/vm-env/contents >> +++ b/host/rootfs/image/etc/s6-rc/vm-env/contents >> @@ -2,4 +2,5 @@ >> # SPDX-FileCopyrightText: 2021 Alyssa Ross >> # >> static-nodes >> +systemd-udevd-coldplug >> weston > > Shouldn't static-nodes be removed here as well, and the static-nodes > files deleted? Nope. systemd-udevd doesn't create them. However, one can use kmod and systemd-tmpfiles to do that. systemd-tmpfiles actually has no dependency on PID 1 *at all*, so we can use it as much as we want. >> 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..ca91367529f39eebe009cc8acef782cf6a4516c1 >> --- /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 >> + >> +# systemd-udevd has a built-in module loading feature, >> +# but it seems to not work for some reason or another. >> +# This works. >> +ACTION!="remove", ENV{MODALIAS}!="", RUN+="/usr/bin/modprobe -q $env{MODALIAS}" >> +# systemd-udevd unsets PATH, so fix that. >> +ACTION!="remove", ENV{PCI_CLASS}=="2????", RUN+="/usr/bin/env PATH=/usr/bin /usr/libexec/net-add" > > This is such a weird behavior. Do we know why it does that? I don't at least. >> diff --git a/host/rootfs/image/usr/bin/vm-start b/host/rootfs/image/usr/bin/vm-start >> index 67480e5215d8a8260ce3f03c67f71ba8f210c291..9725ef5ec549ff191606282a7b0ae56838f53f03 100755 >> --- a/host/rootfs/image/usr/bin/vm-start >> +++ b/host/rootfs/image/usr/bin/vm-start >> @@ -2,7 +2,7 @@ >> # SPDX-License-Identifier: EUPL-1.2+ >> # SPDX-FileCopyrightText: 2022-2023, 2025 Alyssa Ross >> >> -foreground { s6-rc -bu change vm-env } >> +foreground { s6-rc -bu change weston } >> >> foreground { >> redirfd -w 2 /dev/null > > Why? Will revert. -- Sincerely, Demi Marie Obenour (she/her/hers)