From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 05F623B18; Sun, 14 Sep 2025 03:19:11 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 900123A85; Sun, 14 Sep 2025 03:19:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by atuin.qyliss.net (Postfix) with ESMTPS id 75E6339CB for ; Sun, 14 Sep 2025 03:19:05 +0000 (UTC) Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e951dfcbc5bso2774884276.3 for ; Sat, 13 Sep 2025 20:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757819944; x=1758424744; darn=spectrum-os.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=O4opAne7uhYXJuhJVSSc/YxY79bBqQzhnHI7fchMhG8=; b=JdzyPHnX7jGg5nOsCrPwCbfm+BdfkxbMqdgmX4DXA/8PqLIJeWNZD1b1vS1uaYbnJM C7xCfycH7TneEBCUP1wKufAEZlYJ2S5pVqIdML9aJgGZUA2OzngDXuKVejC9TTxZrf0K OIjJgHEmHT2fUm9YdtDUwKGAnJhGSBgDAGJRzZX+9MREC4daf52Ll4w/GiBzblVI4isV C0xD8ScS061wWiaQy7wfenO0/GR1v/9dtkryv4KesX8uKOiZNaFTm06LSOQF1H3zzomY WsEbNiwzUj12lI/AhKRe5UD11kaH0yt3Ov3dlOg5wqYaW1Afyeftzj+B0fsADtsWHGk9 p2Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757819944; x=1758424744; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O4opAne7uhYXJuhJVSSc/YxY79bBqQzhnHI7fchMhG8=; b=UwdDPHBTze73mcEnWz661Zv26/+RdQHYYzKv4AUm4+qi9M5R0hX6MEpk5KzAWS2xe/ UrSTmOM8C97UF38wQRN20jWT3keFd5/hhCLSg3BmHl7SDTTrx/JGSsh8vDm1u85IBux4 6FBec6/kDtKVFuYp7BCJKdIQjTK5qLwOPyHHzGqCofb9iL9Z8jvjM/SBIC0AuMbyPVbL S5at8MrYiH2fg/fFUKAh7qUMQ9XNEMRXsOI5CQUJXdFWYGg6E4aPFa4/VKXeufB74sWr FIMM4nJ00JdCl8FOrM7S2702DMdoUVQjgxIIx+0wEXftEgZP3og86ijJRKn9XayMLu6w R4QA== X-Gm-Message-State: AOJu0Yy6/jWBlZLVabU5NJiy91RpTOvKs58nx0jaKOcFlRZlgFC5UaIj 62L7qllbdQlVYMzI3r5/7zi1lUwW4hZ1x8ek/hNCJm6KOPYjc9yAte+w3qryX+jF X-Gm-Gg: ASbGnctl3xEwteMacpKZV0v8b3NCmcXNJGX9T+wY1RX8rObjakPJz0qOyDeW2XAGK9t OHg5xHp4L/9aaM1c3ru7Z2hNnS9J2Okc9gS5Ko8WRUOocvARraMe2uB9MHDg+vVfHJf4JEZS4q4 FL1+eMiBXdIYeDn+HvB4fheYrewmJfw4/a+V6ywTqoNQYok5Cb6v16XsO9hBrPqjnVgC8ztII27 Grd5OliTzhJEY7YJCtuzh1Wt/s0OnIIWPSqcizh3ywtkeaPryq6CAIjitQ6esIxaEXklwZMNMtQ j899hkX9AMWJvqWgDPv05/VRrgrDOhSo1wnLk614eR0yKAd2HKR66m8soxfyOPBLt/tnIOL7hhx /1/SiqmZExSooQ0F2KWUrQxjD9OlCGlrBjwgrI/o7IeRmthOW1XhQBNp8Wj9H9AbiryvOmv1HhW a7LpQwxzAwxwtUytEHckGxqJk9wxPMbNaK2CjnE8Ww6kA= X-Google-Smtp-Source: AGHT+IHDOz29Jpg3l/eAJugffvnMgQMO02ak+udDVPOo5We/FQJNivg75+/dKgzWRSR+IBBlx9i7uQ== X-Received: by 2002:a05:690c:fca:b0:724:72f0:50cb with SMTP id 00721157ae682-730631912d3mr79766067b3.1.1757819944088; Sat, 13 Sep 2025 20:19:04 -0700 (PDT) Received: from localhost.localdomain (h96-60-249-169.cncrtn.broadband.dynamic.tds.net. [96.60.249.169]) by smtp.gmail.com with UTF8SMTPSA id 00721157ae682-72f79794201sm22324437b3.62.2025.09.13.20.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Sep 2025 20:19:03 -0700 (PDT) From: Demi Marie Obenour Date: Sat, 13 Sep 2025 23:16:54 -0400 Subject: [PATCH 3/3] host/rootfs: switch to systemd-udevd MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250913-udev-v1-3-eade4ab8f2b4@gmail.com> References: <20250913-udev-v1-0-eade4ab8f2b4@gmail.com> In-Reply-To: <20250913-udev-v1-0-eade4ab8f2b4@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1757819811; l=19387; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=UHkME2gRZeK6iD6Wzv9t5XjJNnKN4RwXaVqogVZ6Ht0=; b=3dPLcjnkvHzrht6g0ynvMCPeQUZG6wRtYfvusGvI3LgsxSWJU4oDOZRj2hd35qdhRr0J5dSwE 3hQWue2eYLqA5fcn/DdGcvsNNnTwiwJzp31u2m1AB7VpEKkvcDkiKRY X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: JX4C2Y7GN2ODP5NDGRXK33MRVDXQ3B6G X-Message-ID-Hash: JX4C2Y7GN2ODP5NDGRXK33MRVDXQ3B6G X-MailFrom: demiobenour@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Demi Marie Obenour , Alyssa Ross X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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. Signed-off-by: Demi Marie Obenour --- The changes to default.nix are so that I could use the binary cache, which was necessary to test this in a reasonable amount of time. I'm also not sure what changes you (Alyssa) want in this file. Feel free to fix it up on commit. --- host/rootfs/Makefile | 17 ++-- host/rootfs/default.nix | 94 ++++++---------------- host/rootfs/etc/init | 2 +- host/rootfs/etc/mdev.conf | 7 -- host/rootfs/etc/mdev/listen | 2 +- host/rootfs/etc/mdev/net/add | 1 + host/rootfs/etc/s6-rc/mdevd-coldplug/dependencies | 4 - host/rootfs/etc/s6-rc/mdevd-coldplug/up | 4 - host/rootfs/etc/s6-rc/mdevd/run | 5 -- host/rootfs/etc/s6-rc/ok-all/contents | 2 +- .../dependencies.d/systemd-udevd | 0 .../type | 0 .../type.license | 0 host/rootfs/etc/s6-rc/systemd-udevd-coldplug/up | 3 + host/rootfs/etc/s6-rc/systemd-udevd/flag-essential | 0 .../s6-rc/{mdevd => systemd-udevd}/notification-fd | 0 .../notification-fd.license | 0 host/rootfs/etc/s6-rc/systemd-udevd/run | 10 +++ .../rootfs/etc/s6-rc/{mdevd => systemd-udevd}/type | 0 .../s6-rc/{mdevd => systemd-udevd}/type.license | 0 host/rootfs/etc/s6-rc/vmm-env/contents | 1 + host/rootfs/etc/s6-rc/weston/dependencies | 4 - .../weston/dependencies.d/systemd-udevd-coldplug | 0 host/rootfs/etc/udev/rules.d/99-spectrum.rules | 5 ++ 24 files changed, 56 insertions(+), 105 deletions(-) diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile index 22cdee17a3c878131ea9145fdcafbbbb4ba40db5..ed3937c5665273bb0a5ba7c1dfeaf6b887763c59 100644 --- a/host/rootfs/Makefile +++ b/host/rootfs/Makefile @@ -13,7 +13,6 @@ FILES = \ etc/group \ etc/init \ etc/login \ - etc/mdev.conf \ etc/mdev/listen \ etc/mdev/net/add \ etc/mdev/wait \ @@ -52,6 +51,7 @@ FILES = \ etc/s6-linux-init/run-image/service/xdg-desktop-portal-spectrum-host/template/notification-fd \ etc/s6-linux-init/run-image/service/xdg-desktop-portal-spectrum-host/template/run \ etc/s6-linux-init/scripts/rc.init \ + etc/udev/rules.d/99-spectrum.rules \ etc/xdg/weston/autolaunch \ etc/xdg/weston/weston.ini \ usr/bin/assign-devices \ @@ -136,12 +136,6 @@ S6_RC_FILES = \ etc/s6-rc/kvm/timeout-up \ etc/s6-rc/kvm/type \ etc/s6-rc/kvm/up \ - etc/s6-rc/mdevd-coldplug/dependencies \ - etc/s6-rc/mdevd-coldplug/type \ - etc/s6-rc/mdevd-coldplug/up \ - etc/s6-rc/mdevd/notification-fd \ - etc/s6-rc/mdevd/run \ - etc/s6-rc/mdevd/type \ etc/s6-rc/ok-all/contents \ etc/s6-rc/ok-all/type \ etc/s6-rc/static-nodes/type \ @@ -149,11 +143,18 @@ S6_RC_FILES = \ etc/s6-rc/sys-vmms/dependencies \ etc/s6-rc/sys-vmms/type \ etc/s6-rc/sys-vmms/up \ + etc/s6-rc/systemd-udevd-coldplug/dependencies.d/systemd-udevd \ + etc/s6-rc/systemd-udevd-coldplug/type \ + etc/s6-rc/systemd-udevd-coldplug/up \ + etc/s6-rc/systemd-udevd/flag-essential \ + etc/s6-rc/systemd-udevd/notification-fd \ + etc/s6-rc/systemd-udevd/run \ + etc/s6-rc/systemd-udevd/type \ etc/s6-rc/vm-env/contents \ etc/s6-rc/vm-env/type \ etc/s6-rc/vmm-env/contents \ etc/s6-rc/vmm-env/type \ - etc/s6-rc/weston/dependencies \ + etc/s6-rc/weston/dependencies.d/systemd-udevd-coldplug \ etc/s6-rc/weston/notification-fd \ etc/s6-rc/weston/run \ etc/s6-rc/weston/type diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix index 20692ba75e9c1f3b93b16d6e47ee777a1965ff8d..ba605588afb2b69adfec59b41af09e8c11a70d79 100644 --- a/host/rootfs/default.nix +++ b/host/rootfs/default.nix @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2022 Unikie import ../../lib/call-package.nix ( -{ callSpectrumPackage, lseek, src, pkgsMusl, pkgsStatic, linux_latest }: +{ callSpectrumPackage, lseek, src, pkgsMusl, pkgsStatic, linux_latest, pkgs }: pkgsStatic.callPackage ( { spectrum-host-tools @@ -12,6 +12,11 @@ pkgsStatic.callPackage ( , inkscape, iproute2, inotify-tools, jq, kmod, mdevd, s6, s6-linux-init, socat , util-linuxMinimal, virtiofsd, xorg, xdg-desktop-portal-spectrum-host }: +pkgs.callPackage ( +{ systemdMinimal, foot, cosmic-files, crosvm +, mesa, dejavu_fonts, westonLite, xdg-desktop-portal +, xdg-desktop-portal-gtk +}: let inherit (nixosAllHardware.config.hardware) firmware; @@ -19,68 +24,9 @@ let concatMapStringsSep concatStrings escapeShellArgs fileset optionalAttrs mapAttrsToList systems trivial; - pkgsGui = pkgsMusl.extend ( - final: super: - (optionalAttrs (systems.equals pkgsMusl.stdenv.hostPlatform super.stdenv.hostPlatform) { - flatpak = super.flatpak.override { - withMalcontent = false; - }; - - libgudev = super.libgudev.overrideAttrs ({ ... }: { - # Tests use umockdev, which is not compatible with libudev-zero. - doCheck = false; - }); - - qt6 = super.qt6.overrideScope (_: prev: { - qttranslations = prev.qttranslations.override { - qttools = prev.qttools.override { - qtbase = prev.qtbase.override { - qttranslations = null; - systemdSupport = false; - }; - qtdeclarative = null; - }; - }; - - qtbase = prev.qtbase.override { - systemdSupport = false; - }; - }); - - systemd = super.systemd.overrideAttrs ({ meta ? { }, ... }: { - meta = meta // { - platforms = [ ]; - }; - }); - - upower = super.upower.override { - # Not ideal, but it's the best way to get rid of an installed - # test that needs umockdev. - withIntrospection = false; - }; - - udev = final.libudev-zero; - - weston = super.weston.overrideAttrs ({ mesonFlags ? [], ... }: { - mesonFlags = mesonFlags ++ [ - "-Dsystemd=false" - ]; - }); - - xdg-desktop-portal = (super.xdg-desktop-portal.override { - enableSystemd = false; - }).overrideAttrs ({ ... }: { - # Tests use umockdev. - doCheck = false; - }); - }) - ); - - foot = pkgsGui.foot.override { allowPgo = false; }; - packages = [ - bcachefs-tools cloud-hypervisor dbus execline inotify-tools - iproute2 jq kmod mdevd s6 s6-linux-init s6-rc socat + bcachefs-tools cloud-hypervisor cosmic-files crosvm dbus execline + foot inotify-tools iproute2 jq kmod s6 s6-linux-init s6-rc socat spectrum-host-tools virtiofsd xdg-desktop-portal-spectrum-host (cryptsetup.override { @@ -96,6 +42,7 @@ let CONFIG_CHATTR n CONFIG_DEPMOD n CONFIG_FINDFS n + CONFIG_HALT n CONFIG_INIT n CONFIG_INSMOD n CONFIG_IP n @@ -106,10 +53,13 @@ let CONFIG_MODINFO n CONFIG_MODPROBE n CONFIG_MOUNT n + CONFIG_POWEROFF n + CONFIG_REBOOT n CONFIG_RMMOD n + CONFIG_SHUTDOWN n ''; }) - ] ++ (with pkgsGui; [ cosmic-files crosvm foot ]); + ]; nixosAllHardware = nixos ({ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/all-hardware.nix") ]; @@ -126,7 +76,7 @@ let # (not just their bin/* files). usrPackages = [ appvm kernel.modules firmware netvm - ] ++ (with pkgsGui; [ mesa dejavu_fonts westonLite ]); + mesa dejavu_fonts westonLite ]; appvms = { appvm-firefox = callSpectrumPackage ../../vm/app/firefox.nix {}; @@ -144,16 +94,16 @@ let # Weston doesn't support SVG icons. inkscape -w 20 -h 20 \ -o $out/usr/share/icons/hicolor/20x20/apps/com.system76.CosmicFiles.png \ - ${pkgsGui.cosmic-files}/share/icons/hicolor/24x24/apps/com.system76.CosmicFiles.svg + ${cosmic-files}/share/icons/hicolor/24x24/apps/com.system76.CosmicFiles.svg ln -st $out/usr/bin \ ${concatMapStringsSep " " (p: "${p}/bin/*") packages} \ - ${pkgsGui.xdg-desktop-portal}/libexec/xdg-document-portal \ - ${pkgsGui.xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk + ${xdg-desktop-portal}/libexec/xdg-document-portal \ + ${xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk ln -st $out/usr/share/dbus-1 \ ${dbus}/share/dbus-1/session.conf ln -st $out/usr/share/dbus-1/services \ - ${pkgsGui.xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service + ${xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service for pkg in ${escapeShellArgs usrPackages}; do lndir -ignorelinks -silent "$pkg" "$out/usr" @@ -167,6 +117,10 @@ let # programs we want. # https://lore.kernel.org/util-linux/87zgrl6ufb.fsf@alyssa.is/ ln -s ${util-linuxMinimal}/bin/{findfs,uuidgen,lsblk,mount} $out/usr/bin + + # TODO: this is another hack and it should be possible + # to build systemd without this. + ln -s -- ${lib.escapeShellArg systemdMinimal}/bin/udevadm "$out/usr/bin" ''; in @@ -203,7 +157,7 @@ stdenvNoCC.mkDerivation { unsafeDiscardReferences = { out = true; }; passthru = { - inherit appvm firmware kernel nixosAllHardware packagesSysroot pkgsGui; + inherit appvm firmware kernel nixosAllHardware packagesSysroot; }; meta = with lib; { @@ -211,4 +165,4 @@ stdenvNoCC.mkDerivation { platforms = platforms.linux; }; } -) {}) (_: {}) +) {}) {}) (_: {}) diff --git a/host/rootfs/etc/init b/host/rootfs/etc/init index 4085fa55545e7309004967e443e47fc2b82b0663..22b38017234e9b042c4c239377e80477aca5f5fa 100755 --- a/host/rootfs/etc/init +++ b/host/rootfs/etc/init @@ -2,4 +2,4 @@ # SPDX-License-Identifier: EUPL-1.2+ # SPDX-FileCopyrightText: 2022 Alyssa Ross -/bin/s6-linux-init -c /etc/s6-linux-init -s /run/param -- $@ +/bin/s6-linux-init -c /etc/s6-linux-init -s /run/param -p /usr/bin -- $@ diff --git a/host/rootfs/etc/mdev.conf b/host/rootfs/etc/mdev.conf deleted file mode 100644 index bddcfdc44ec2a8b1aa95e84cb88fdde625c766d8..0000000000000000000000000000000000000000 --- a/host/rootfs/etc/mdev.conf +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: EUPL-1.2+ -# SPDX-FileCopyrightText: 2021-2022, 2024 Alyssa Ross - -$PCI_CLASS=^2....$ 0:0 660 +/etc/mdev/net/add --$MODALIAS=.* 0:0 660 +importas -Siu MODALIAS modprobe -q $MODALIAS -kvm 0:0 660 +background { /etc/mdev/listen kvm } -dri/card0 0:0 660 +background { /etc/mdev/listen card0 } diff --git a/host/rootfs/etc/mdev/listen b/host/rootfs/etc/mdev/listen index ab50ee8c5ed1139d1129bac56afa7263af150745..20969cab2106efc010cff7cd3aa3f1edc6037dbb 100755 --- a/host/rootfs/etc/mdev/listen +++ b/host/rootfs/etc/mdev/listen @@ -8,4 +8,4 @@ foreground { } redirfd -w 1 /run/wait/${1} -echo +/usr/bin/echo diff --git a/host/rootfs/etc/mdev/net/add b/host/rootfs/etc/mdev/net/add index f343779dcab6ca10c1661e40d3f5bfb8f6080e38..a964376abb75cdd7b07d608c1b76c25c802bcf49 100755 --- a/host/rootfs/etc/mdev/net/add +++ b/host/rootfs/etc/mdev/net/add @@ -5,6 +5,7 @@ # Assign the whole IOMMU group containing this device to the network # VM. +export PATH /usr/bin if { modprobe vfio-pci } importas -i devpath DEVPATH diff --git a/host/rootfs/etc/s6-rc/mdevd-coldplug/dependencies b/host/rootfs/etc/s6-rc/mdevd-coldplug/dependencies deleted file mode 100644 index 59b02b7356ea0d88ac446cea74791a9cd3303de4..0000000000000000000000000000000000000000 --- a/host/rootfs/etc/s6-rc/mdevd-coldplug/dependencies +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 -# SPDX-FileCopyrightText: 2020 Alyssa Ross -# -mdevd diff --git a/host/rootfs/etc/s6-rc/mdevd-coldplug/up b/host/rootfs/etc/s6-rc/mdevd-coldplug/up deleted file mode 100644 index 8698f7d7988a017786fb91a584eafbfb23b3165d..0000000000000000000000000000000000000000 --- a/host/rootfs/etc/s6-rc/mdevd-coldplug/up +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: EUPL-1.2+ -# SPDX-FileCopyrightText: 2020-2021 Alyssa Ross - -mdevd-coldplug diff --git a/host/rootfs/etc/s6-rc/mdevd/run b/host/rootfs/etc/s6-rc/mdevd/run deleted file mode 100644 index 55899bbe674426e4591e866a4d0617361ba34305..0000000000000000000000000000000000000000 --- a/host/rootfs/etc/s6-rc/mdevd/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/execlineb -P -# SPDX-License-Identifier: EUPL-1.2+ -# SPDX-FileCopyrightText: 2020-2022 Alyssa Ross - -mdevd -D3 -O4 -b134217728 diff --git a/host/rootfs/etc/s6-rc/ok-all/contents b/host/rootfs/etc/s6-rc/ok-all/contents index 9f8b0ed66ceedd591ed2f1a7e164d9abcc54cc53..c76a5af336c7f1c3f4b81bf1f6244a53e0399fe8 100644 --- a/host/rootfs/etc/s6-rc/ok-all/contents +++ b/host/rootfs/etc/s6-rc/ok-all/contents @@ -1,6 +1,6 @@ # SPDX-License-Identifier: CC0-1.0 # SPDX-FileCopyrightText: 2021 Alyssa Ross # -mdevd-coldplug +systemd-udevd-coldplug sys-vmms vm-env diff --git a/host/rootfs/etc/s6-rc/systemd-udevd-coldplug/dependencies.d/systemd-udevd b/host/rootfs/etc/s6-rc/systemd-udevd-coldplug/dependencies.d/systemd-udevd new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/host/rootfs/etc/s6-rc/mdevd-coldplug/type b/host/rootfs/etc/s6-rc/systemd-udevd-coldplug/type similarity index 100% rename from host/rootfs/etc/s6-rc/mdevd-coldplug/type rename to host/rootfs/etc/s6-rc/systemd-udevd-coldplug/type diff --git a/host/rootfs/etc/s6-rc/mdevd-coldplug/type.license b/host/rootfs/etc/s6-rc/systemd-udevd-coldplug/type.license similarity index 100% rename from host/rootfs/etc/s6-rc/mdevd-coldplug/type.license rename to host/rootfs/etc/s6-rc/systemd-udevd-coldplug/type.license diff --git a/host/rootfs/etc/s6-rc/systemd-udevd-coldplug/up b/host/rootfs/etc/s6-rc/systemd-udevd-coldplug/up new file mode 100644 index 0000000000000000000000000000000000000000..5cf329c5b32f44ab8b48dc10239542a982c68d14 --- /dev/null +++ b/host/rootfs/etc/s6-rc/systemd-udevd-coldplug/up @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour +/usr/bin/udevadm trigger diff --git a/host/rootfs/etc/s6-rc/systemd-udevd/flag-essential b/host/rootfs/etc/s6-rc/systemd-udevd/flag-essential new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/host/rootfs/etc/s6-rc/mdevd/notification-fd b/host/rootfs/etc/s6-rc/systemd-udevd/notification-fd similarity index 100% rename from host/rootfs/etc/s6-rc/mdevd/notification-fd rename to host/rootfs/etc/s6-rc/systemd-udevd/notification-fd diff --git a/host/rootfs/etc/s6-rc/mdevd/notification-fd.license b/host/rootfs/etc/s6-rc/systemd-udevd/notification-fd.license similarity index 100% rename from host/rootfs/etc/s6-rc/mdevd/notification-fd.license rename to host/rootfs/etc/s6-rc/systemd-udevd/notification-fd.license diff --git a/host/rootfs/etc/s6-rc/systemd-udevd/run b/host/rootfs/etc/s6-rc/systemd-udevd/run new file mode 100644 index 0000000000000000000000000000000000000000..a7290b8c7185aea2b8faae4fd6c2aaf1ca9f1ab3 --- /dev/null +++ b/host/rootfs/etc/s6-rc/systemd-udevd/run @@ -0,0 +1,10 @@ +#!/bin/execlineb -P +# SPDX-License-Identifier: EUPL-1.2+ +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour + +# systemd-udevd is a multi-call binary, and +# the third argument to sd-notify-adapter is +# passed as argv[0], so this invokes systemd-udevd +# despite looking like it does not. +sd-notify-adapter --oom-score-adj=-1000 -- +3 /run/udev-notify/notify-sock /usr/bin/udevadm systemd-udevd diff --git a/host/rootfs/etc/s6-rc/mdevd/type b/host/rootfs/etc/s6-rc/systemd-udevd/type similarity index 100% rename from host/rootfs/etc/s6-rc/mdevd/type rename to host/rootfs/etc/s6-rc/systemd-udevd/type diff --git a/host/rootfs/etc/s6-rc/mdevd/type.license b/host/rootfs/etc/s6-rc/systemd-udevd/type.license similarity index 100% rename from host/rootfs/etc/s6-rc/mdevd/type.license rename to host/rootfs/etc/s6-rc/systemd-udevd/type.license diff --git a/host/rootfs/etc/s6-rc/vmm-env/contents b/host/rootfs/etc/s6-rc/vmm-env/contents index ee1e3cfc39d1a6545bbefc3692782b9de6b3ade3..6f4c16d17c1cb23ebf059e50d59b4c1c7d963706 100644 --- a/host/rootfs/etc/s6-rc/vmm-env/contents +++ b/host/rootfs/etc/s6-rc/vmm-env/contents @@ -4,3 +4,4 @@ core kvm static-nodes +systemd-udevd-coldplug diff --git a/host/rootfs/etc/s6-rc/weston/dependencies b/host/rootfs/etc/s6-rc/weston/dependencies deleted file mode 100644 index 8470c0fabc5c85b2529ee26ad82d3910e95f23cb..0000000000000000000000000000000000000000 --- a/host/rootfs/etc/s6-rc/weston/dependencies +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: CC0-1.0 -# SPDX-FileCopyrightText: 2021 Alyssa Ross -# -card0 diff --git a/host/rootfs/etc/s6-rc/weston/dependencies.d/systemd-udevd-coldplug b/host/rootfs/etc/s6-rc/weston/dependencies.d/systemd-udevd-coldplug new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/host/rootfs/etc/udev/rules.d/99-spectrum.rules b/host/rootfs/etc/udev/rules.d/99-spectrum.rules new file mode 100644 index 0000000000000000000000000000000000000000..199397bc26874a261c9e1ea1778207fdb0d8ad39 --- /dev/null +++ b/host/rootfs/etc/udev/rules.d/99-spectrum.rules @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: EUPL-1.2+ +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour +ACTION!="remove", KERNEL=="kvm", RUN+="/etc/mdev/listen kvm" +ACTION!="remove", ENV{PCI_CLASS}=="2????", RUN+="/etc/mdev/net/add" +ACTION!="remove", ENV{MODALIAS}=="?*", RUN+="/usr/bin/modprobe -q $env{MODALIAS}" -- 2.51.0