Skip to content

build: a fixed-slot package that no longer fits is skipped, not fatal - #2666

Merged
widgetii merged 2 commits into
masterfrom
build/fixed-package-optional
Oct 24, 2026
Merged

widgetii merged 2 commits into
masterfrom
build/fixed-package-optional

Conversation

@widgetii

Copy link
Copy Markdown
Member

Boards on the split NOR 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.

The next ones are close (2026-10-22 nightly):

lite rootfs growth, 30 days
gk7205v200 5100K / 5120K +16K
gk7205v300 5100K / 5120K +16K
gk7605v100 5100K / 5120K +20K
hi3516ev200 5096K / 5120K +28K
gk7202v300 5088K / 5120K +32K

On these boards the fixed-slot package is the extra. 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 (OpenIPC/website#505 drops a plain package once a newer build published only the split one). The build workflow already takes the -split package for its Telegram upload when no plain one exists, as on hi3516cv6xx.

Tested on a gk7205v500 lite build's images (a TARGET with its .config):

  • real sizes (uImage 1934K, rootfs 5044K): make repack builds both packages, as before;
  • rootfs padded to 5130K: ::warning::gk7205v500 lite: uImage 1934KB/1983KB, rootfs.squashfs 5130KB/5120KB outgrow the fixed slots; shipping the split package only, and only openipc.gk7205v500-nor-lite-split.tgz is built.

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.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Skip oversized fixed-slot NOR packages while retaining split packages

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Prevent oversized optional fixed-slot packages from failing otherwise valid split NOR builds.
• Emit a size warning when either fixed-slot image exceeds its limit.
• Preserve existing split-package checks and packaging.
Diagram

graph TD
  A["NOR images"] --> B{"Fixed slots fit?"} -->|Yes| C["Plain package"] --> D["Split checks"] --> E["Split package"]
  B -->|No| F["Size warning"] --> D
Loading
High-Level Assessment

Keep the preflight fit check at the optional fixed-slot packaging branch. It preserves the existing fatal checks for split firmware and avoids changing shared repack behavior; treating all size-check failures as nonfatal would weaken those protections.

Files changed (1) +21 / -2

Bug fix (1) +21 / -2
MakefileMake fixed-slot NOR packaging conditional on image sizes +21/-2

Make fixed-slot NOR packaging conditional on image sizes

• Checks whole-KB uImage and rootfs sizes against their fixed-slot limits before creating the plain NOR archive. If either does not fit, emits a warning with both sizes and limits, then continues to the existing split-package checks and packaging.

Makefile

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Fixed-slot cameras lack boot evidence 📘 Rule violation ☼ Reliability
Description
The new fixed-slot gating changes which firmware package ships without evidence from a real camera
boot or stream test. Its FIXED_SLOTS_FIT branch changes upgrade artifacts whenever image sizes
cross the slot limits, affecting cameras that receive the resulting split-only package.
Code

Makefile[R189-191]

+	@$(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))
Evidence
The checklist requires hardware evidence for changes that can alter firmware behaviour. The changed
Makefile now conditionally omits the fixed-slot package and ships only the split package when image
sizes exceed the configured limits; the PR description reports build and size tests but no
real-camera boot or stream evidence.

Rule 3: Hardware evidence is present and honest
Makefile[189-191]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR changes firmware package selection for fixed-slot cameras, but the description reports only image-build measurements and no real-camera boot, upgrade, or stream evidence.
## Fix Focus Areas
- Makefile[189-191]
## Recommended Fix
Test the resulting split-only package and the unchanged dual-package case on an affected real camera, then add before/after output covering upgrade success, boot behaviour, and streaming behaviour to the pull request description.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Build warnings blame the wrong image ✓ Resolved
Description
FIXED_SLOTS_SKIP unconditionally says that both uImage and rootfs.squashfs outgrew their slots
whenever either one fails the fit check. Builds with only one oversized image therefore give release
operators an inaccurate diagnosis even though the split package is produced correctly.
Code

Makefile[R384-387]

+	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"
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The fixed-slot skip warning always claims that both images outgrew their slots, although the fit check skips the package when only one image exceeds its limit.
## Fix Focus Areas
- Makefile[379-387]
## Recommended Fix
Build the warning from independent size comparisons so it names only the image or images that exceed their fixed-slot limits, while retaining both measured sizes if useful for diagnostics. Keep the split-package fallback and successful-build behavior unchanged.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can choose which labels appear on a finding, and whether they show icons or text

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread Makefile
Comment thread Makefile Outdated
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.
@widgetii
widgetii merged commit fdf31df into master Oct 24, 2026
145 checks passed
@widgetii
widgetii deleted the build/fixed-package-optional branch October 24, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant