fix: harden greeter DRM device wait

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-07 20:51:21 +01:00
parent a767812371
commit 39ac7c5ab4
@@ -92,11 +92,15 @@ if ! command -v redbear-compositor >/dev/null 2>&1; then
fi
# pcid-spawner is intentionally async in Red Bear OS, so service ordering only guarantees that
# spawning has started. The compositor wrapper still has to wait for the actual DRM node.
desired_drm_devices="${KWIN_DRM_DEVICES:-/scheme/drm/card0}"
# spawning has started. Wait for the DRM scheme root first, then the selected card node.
if [ -n "${KWIN_DRM_DEVICES:-}" ]; then
desired_drm_devices="/scheme/drm:${KWIN_DRM_DEVICES}"
else
desired_drm_devices="/scheme/drm:/scheme/drm/card0"
fi
if wait_for_drm_devices "$desired_drm_devices"; then
export KWIN_DRM_DEVICES="$desired_drm_devices"
export KWIN_DRM_DEVICES="${KWIN_DRM_DEVICES:-/scheme/drm/card0}"
echo "redbear-greeter-compositor: using DRM compositor backend (KWIN_DRM_DEVICES=${KWIN_DRM_DEVICES})" >&2
exec redbear-compositor --drm
else