From 153292853fdf309f8858cdb34984476d1c8a9129 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 23 Oct 2026 21:26:47 +0300 Subject: [PATCH 1/2] build: a fixed-slot package that no longer fits is skipped, not fatal Boards on the split layout that still ship the fixed-slot package beside it fail their whole build when the uImage outgrows 1983K or the rootfs outgrows its 5 or 8 MiB slot. That is how hi3518ev300 lite broke the nightly before #2656. On the 2026-10-22 nightly, the next ones are close: the gk7205v200, gk7205v300 and gk7605v100 lite rootfs are 20K short of 5120K, hi3516ev200 lite 24K and gk7202v300 lite 32K, growing 16-32K a month. The fixed-slot package is the extra on these boards. A build whose uImage or rootfs no longer fits its slot now ships the split package alone, with a ::warning:: saying which sizes outgrew which slots. The split package is checked and built exactly as before. Cameras on fixed slots then upgrade to the split layout: sysupgrade falls back to the -split package, and defib and the site's installer install it. Tested on a gk7205v500 lite build's images (TARGET with its .config): with the real sizes (uImage 1934K, rootfs 5044K) make repack builds both packages as before; with the rootfs padded to 5130K it prints "::warning::gk7205v500 lite: uImage 1934KB/1983KB, rootfs.squashfs 5130KB/5120KB outgrow the fixed slots; shipping the split package only" and builds the -split package alone. --- Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3ddb6b6df..e4a0c0729 100644 --- a/Makefile +++ b/Makefile @@ -179,11 +179,16 @@ ifneq ($(wildcard $(TARGET)/images/firmware.bin),) # squashfs is: at the block right after the uImage is the split layout, at the # slot boundary fixed slots. A fixed-slot uImage ending in the slot's last block # would be both. +# +# The fixed-slot package is the extra: a build whose uImage or rootfs has +# outgrown its slot ships the split package alone rather than failing, and +# says so. Cameras on fixed slots then upgrade to the split layout, which +# sysupgrade and defib install from the -split package. ifeq ($(BR2_OPENIPC_NOR_FIXED_PACKAGE),y) ifeq ($(BR2_OPENIPC_FLASH_SIZE),"8") - @$(call PREPARE_REPACK,uImage,1983,rootfs.squashfs,5120,nor) + @$(if $(call FIXED_SLOTS_FIT,5120),$(call PREPARE_REPACK,uImage,1983,rootfs.squashfs,5120,nor),$(call FIXED_SLOTS_SKIP,5120)) else - @$(call PREPARE_REPACK,uImage,1983,rootfs.squashfs,8192,nor) + @$(if $(call FIXED_SLOTS_FIT,8192),$(call PREPARE_REPACK,uImage,1983,rootfs.squashfs,8192,nor),$(call FIXED_SLOTS_SKIP,8192)) endif endif @$(call CHECK_SIZE,firmware.bin,$(shell expr $(subst ",,$(BR2_OPENIPC_FLASH_SIZE)) \* 1024 - $$(( $(or $(BR2_OPENIPC_NOR_FIRMWARE_OFFSET),0x50000) / 1024 )) - 256)) @@ -368,6 +373,20 @@ define REPACK_FIRMWARE rm -f $(TARGET)/images/*.md5sum endef +# Whether uImage and rootfs.squashfs fit the fixed slots beside a split image: +# the uImage under 1984K (see the repack target), the rootfs within $(1) KB, +# both counted in whole KB as CHECK_SIZE counts them. "y" or empty. +FIXED_SLOTS_FIT = $(shell k=$$(( $$(stat -c %s $(TARGET)/images/uImage 2>/dev/null || echo 0) / 1024 )); \ + r=$$(( $$(stat -c %s $(TARGET)/images/rootfs.squashfs 2>/dev/null || echo 0) / 1024 )); \ + [ $$k -gt 0 ] && [ $$k -le 1983 ] && [ $$r -gt 0 ] && [ $$r -le $(1) ] && echo y) + +define FIXED_SLOTS_SKIP + echo "::warning::$(BR2_OPENIPC_SOC_MODEL) $(BR2_OPENIPC_VARIANT): uImage" \ + "$$(( $$(stat -c %s $(TARGET)/images/uImage) / 1024 ))KB/1983KB, rootfs.squashfs" \ + "$$(( $$(stat -c %s $(TARGET)/images/rootfs.squashfs) / 1024 ))KB/$(1)KB outgrow the fixed slots;" \ + "shipping the split package only" +endef + # The split NOR package: firmware.bin alone, under its own name so a sysupgrade # that predates the layout never sees it. Copies, as REPACK_NAND_FIT does. define REPACK_NOR_SPLIT From d69c549063dcc6f0dac64912a58ac1e26a4ba11e Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Fri, 23 Oct 2026 22:07:42 +0300 Subject: [PATCH 2/2] build: the skip warning names only what outgrew its slot From review: it named both images whenever either one did not fit. It now lists the uImage, the rootfs or both, each with its size and slot. Tested on a gk7205v500 lite build's images: rootfs padded to 5130K -> 'rootfs.squashfs 5130KB/5120KB outgrew the fixed slot'; uImage padded to 1990K -> 'uImage 1990KB/1983KB ...'; both -> both, comma-separated. The -split package alone in each case. --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e4a0c0729..b2cd3714a 100644 --- a/Makefile +++ b/Makefile @@ -381,9 +381,12 @@ FIXED_SLOTS_FIT = $(shell k=$$(( $$(stat -c %s $(TARGET)/images/uImage 2>/dev/nu [ $$k -gt 0 ] && [ $$k -le 1983 ] && [ $$r -gt 0 ] && [ $$r -le $(1) ] && echo y) define FIXED_SLOTS_SKIP - echo "::warning::$(BR2_OPENIPC_SOC_MODEL) $(BR2_OPENIPC_VARIANT): uImage" \ - "$$(( $$(stat -c %s $(TARGET)/images/uImage) / 1024 ))KB/1983KB, rootfs.squashfs" \ - "$$(( $$(stat -c %s $(TARGET)/images/rootfs.squashfs) / 1024 ))KB/$(1)KB outgrow the fixed slots;" \ + k=$$(( $$(stat -c %s $(TARGET)/images/uImage) / 1024 )); \ + r=$$(( $$(stat -c %s $(TARGET)/images/rootfs.squashfs) / 1024 )); \ + over=; \ + [ $$k -le 1983 ] || over="uImage $${k}KB/1983KB"; \ + [ $$r -le $(1) ] || over="$${over:+$$over, }rootfs.squashfs $${r}KB/$(1)KB"; \ + echo "::warning::$(BR2_OPENIPC_SOC_MODEL) $(BR2_OPENIPC_VARIANT): $$over outgrew the fixed slot;" \ "shipping the split package only" endef