From 055fafc2338de0963f2b7141da3ab87925b4aa3e Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 30 Aug 2026 18:37:33 -0700 Subject: [PATCH] =?UTF-8?q?udev:=20match=20kfd=20by=20name=20only=20?= =?UTF-8?q?=E2=80=94=20misc-class=20devices=20have=20no=20udev=20subsystem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first revision guarded the kfd line with SUBSYSTEM=="misc", which never matches (misc-class devices carry no subsystem for udev matching), so the rule was read but never fired and /dev/kfd stayed 0660 root:render. Name-only match applies 0666 on creation and on trigger. Also fixes test-changed.sh to exit 0 when changed paths map to zero tests (udev rules are mapped-but-untestable) instead of invoking bats with an empty selection. --- dankclaw/udev/99-comfyui-gpu-access.rules | 6 +++--- scripts/test-changed.sh | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dankclaw/udev/99-comfyui-gpu-access.rules b/dankclaw/udev/99-comfyui-gpu-access.rules index b79c78d..df3a895 100644 --- a/dankclaw/udev/99-comfyui-gpu-access.rules +++ b/dankclaw/udev/99-comfyui-gpu-access.rules @@ -15,7 +15,7 @@ # domain) can already ptrace the GPU userspace through an existing holder's # fd inheritance; on a private single-administrator home server this trades a # capability gate that could never be held by the intended user anyway. -# Render nodes and /dev/kfd are compute nodes only — display outputs (card0, -# card1) keep their owner/group/mode. -KERNEL=="kfd", SUBSYSTEM=="misc", MODE="0666" +# Note the missing SUBSYSTEM= guard on the kfd line: misc-class devices have no +# subsystem for udev matching, so a SUBSYSTEM=="misc" guard never matches. +KERNEL=="kfd", MODE="0666" KERNEL=="renderD*", SUBSYSTEM=="drm", MODE="0666" diff --git a/scripts/test-changed.sh b/scripts/test-changed.sh index 4cf3fa5..ddbc62b 100755 --- a/scripts/test-changed.sh +++ b/scripts/test-changed.sh @@ -214,6 +214,10 @@ for path in "${CHANGED[@]}"; do esac done +# Mapped-but-untestable paths (udev rules, trash moves) legitimately produce an +# empty selection; that is a pass, not a bats usage error. +[ "${#TESTS[@]}" -gt 0 ] || exit 0 + if [ "$LIST_ONLY" -eq 1 ]; then printf '%s\n' "${TESTS[@]}" exit 0