From: Alyssa Ross <hi@alyssa.is>
To: Demi Marie Obenour <demiobenour@gmail.com>
Cc: Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd
Date: Thu, 06 Nov 2025 10:55:23 +0100 [thread overview]
Message-ID: <87seerxz78.fsf@alyssa.is> (raw)
In-Reply-To: <20251103-udev-v6-2-704649b85d6d@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1922 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2025-11-06 9:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 8:29 [PATCH v6 0/2] Switch from mdevd to systemd-udevd in root filesystem Demi Marie Obenour
2025-11-03 8:29 ` [PATCH v6 1/2] tools: Add adapter tool for services using sd_notify Demi Marie Obenour
2025-11-03 8:33 ` Demi Marie Obenour
2025-11-06 9:41 ` Alyssa Ross
2025-11-06 9:49 ` Alyssa Ross
2025-11-03 8:29 ` [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd Demi Marie Obenour
2025-11-06 9:55 ` Alyssa Ross [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-11-07 19:00 [PATCH v6 0/2] Switch from mdevd to systemd-udevd in root filesystem Demi Marie Obenour
2025-11-07 19:00 ` [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd Demi Marie Obenour
2025-11-08 19:49 ` Alyssa Ross
2025-11-08 21:28 ` Demi Marie Obenour
2025-11-08 21:37 ` Alyssa Ross
2025-11-08 22:14 ` Alyssa Ross
2025-11-08 22:18 ` Demi Marie Obenour
2025-11-08 22:37 ` Alyssa Ross
2025-11-08 22:37 ` Demi Marie Obenour
2025-11-08 22:52 ` Alyssa Ross
2025-11-08 23:32 ` Demi Marie Obenour
2025-11-09 4:18 ` Demi Marie Obenour
2025-11-09 13:07 ` Alyssa Ross
2025-11-09 2:18 ` Demi Marie Obenour
2025-11-09 13:58 ` Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87seerxz78.fsf@alyssa.is \
--to=hi@alyssa.is \
--cc=demiobenour@gmail.com \
--cc=devel@spectrum-os.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).