Files
gitlab-instance-0a899031_sh/d2ypp2/scripts/linux/run_kmscube.sh
eric 78e1308063 ss
2026-05-19 06:47:07 +00:00

26 lines
446 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
DEVICE="${KMSCUBE_DRM_DEVICE:-/dev/dri/card0}"
if ! command -v kmscube >/dev/null 2>&1; then
echo "kmscube is not installed" >&2
exit 127
fi
if [ ! -e "$DEVICE" ]; then
for candidate in /dev/dri/card*; do
if [ -e "$candidate" ]; then
DEVICE="$candidate"
break
fi
done
fi
if [ ! -e "$DEVICE" ]; then
echo "No DRM card device found" >&2
exit 1
fi
exec kmscube -D "$DEVICE"