patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH v6 0/2] Switch from mdevd to systemd-udevd in root filesystem
@ 2025-11-07 19:00 Demi Marie Obenour
  2025-11-07 19:00 ` [PATCH v6 1/2] tools: Add adapter tool for services using sd_notify Demi Marie Obenour
  2025-11-07 19:00 ` [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd Demi Marie Obenour
  0 siblings, 2 replies; 19+ messages in thread
From: Demi Marie Obenour @ 2025-11-07 19:00 UTC (permalink / raw)
  To: Spectrum OS Development; +Cc: Demi Marie Obenour, Alyssa Ross

systemd-udevd provides support for significantly more hardware than
mdevd does.  Therefore, switch to it.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
Changes in v6:
- Avoid using GOTO and LABEL in udev rules.

Changes in v5:
- Use -D_GNU_SOURCE in build system instead of #define _GNU_SOURCE 1 in
  C files.
- Do not check for EAGAIN or EWOULDBLOCK after poll() has reported FD as
  ready.
- Do not use MSG_NONBLOCK.
- Use static variable for iovec.
- Network hotplug script is safe to call more than once, so do not check
  for it having already been called.
- Do not try to prevent /run/user from being created with wrong mode
  when it is known to already exist.
- Fix copyright texts.
- Link to v4: https://spectrum-os.org/lists/archives/spectrum-devel/20251003-udev-v4-0-7d7344b14d11@gmail.com

Changes in v4:
- Use 'udevadm trigger --action=add' at coldplug time.
- Ensure that the wrapper does not exit after the first message.
- Include the hardware database.
- sd-notify-adapter should not exit if it receives a message without
  READY=1.
- Link to v3: https://spectrum-os.org/lists/archives/spectrum-devel/20250928-udev-v3-0-bb0e9612c415@gmail.com

Changes in v3:
- Try to avoid net-add running twice.
- Use full systemd instead of systemdMinimal, as something else already
  pulls it into the image.
- Hopefully fix integration tests.
- Link to v2: https://spectrum-os.org/lists/archives/spectrum-devel/20250924-udev-v2-2-6089de521b3b@gmail.com

Changes in v2:
- Use more optional arguments instead of positional parameters in
  sd-notify-wrapper.
- Explain why explicit modprobe is needed.
- Link to v1: https://spectrum-os.org/lists/archives/spectrum-devel/20250913-udev-v1-0-eade4ab8f2b4@gmail.com

---
Demi Marie Obenour (2):
      tools: Add adapter tool for services using sd_notify
      host/rootfs: Switch to systemd-udevd

 host/rootfs/Makefile                               |   2 +-
 host/rootfs/default.nix                            | 118 ++++++++-------------
 host/rootfs/file-list.mk                           |  33 +++---
 host/rootfs/image/etc/mdev.conf                    |   7 --
 host/rootfs/image/etc/mdev/listen                  |  11 --
 host/rootfs/image/etc/mdev/wait                    |  14 ---
 host/rootfs/image/etc/s6-rc/card0/type.license     |   2 -
 host/rootfs/image/etc/s6-rc/card0/up               |   4 -
 host/rootfs/image/etc/s6-rc/kvm/timeout-up         |   1 -
 host/rootfs/image/etc/s6-rc/kvm/timeout-up.license |   2 -
 host/rootfs/image/etc/s6-rc/kvm/type               |   1 -
 host/rootfs/image/etc/s6-rc/kvm/type.license       |   2 -
 host/rootfs/image/etc/s6-rc/kvm/up                 |   4 -
 host/rootfs/image/etc/s6-rc/mdevd-coldplug/type    |   1 -
 host/rootfs/image/etc/s6-rc/mdevd-coldplug/up      |   4 -
 .../image/etc/s6-rc/mdevd/notification-fd.license  |   2 -
 host/rootfs/image/etc/s6-rc/mdevd/run              |   5 -
 .../contents.d/systemd-udevd-coldplug}             |   0
 .../dependencies.d/systemd-udevd}                  |   0
 .../s6-rc/{card0 => systemd-udevd-coldplug}/type   |   0
 .../type.license                                   |   0
 .../image/etc/s6-rc/systemd-udevd-coldplug/up      |   3 +
 .../s6-rc/{mdevd => systemd-udevd}/notification-fd |   0
 .../s6-rc/systemd-udevd/notification-fd.license    |   2 +
 host/rootfs/image/etc/s6-rc/systemd-udevd/run      |  14 +++
 .../image/etc/s6-rc/{mdevd => systemd-udevd}/type  |   0
 .../s6-rc/{mdevd => systemd-udevd}/type.license    |   0
 .../contents.d/systemd-udevd-coldplug}             |   0
 .../contents.d/systemd-udevd-coldplug}             |   0
 .../weston/dependencies.d/systemd-udevd-coldplug   |   0
 host/rootfs/image/etc/s6-rc/weston/run             |   6 +-
 .../image/etc/udev/rules.d/99-spectrum.rules       |   5 +
 host/rootfs/image/usr/bin/run-vmm                  |   1 +
 host/rootfs/image/usr/bin/systemd-udevd            |   1 +
 .../{etc/mdev/net/add => usr/libexec/net-add}      |   0
 tools/default.nix                                  |   1 +
 tools/meson.build                                  |   1 +
 tools/sd-notify-adapter/meson.build                |   4 +
 tools/sd-notify-adapter/sd-notify-adapter.c        | 107 +++++++++++++++++++
 39 files changed, 199 insertions(+), 159 deletions(-)
---
base-commit: 22e216712322cdfb85094bbd27ff34c4366fad41
change-id: 20250911-udev-24cf4bf68fbe

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)


^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH v6 0/2] Switch from mdevd to systemd-udevd in root filesystem
@ 2025-11-03  8:29 Demi Marie Obenour
  2025-11-03  8:29 ` [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd Demi Marie Obenour
  0 siblings, 1 reply; 19+ messages in thread
From: Demi Marie Obenour @ 2025-11-03  8:29 UTC (permalink / raw)
  To: Spectrum OS Development; +Cc: Demi Marie Obenour, Alyssa Ross

systemd-udevd provides support for significantly more hardware than
mdevd does.  Therefore, switch to it.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
Changes in v5:
- Use -D_GNU_SOURCE in build system instead of #define _GNU_SOURCE 1 in
  C files.
- Do not check for EAGAIN or EWOULDBLOCK after poll() has reported FD as
  ready.
- Do not use MSG_NONBLOCK.
- Use static variable for iovec.
- Network hotplug script is safe to call more than once, so do not check
  for it having already been called.
- Do not try to prevent /run/user from being created with wrong mode
  when it is known to already exist.
- Fix copyright texts.
- Link to v4: https://spectrum-os.org/lists/archives/spectrum-devel/20251003-udev-v4-0-7d7344b14d11@gmail.com

Changes in v4:
- Use 'udevadm trigger --action=add' at coldplug time.
- Ensure that the wrapper does not exit after the first message.
- Include the hardware database.
- sd-notify-adapter should not exit if it receives a message without
  READY=1.
- Link to v3: https://spectrum-os.org/lists/archives/spectrum-devel/20250928-udev-v3-0-bb0e9612c415@gmail.com

Changes in v3:
- Try to avoid net-add running twice.
- Use full systemd instead of systemdMinimal, as something else already
  pulls it into the image.
- Hopefully fix integration tests.
- Link to v2: https://spectrum-os.org/lists/archives/spectrum-devel/20250924-udev-v2-2-6089de521b3b@gmail.com

Changes in v2:
- Use more optional arguments instead of positional parameters in
  sd-notify-wrapper.
- Explain why explicit modprobe is needed.
- Link to v1: https://spectrum-os.org/lists/archives/spectrum-devel/20250913-udev-v1-0-eade4ab8f2b4@gmail.com

---
Demi Marie Obenour (2):
      tools: Add adapter tool for services using sd_notify
      host/rootfs: Switch to systemd-udevd

 host/rootfs/Makefile                               |   2 +-
 host/rootfs/default.nix                            | 118 ++++++++-------------
 host/rootfs/file-list.mk                           |  33 +++---
 host/rootfs/image/etc/mdev.conf                    |   7 --
 host/rootfs/image/etc/mdev/listen                  |  11 --
 host/rootfs/image/etc/mdev/wait                    |  14 ---
 host/rootfs/image/etc/s6-rc/card0/type.license     |   2 -
 host/rootfs/image/etc/s6-rc/card0/up               |   4 -
 host/rootfs/image/etc/s6-rc/kvm/timeout-up         |   1 -
 host/rootfs/image/etc/s6-rc/kvm/timeout-up.license |   2 -
 host/rootfs/image/etc/s6-rc/kvm/type               |   1 -
 host/rootfs/image/etc/s6-rc/kvm/type.license       |   2 -
 host/rootfs/image/etc/s6-rc/kvm/up                 |   4 -
 host/rootfs/image/etc/s6-rc/mdevd-coldplug/type    |   1 -
 host/rootfs/image/etc/s6-rc/mdevd-coldplug/up      |   4 -
 .../image/etc/s6-rc/mdevd/notification-fd.license  |   2 -
 host/rootfs/image/etc/s6-rc/mdevd/run              |   5 -
 .../contents.d/systemd-udevd-coldplug}             |   0
 .../dependencies.d/systemd-udevd}                  |   0
 .../s6-rc/{card0 => systemd-udevd-coldplug}/type   |   0
 .../type.license                                   |   0
 .../image/etc/s6-rc/systemd-udevd-coldplug/up      |   3 +
 .../s6-rc/{mdevd => systemd-udevd}/notification-fd |   0
 .../s6-rc/systemd-udevd/notification-fd.license    |   2 +
 host/rootfs/image/etc/s6-rc/systemd-udevd/run      |  14 +++
 .../image/etc/s6-rc/{mdevd => systemd-udevd}/type  |   0
 .../s6-rc/{mdevd => systemd-udevd}/type.license    |   0
 .../contents.d/systemd-udevd-coldplug}             |   0
 .../contents.d/systemd-udevd-coldplug}             |   0
 .../weston/dependencies.d/systemd-udevd-coldplug   |   0
 host/rootfs/image/etc/s6-rc/weston/run             |   6 +-
 .../image/etc/udev/rules.d/99-spectrum.rules       |   9 ++
 host/rootfs/image/usr/bin/run-vmm                  |   1 +
 host/rootfs/image/usr/bin/systemd-udevd            |   1 +
 .../{etc/mdev/net/add => usr/libexec/net-add}      |   0
 tools/default.nix                                  |   1 +
 tools/meson.build                                  |   1 +
 tools/sd-notify-adapter/meson.build                |   4 +
 tools/sd-notify-adapter/sd-notify-adapter.c        | 107 +++++++++++++++++++
 39 files changed, 203 insertions(+), 159 deletions(-)
---
base-commit: 1d666582892fbdf812662b4490caf7821078eaf9
change-id: 20250911-udev-24cf4bf68fbe

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-11-09 13:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 1/2] tools: Add adapter tool for services using sd_notify Demi Marie Obenour
2025-11-09 13:58   ` Alyssa Ross
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
  -- strict thread matches above, loose matches on Subject: below --
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 2/2] host/rootfs: Switch to systemd-udevd Demi Marie Obenour
2025-11-06  9:55   ` Alyssa Ross

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).