From 4b72126784b5b4e21f05c26059c14feb65ee9a1a Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 17 Mar 2026 17:47:36 +0100 Subject: [PATCH] fix(ci): Handle gunzip trailing garbage warning in VM build OpenWrt firmware images contain trailing data that gunzip reports as "trailing garbage" with exit code 2. This is normal and the extracted image is valid. The fix ignores the warning while still checking that extraction produced output. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/build-vm-appliance.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-vm-appliance.yml b/.github/workflows/build-vm-appliance.yml index d8c7b6ba..ee33f78d 100644 --- a/.github/workflows/build-vm-appliance.yml +++ b/.github/workflows/build-vm-appliance.yml @@ -289,8 +289,16 @@ jobs: echo "📦 Source image: $IMG_FILE" - # Extract - gunzip -c "$IMG_FILE" > /tmp/openwrt.img + # Extract (ignore "trailing garbage" warning - normal for firmware images) + # gunzip returns exit code 2 for warnings, which we can safely ignore + gunzip -c "$IMG_FILE" > /tmp/openwrt.img 2>/dev/null || { + # Check if extraction actually produced output + if [[ ! -s /tmp/openwrt.img ]]; then + echo "❌ Failed to extract image" + exit 1 + fi + echo " (gunzip warning ignored - normal for firmware images)" + } IMG_SIZE=$(stat -c%s /tmp/openwrt.img) echo " Size: $(numfmt --to=iec $IMG_SIZE)"