Skip to content

Commit b486e0e

Browse files
authored
Merge pull request #3603 from joolswills/kms_chroot
system - use kms on bullseye or newer when building in chroot
2 parents 19b3ed2 + 6ff7e3b commit b486e0e

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

scriptmodules/system.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,27 @@ function get_rpi_video() {
328328
local pkgconfig="/opt/vc/lib/pkgconfig"
329329

330330
if [[ -z "$__has_kms" ]]; then
331-
# in chroot, use kms by default for rpi4 target
332-
[[ "$__chroot" -eq 1 ]] && isPlatform "rpi4" && __has_kms=1
333-
# detect driver via inserted module / platform driver setup
334-
[[ -d "/sys/module/vc4" ]] && __has_kms=1
331+
if [[ "$__chroot" -eq 1 ]]; then
332+
# in chroot, use kms by default for rpi4 or Debian 11 (bullseye) or newer
333+
if isPlatform "rpi4" || [[ "$__os_debian_ver" -ge 11 ]]; then
334+
__has_kms=1
335+
fi
336+
else
337+
# detect driver via inserted module / platform driver setup
338+
[[ -d "/sys/module/vc4" ]] && __has_kms=1
339+
fi
335340
fi
336341

337342
if [[ "$__has_kms" -eq 1 ]]; then
338343
__platform_flags+=(mesa kms)
339344
if [[ -z "$__has_dispmanx" ]]; then
340-
# in a chroot, unless __has_dispmanx is set, default to fkms (adding dispmanx flag)
341-
[[ "$__chroot" -eq 1 ]] && __has_dispmanx=1
342-
# if running fkms driver, add dispmanx flag
343-
[[ "$(ls -A /sys/bus/platform/drivers/vc4_firmware_kms/*.firmwarekms 2>/dev/null)" ]] && __has_dispmanx=1
345+
if [[ "$__chroot" -eq 1 ]]; then
346+
# in a chroot default to fkms (supporting dispmanx) when debian is older than 11 (bullseye)
347+
[[ "$__os_debian_ver" -lt 11 ]] && __has_dispmanx=1
348+
else
349+
# if running fkms driver, add dispmanx flag
350+
[[ "$(ls -A /sys/bus/platform/drivers/vc4_firmware_kms/*.firmwarekms 2>/dev/null)" ]] && __has_dispmanx=1
351+
fi
344352
fi
345353
[[ "$__has_dispmanx" -eq 1 ]] && __platform_flags+=(dispmanx)
346354
else

0 commit comments

Comments
 (0)