From 3e1e4d9c72a388a70ba35513ae08df0544efd2c0 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 17 Oct 2023 19:01:08 +0200 Subject: [PATCH 1/7] feat: OpenGL module --- run/gpu.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/run/gpu.sh b/run/gpu.sh index 9e634748..b72f48b3 100644 --- a/run/gpu.sh +++ b/run/gpu.sh @@ -28,3 +28,15 @@ if ! apt-mark showinstall | grep -q "xserver-xorg-video-intel"; then apt-get -qq --no-install-recommends -y install xserver-xorg-video-intel > /dev/null fi + +if ! apt-mark showinstall | grep -q "qemu-system-modules-opengl"; then + + info "Installing OpenGL module..." + + export DEBCONF_NOWARNINGS="yes" + export DEBIAN_FRONTEND="noninteractive" + + apt-get -qq update + apt-get -qq --no-install-recommends -y install qemu-system-modules-opengl > /dev/null + +fi From d4fb4da845e90d783f74b99f90492eb0d2f9d56c Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 17 Oct 2023 19:05:22 +0200 Subject: [PATCH 2/7] build: Update to QEMU 8.1 (Debian 13) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9191806c..47f6cb41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ FROM qemux/qemu-host as builder # RUN go mod download # RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /qemu-host.bin . -FROM debian:bookworm-slim +FROM debian:trixie-slim ARG DEBCONF_NOWARNINGS="yes" ARG DEBIAN_FRONTEND noninteractive From 8c518e559a7c8867c8862cc0e2083de54ccc5562 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 17 Oct 2023 19:12:06 +0200 Subject: [PATCH 3/7] fix: Remove agent check --- run/disk.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/run/disk.sh b/run/disk.sh index 2470f96d..cecf1959 100644 --- a/run/disk.sh +++ b/run/disk.sh @@ -136,13 +136,6 @@ if [[ SIZE -ne DATA_SIZE ]]; then error "Virtual disk has the wrong size: ${SIZE}" && exit 89 fi -AGENT="${STORAGE}/${BASE}.agent" -[ -f "$AGENT" ] && AGENT_VERSION=$(cat "${AGENT}") || AGENT_VERSION=1 - -if ((AGENT_VERSION < 5)); then - info "The installed VirtualDSM Agent v${AGENT_VERSION} is an outdated version, please upgrade it." -fi - DISK_OPTS="\ -device virtio-scsi-pci,id=hw-synoboot,bus=pcie.0,addr=0xa \ -drive file=${BOOT},if=none,id=drive-synoboot,format=raw,cache=${DISK_CACHE},aio=${DISK_IO},discard=${DISK_DISCARD},detect-zeroes=on \ From 94140c33cc42645c223363e1933657031f0e74ad Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 17 Oct 2023 19:24:42 +0200 Subject: [PATCH 4/7] fix: Remove agent check --- run/power.sh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/run/power.sh b/run/power.sh index 87020496..62cb345b 100644 --- a/run/power.sh +++ b/run/power.sh @@ -39,26 +39,14 @@ _graceful_shutdown() { echo && error "Could not send shutdown command to the guest ($RESPONSE)" - # If we cannot shutdown the usual way, fallback to the NMI method - - AGENT="${STORAGE}/${BASE}.agent" - [ -f "$AGENT" ] && AGENT_VERSION=$(cat "${AGENT}") || AGENT_VERSION=1 - - if ((AGENT_VERSION > 1)); then - - # Send a NMI interrupt which will be detected by the kernel - if ! echo 'nmi' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null ; then - AGENT_VERSION=0 - fi - - fi - - if ((AGENT_VERSION < 2)); then + # Send a NMI interrupt which will be detected by the agent script + if ! echo 'nmi' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null ; then kill -15 "$(cat "${_QEMU_PID}")" pkill -f qemu-system-x86_64 || true fi + fi while [ "$(cat ${_QEMU_SHUTDOWN_COUNTER})" -lt "${QEMU_POWERDOWN_TIMEOUT}" ]; do From 2d6d166f9b88d5c27d0626695c0f205f8e619703 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 17 Oct 2023 19:28:37 +0200 Subject: [PATCH 5/7] style: Shutdown counter --- run/power.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run/power.sh b/run/power.sh index 62cb345b..97db8b1a 100644 --- a/run/power.sh +++ b/run/power.sh @@ -58,7 +58,8 @@ _graceful_shutdown() { if echo 'info version'| nc -q 1 -w 1 localhost "${QEMU_MONPORT}" >/dev/null 2>&1 ; then sleep 1 - [[ "${DEBUG}" == [Yy1]* ]] && info "Shutting down, waiting... ($(cat ${_QEMU_SHUTDOWN_COUNTER})/${QEMU_POWERDOWN_TIMEOUT})" + CNT="$(cat ${_QEMU_SHUTDOWN_COUNTER})/${QEMU_POWERDOWN_TIMEOUT}" + [[ "${DEBUG}" == [Yy1]* ]] && info "Shutting down, waiting... (${CNT})" fi From 4e4956204983a9358299d689704fe1771c38f2e1 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 17 Oct 2023 19:32:34 +0200 Subject: [PATCH 6/7] fix: Don't store agent version --- run/install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/run/install.sh b/run/install.sh index 7db83b0c..a80977cd 100644 --- a/run/install.sh +++ b/run/install.sh @@ -242,9 +242,6 @@ mkdir -p "$LOC" cp /agent/service.sh "$LOC/agent.sh" chmod 755 "$LOC/agent.sh" -# Store agent version -echo "7" > "$STORAGE"/"$BASE".agent - info "Install: Installing system partition..." LABEL="1.44.1-42218" From ffbaa7c860a8ad58dbc1509a23afae724b4d003c Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 17 Oct 2023 19:37:39 +0200 Subject: [PATCH 7/7] fix: Skip gateway check in debug mode --- run/network.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run/network.sh b/run/network.sh index f3dced95..3f1799d8 100644 --- a/run/network.sh +++ b/run/network.sh @@ -234,7 +234,11 @@ fi if [[ "${DHCP}" == [Yy1]* ]]; then if [[ "$GATEWAY" == "172."* ]]; then - error "You can only enable DHCP while the container is on a macvlan network!" && exit 86 + if [[ "${DEBUG}" == [Yy1]* ]]; then + info "Warning: Are you sure the container is on a macvlan network?" + else + error "You can only enable DHCP while the container is on a macvlan network!" && exit 86 + fi fi # Configuration for DHCP IP