From bbd513eaddb925aef178a0b4f1307e2d0670573c Mon Sep 17 00:00:00 2001 From: Patrick Remy Date: Thu, 2 Jul 2026 19:57:08 +0200 Subject: [PATCH 1/2] fix: support kmsprint for display detection Modern Raspberry Pi OS versions use kmsprint instead of deprecated tvservice. --- runs/atreboot.sh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/runs/atreboot.sh b/runs/atreboot.sh index 8166249e82..b422893d11 100755 --- a/runs/atreboot.sh +++ b/runs/atreboot.sh @@ -239,20 +239,28 @@ chmod 666 "$LOGFILE" "$OPENWBBASEDIR/runs/cleanPythonCache.sh" # detect connected displays - # set default to "true" as fallback if "tvservice" is missing + # set default to "true" as fallback if no cli tools are available displayDetected="true" - if which tvservice >/dev/null; then - echo "detected 'tvservice', query for connected displays" - output=$(tvservice -l) - echo "$output" - if [[ ! $output =~ "HDMI" ]] && [[ ! $output =~ "LCD" ]]; then + displayDetectionOutput="" + # Modern versions of Raspberry Pi OS use the KMS/DRM graphics stack + # and tvservice will just print 'tvservice is not supported when using the vc4-kms-v3d driver.' + if which kmsprint >/dev/null; then + echo "detected 'kmsprint', query for connected displays" + displayDetectionOutput=$(kmsprint) + elif which tvservice >/dev/null; then + echo "detected 'tvservice', query for connected displays" + displayDetectionOutput=$(tvservice -l) + else + echo "'kmsprint' and 'tvservice' not found, assuming a display is present" + fi + if [ ! -z "$displayDetectionOutput" ]; then + echo "$displayDetectionOutput" + fi + if [[ ! "$displayDetectionOutput" =~ "HDMI" ]] && [[ ! "$displayDetectionOutput" =~ "LCD" ]]; then echo "no display detected" displayDetected="false" - else - echo "detected HDMI or LCD display(s)" - fi else - echo "'tvservice' not found, assuming a display is present" + echo "detected HDMI or LCD display(s)" fi echo "displayDetected: $displayDetected" forceDisplaySetup=0 From cb54993a1e8dc499f3880bea8d4ad3c4dc49f22d Mon Sep 17 00:00:00 2001 From: Patrick Remy Date: Thu, 2 Jul 2026 20:04:04 +0200 Subject: [PATCH 2/2] style: fix indentation --- runs/atreboot.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/runs/atreboot.sh b/runs/atreboot.sh index b422893d11..524ad01162 100755 --- a/runs/atreboot.sh +++ b/runs/atreboot.sh @@ -245,22 +245,22 @@ chmod 666 "$LOGFILE" # Modern versions of Raspberry Pi OS use the KMS/DRM graphics stack # and tvservice will just print 'tvservice is not supported when using the vc4-kms-v3d driver.' if which kmsprint >/dev/null; then - echo "detected 'kmsprint', query for connected displays" - displayDetectionOutput=$(kmsprint) + echo "detected 'kmsprint', query for connected displays" + displayDetectionOutput=$(kmsprint) elif which tvservice >/dev/null; then - echo "detected 'tvservice', query for connected displays" - displayDetectionOutput=$(tvservice -l) + echo "detected 'tvservice', query for connected displays" + displayDetectionOutput=$(tvservice -l) else - echo "'kmsprint' and 'tvservice' not found, assuming a display is present" + echo "'kmsprint' and 'tvservice' not found, assuming a display is present" fi if [ ! -z "$displayDetectionOutput" ]; then - echo "$displayDetectionOutput" + echo "$displayDetectionOutput" fi if [[ ! "$displayDetectionOutput" =~ "HDMI" ]] && [[ ! "$displayDetectionOutput" =~ "LCD" ]]; then - echo "no display detected" - displayDetected="false" + echo "no display detected" + displayDetected="false" else - echo "detected HDMI or LCD display(s)" + echo "detected HDMI or LCD display(s)" fi echo "displayDetected: $displayDetected" forceDisplaySetup=0