From ab142663894615fb049e6c4a35b9f021b7743d48 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Fri, 26 Jun 2026 21:49:35 +0200 Subject: [PATCH] Fix bare-metal detection in firmware-update systemd-detect-virt prints "none" on bare metal but exits non-zero, so the `|| echo "none"` fallback appended a second "none" and the check wrongly treated a physical Proxmox host as virtualized. Capture the command output directly and only block when a real virtualization type is reported. --- tools/pve/firmware-update.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/pve/firmware-update.sh b/tools/pve/firmware-update.sh index f87017ff4..c946f16ef 100755 --- a/tools/pve/firmware-update.sh +++ b/tools/pve/firmware-update.sh @@ -54,9 +54,11 @@ if ! pveversion | grep -Eq "pve-manager/(8\.[0-4]|9\.[0-9]+)(\.[0-9]+)*"; then exit 1 fi -# Firmware updates only make sense on bare metal -virt=$(systemd-detect-virt 2>/dev/null || echo "none") -if [ "$virt" != "none" ]; then +# Firmware updates only make sense on bare metal. systemd-detect-virt prints +# "none" but exits non-zero on bare metal, so a `|| echo none` fallback would +# duplicate the value; capture the output as-is instead. +virt=$(systemd-detect-virt 2>/dev/null) +if [ -n "$virt" ] && [ "$virt" != "none" ]; then msg_error "Firmware updates can only be applied on bare metal. Detected: $virt" exit 1 fi