From f3e17e399dfb4ad0c0c781bf5abfdcab1586281a Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 17 Jan 2024 19:42:30 +0100 Subject: [PATCH] feat: Custom VGA adaptor (#573) --- src/display.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/display.sh b/src/display.sh index 1b4fb3c..65af198 100644 --- a/src/display.sh +++ b/src/display.sh @@ -3,17 +3,19 @@ set -Eeuo pipefail # Docker environment variables -: "${GPU:="N"}" # GPU passthrough +: "${GPU:="N"}" # GPU passthrough +: "${VGA:="virtio"}" # VGA adaptor : "${DISPLAY:="none"}" # Display type if [[ "$GPU" != [Yy1]* ]] || [[ "$ARCH" != "amd64" ]]; then - DISPLAY_OPTS="-display $DISPLAY -vga none" + [[ "${DISPLAY,,}" == "none" ]] && VGA="none" + DISPLAY_OPTS="-display $DISPLAY -vga $VGA" return 0 fi -DISPLAY_OPTS="-display egl-headless,rendernode=/dev/dri/renderD128 -vga virtio" +DISPLAY_OPTS="-display egl-headless,rendernode=/dev/dri/renderD128 -vga $VGA" [ ! -d /dev/dri ] && mkdir -m 755 /dev/dri