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 13F1296BC; Sun, 24 May 2026 20:53:21 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 44A0096B5; Sun, 24 May 2026 20:53:19 +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-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by atuin.qyliss.net (Postfix) with ESMTPS id 3957596AF for ; Sun, 24 May 2026 20:53:18 +0000 (UTC) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-7c2fa14795aso69512727b3.1 for ; Sun, 24 May 2026 13:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779655996; x=1780260796; darn=spectrum-os.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=nX+ijXAnRLGAQysh+0reQcaLeq5ikICAJU079jl16NQ=; b=Kby3zxYcN6VbkHeQErLOZXOrhBggB5jOhs6gB+wnJDH5+6QU1qM/K7QBzSWA2vyveJ 6gEE6/WTIqzdorH2MAoXLhh9IO6bQU9au5PR4r8LkZmXHbzyA7jqFPSMyoum2JWz/H2c 6bSzNVdNVLY3Wjt0C0keUC8ICMxqHIOLxjTC/hY9cND5YqxE/KNJ933aOwNV14Toa7mJ CclmKKV2egtcs10ruQ9NabehqL1oJY4sDyAf8HmSDx4fmdjRboXvZxA7k+RwvY7LGMuo vEmg/y8IEjYVPcq2VExadwNedAtRCxzlCBPRT1JY5NHw8ULQhy9TAqRqhp3bnvxvlyv3 gKew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779655996; x=1780260796; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nX+ijXAnRLGAQysh+0reQcaLeq5ikICAJU079jl16NQ=; b=X1ZagRb6XenS9He1jZrH9bPdSOaZeArdgQhoVk7gJBAtsTfC2+I9ESeT139WpvP1IQ zOmnC9CXlzpgR6778dQzPfU6oTAOCai/g9ttYtanViE5/YTSvPd98WwSfXW0e5v1FY8v MdW/6tMd7BML8uNn/L3DuJwDB8lqojSASVkqsjO/LHNs2eUAaXdl7A2NYBvYW9i5tWMn NsB82uZ+sNQQZKWGs4Zx49z5XINvG7joRezYKdU/GVrr1QHj3UQ08jrm9gE5Vtwz6oQh aD6M7sPABzzCT8Af1FCkX7JFlWLOtyaAVWE52eNfARABsGJqY5GWoSuS2z2EkKSXE+0j 3cwA== X-Gm-Message-State: AOJu0YyjH2WruUJ4v57CvU9J4nPI/wKs2cQvR2h0ZUr+H+U0mdbeJF3V eLcQCACU3yJb5NNSD8E2XlQFL6GdlxGQ77ufzUD6UyQx4oK+CApp6kG0v72kY42G X-Gm-Gg: Acq92OEikdZK2zuiU4wSfq4bQJm946Op7jDeajAxj1KtnOJfSzKgh8Vl18GJbANOEVy uEHxBiGvVbwMVwj5FtOuntob6rrxewhoqcmSZcEloXfHovFUu/7NEcIqRwMXgT51zIeOBXYh7T1 XK+ODblQiK2C+NzE1bOeSNN6wTEFhMphK9UallMoWDj19+uuYLKS+I4zVfpqhxFfFYdaRldSpZT VXSq1YaZuNmzSxFhGVRorcT0tSk7RKfBPQGWJ5yIhl8lpFFRjatnuiEJM3kVcxbg80X7oMl+cpG MVJE9JE+SVn3BGftMNvI+KnLF36TYebF+nRhzGQlfOLLnS37+ZnYnXllYm6gVtJ46ZndQC5ytv5 jfZ4gPl0oUxaxA9CNH9loqu0Zxks+EyhBjGYcXlaS52EtHSNPNULlOgpWngxmFva8mg9RwuFUBn qmIMGWoFQLhgqY7hKaQmyslERvUgmT0nPhCje8fg3b+cfGKwueuhCrWQfk34HQpEu+mG5d2BNHO LZ11XEKDa4vRk6E8Ot/G0fzV2XbSQOaK393DGPzevc1VG0= X-Received: by 2002:a05:690c:4b0a:b0:7bf:107b:f859 with SMTP id 00721157ae682-7d338682c40mr142320807b3.16.1779655996196; Sun, 24 May 2026 13:53:16 -0700 (PDT) Received: from localhost.localdomain (h69-131-147-66.cncrtn.broadband.dynamic.tds.net. [69.131.147.66]) by smtp.gmail.com with UTF8SMTPSA id 00721157ae682-7d38c8396basm37232917b3.44.2026.05.24.13.53.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2026 13:53:14 -0700 (PDT) From: Demi Marie Obenour Date: Sun, 24 May 2026 16:51:55 -0400 Subject: [PATCH] host/rootfs: Automatically select card node MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260524-weston-card-fix-v1-1-9c6dad59c245@gmail.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDUyNj3fLU4pL8PN3kxKIU3bTMCl1zI9NkS4sUUyMT0zQloK6ColSgMNj E6FgIv7g0KSs1uQRkjFJtLQB9QziFcwAAAA== X-Change-ID: 20260523-weston-card-fix-725c98d5245f To: Spectrum OS Development X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779655914; l=3285; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=6VSKdQ634QikRxEXMgjDPovXuhv/qfjN/nTTJjsC2lI=; b=YXfyXFL7agIENQmwc6MiWNefTw1pccwqDnZoc05ppLv6wS1JVxK8w/gZBJQzXtDOUlvfNnIDm RNLvVnJNotUB28gCNWyqXiWCG8QLqjfBfTP/zTJZBw/HC1hvJCPu+8h X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: 765XPTKLPFMYJO6ITFNLMCVK7R3YR2R4 X-Message-ID-Hash: 765XPTKLPFMYJO6ITFNLMCVK7R3YR2R4 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: Alyssa Ross , Demi Marie Obenour 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 allows Weston to launch even if there if /dev/dri/card0 does not exist. This requires a shell script for string processing. It could be written in Rust, but that's not worth it for a temporary workaround. It also prevents waiting for the card to be ready. Instead, let s6 restart Weston over and over until Weston finally runs. Signed-off-by: Demi Marie Obenour --- This makes Spectrum work on my AMD system. --- host/rootfs/file-list.mk | 1 + host/rootfs/image/etc/s6-rc/weston/run | 6 +++--- host/rootfs/image/usr/bin/run-weston | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/host/rootfs/file-list.mk b/host/rootfs/file-list.mk index 3899d620717fc97f42e669e5313c4100dcf5b1cd..0ece8e08a0e2d367fe124e90896355aa98a58cb8 100644 --- a/host/rootfs/file-list.mk +++ b/host/rootfs/file-list.mk @@ -62,6 +62,7 @@ FILES = \ image/usr/bin/run-appimage \ image/usr/bin/run-flatpak \ image/usr/bin/run-vmm \ + image/usr/bin/run-weston \ image/usr/bin/spectrum-update \ image/usr/bin/vm-console \ image/usr/bin/vm-import \ diff --git a/host/rootfs/image/etc/s6-rc/weston/run b/host/rootfs/image/etc/s6-rc/weston/run index fd59586c719391deb546c29578341e16a61ed4ce..6c0aac4a2326b5d56b9c09f82589dfbcc78eaabd 100644 --- a/host/rootfs/image/etc/s6-rc/weston/run +++ b/host/rootfs/image/etc/s6-rc/weston/run @@ -2,7 +2,7 @@ # SPDX-License-Identifier: EUPL-1.2+ # SPDX-FileCopyrightText: 2021, 2025 Alyssa Ross -importas -Siu WAYLAND_DISPLAY +importas -Si WAYLAND_DISPLAY piperw 4 3 background { @@ -40,7 +40,6 @@ redirfd -r 0 /dev/tty1 importas -i home HOME cd $home -if { udevadm wait /dev/dri/card0 } s6-setuidgid wayland bwrap # no --unshare-net, breaks udev hotplug @@ -88,4 +87,5 @@ bwrap --bind /run/user/0 /run/user/0 --bind /run/wayland /run/wayland -- -weston -S $WAYLAND_DISPLAY + elglob -w0 CARD "/dev/dri/card[0-9]*" + /usr/bin/run-weston $CARD diff --git a/host/rootfs/image/usr/bin/run-weston b/host/rootfs/image/usr/bin/run-weston new file mode 100755 index 0000000000000000000000000000000000000000..6a14f905d2e9e5533d00aac1ee7f920ebf55fac3 --- /dev/null +++ b/host/rootfs/image/usr/bin/run-weston @@ -0,0 +1,32 @@ +#!/usr/bin/sh -- +# SPDX-License-Identifier: EUPL-1.2+ +# SPDX-FileCopyrightText: 2026 Demi Marie Obenour +set -euf +case ${1-} in +/dev/dri/card[0-9]*) + first_dev=${1#/dev/dri/} extra_cards= + shift + ;; +*) + echo 'No card nodes found, cannot run Weston' >&2 + exit 1 + ;; +esac +for i; do + case $i in + *,*) continue ;; + /dev/dri/card[0-9]*) : ;; + *) + echo 'Bad name from execline script' >&2 + exit 1 + ;; + esac + card_name=${i#/dev/dri/} + case $card_name in */*) continue ;; esac + if [ -z "$extra_cards" ]; then + extra_cards=--additional-devices=$card_name + else + extra_cards=$extra_cards,$card_name + fi +done +exec weston --backend=drm "--drm-device=$first_dev" $extra_cards -S "$WAYLAND_DISPLAY" --- base-commit: 4827f7591e945f331a945fb53a9fd4e8ebfdbc12 change-id: 20260523-weston-card-fix-725c98d5245f -- Sincerely, Demi Marie Obenour (she/her/hers)