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 <noreply@anthropic.com>
This commit is contained in:
parent
b2af68ac9a
commit
4b72126784
12
.github/workflows/build-vm-appliance.yml
vendored
12
.github/workflows/build-vm-appliance.yml
vendored
@ -289,8 +289,16 @@ jobs:
|
|||||||
|
|
||||||
echo "📦 Source image: $IMG_FILE"
|
echo "📦 Source image: $IMG_FILE"
|
||||||
|
|
||||||
# Extract
|
# Extract (ignore "trailing garbage" warning - normal for firmware images)
|
||||||
gunzip -c "$IMG_FILE" > /tmp/openwrt.img
|
# 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)
|
IMG_SIZE=$(stat -c%s /tmp/openwrt.img)
|
||||||
echo " Size: $(numfmt --to=iec $IMG_SIZE)"
|
echo " Size: $(numfmt --to=iec $IMG_SIZE)"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user