From 4f1dd56fd22c2d39f1c23c54c33feb0d7503ab09 Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Wed, 12 Aug 2026 02:42:24 +0200 Subject: [PATCH 46/72] layerscape: gzip the mono_gateway-dk sysupgrade image, keep a legacy variant sysupgrade.bin shipped as an uncompressed tar (~470 MB); its content gzips to ~44 MB (the emmc.img.gz factory image is the same data). The OTA client downloads it on every update, so compressing cuts fleet traffic ~10x. fwtool metadata is appended after gzip, exactly like the existing emmc.img.gz recipe, so the stage1 metadata/SUPPORTED_DEVICES check is unaffected. The RUNNING system's upgrade code does the flashing, and firmware predating the gzip-capable platform.sh refuses a gzipped image (cleanly, nothing written) - a device that sits on a shelf for months would wake to a manifest it can never install. So every release also builds sysupgrade-legacy.bin, the same tar uncompressed: latest.json advertises it under the "sysupgrade" key old clients already read, while gzip-capable clients prefer the new "sysupgrade_gz" key. Any device, however stale, can always take the legacy image once and pulls the small image from then on. Retire the legacy artifact only when no deployed device predates gzip support. Bench note: `sysupgrade -F` of a hand-built gzipped tar WITHOUT fwtool metadata is now refused (the decompressor strips the trailer first and a bare .tar.gz has none) - gunzip such an image before force-flashing. Uncompressed images, with or without metadata, flash exactly as before. Co-Authored-By: Claude Opus 4.8 --- target/linux/layerscape/image/armv8_64b.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index ca12f1917b..b174536d81 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -474,9 +474,15 @@ define Device/mono_gateway-dk # appending it still report mono,gateway-dk-sdboot at runtime, and sysupgrade # refuses an image whose SUPPORTED_DEVICES lacks the running board name. SUPPORTED_DEVICES := mono,gateway-dk mono,gateway-dk-sdboot - IMAGES := emmc.img.gz sysupgrade.bin + IMAGES := emmc.img.gz sysupgrade.bin sysupgrade-legacy.bin IMAGE/emmc.img.gz := mono-bootfs | mono-emmc-img | gzip | append-metadata - IMAGE/sysupgrade.bin := mono-bootfs | mono-sysupgrade | append-metadata + IMAGE/sysupgrade.bin := mono-bootfs | mono-sysupgrade | gzip | append-metadata + # Same tar, uncompressed: firmware that predates the gzip-capable flash + # path cannot read sysupgrade.bin, so latest.json keeps advertising this + # one under "sysupgrade" (old clients) and the gzipped one under + # "sysupgrade_gz". Drop it only once no deployed device predates gzip + # support - a straggler waking up after months still needs it. + IMAGE/sysupgrade-legacy.bin := mono-bootfs | mono-sysupgrade | append-metadata endef TARGET_DEVICES += mono_gateway-dk -- 2.47.3