From 84029d88713289d200ccb9ec1b19333d5cf02e05 Mon Sep 17 00:00:00 2001 From: Clint Branham Date: Thu, 19 Mar 2026 10:46:44 -0500 Subject: [PATCH] fix(infra): detect Debian suite from os-release for PVE 8 compatibility PVE 8 (Bookworm) may not have /etc/apt/sources.list.d/debian.sources, causing the grep fallback to use 'trixie' which is invalid for PVE 8. Use /etc/os-release VERSION_CODENAME which works on both PVE 8 and 9. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/infrastructure/scripts/first-boot.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/infrastructure/scripts/first-boot.sh b/tests/infrastructure/scripts/first-boot.sh index 34ddbcc..fab10f5 100755 --- a/tests/infrastructure/scripts/first-boot.sh +++ b/tests/infrastructure/scripts/first-boot.sh @@ -10,8 +10,12 @@ set -e rm -f /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.sources rm -f /etc/apt/sources.list.d/ceph.list /etc/apt/sources.list.d/ceph.sources -# Detect suite from existing debian.sources or default to trixie -SUITE=$(grep -oP 'Suites:\s*\K\S+' /etc/apt/sources.list.d/debian.sources 2>/dev/null | head -1 || echo "trixie") +# Detect Debian suite from os-release (works on both PVE 8/bookworm and PVE 9/trixie) +SUITE=$(. /etc/os-release && echo "$VERSION_CODENAME") +if [ -z "$SUITE" ]; then + # Fallback: try parsing apt sources + SUITE=$(grep -oP 'Suites:\s*\K\S+' /etc/apt/sources.list.d/debian.sources 2>/dev/null | head -1 || echo "bookworm") +fi echo "deb http://download.proxmox.com/debian/pve ${SUITE} pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list apt-get update -qq