firmware icon indicating copy to clipboard operation
firmware copied to clipboard

sysupgrade: a gk7205v210 builder profile cannot upgrade: its images are named gk7205v210, the model is aliased to gk7205v200

Open openipc-ai opened this issue 1 month ago • 1 comments

On a camera running a builder device profile for gk7205v210, sysupgrade -k -r refuses every upgrade. Nothing is written, so the camera is safe, but it cannot upgrade at all with the current script. Every camera gets that script from master through self_update, so this affects all of them, whatever firmware they run.

Cause

resolve_model_alias turns the model gk7205v210 into gk7205v200, through the static alias and the firmware manifest's @alias gk7205v210 gk7205v200. builder publishes these profiles under the chip they were built for, though, and so names the images in the archive:

$ curl -sL https://github.com/OpenIPC/builder/releases/download/nightly-20261024-ce9538f/gk7205v210_lite_vixand-ivg-g4h-nor.tgz | tar tzf -
uImage.gk7205v210.md5sum
rootfs.squashfs.gk7205v210.md5sum
uImage.gk7205v210
rootfs.squashfs.gk7205v210

sysupgrade then looks for uImage.gk7205v200 / rootfs.squashfs.gk7205v200.

The same alias causes the image's SoC stamp (openipc-gk7205v210 in /etc/hostname) to fail check_soc against gk7205v200.

Observed

The camera is a lab gk7205v210 + MIS2008 with profile gk7205v210_lite_vixand-ivg-g4h, running builder nightly-20260526-ee40da8, with upgrade= pointing at builder latest.

# sysupgrade -z -k -r        (master's script)
SoC alias: gk7205v210 -> gk7205v200 (shared platform)
...
Download from https://github.com/OpenIPC/builder/releases/download/latest/gk7205v210_lite_vixand-ivg-g4h-nor.tgz
Received and unpacked
No kernel image for this camera (gk7205v200): /tmp/uImage.gk7205v200 not found. Is the firmware built for gk7205v200? Aborting.

Restarting the services stopped for the upgrade
majestic restarted its video

Passing those same images by path gets as far as the SoC check:

Wrong SoC! (image 'gk7205v210' != build 'gk7205v200') Aborting.

With current master, this second refusal comes after the move into RAM, so the camera reboots without having written anything. #2687 moves the check before the pivot, where it refuses cleanly instead.

The upgrade only goes through with --kernel=<uImage.gk7205v210> --rootfs=<rootfs.squashfs.gk7205v210> --force_soc. That is how the lab camera was moved to nightly-20261024 while testing #2687.

Related

#2687 fixes the manifest half of this. builder lists the profile as gk7205v210_…, while sysupgrade looked it up as gk7205v200_…, so --list-builds found nothing and --build answered No artifact. The lookup now falls back to the camera's own BUILD_PLATFORM. After that fix, --build gets as far as the download and then refuses the same way as -k -r above.

Possible fixes

  • In sysupgrade, when the aliased name is missing, accept images named for the camera's own SoC, i.e. the leading token of BUILD_PLATFORM. check_soc would need to accept that same pre-alias SoC.
  • Or have builder name the images in these archives after the canonical model.

The first fixes cameras that are already deployed without a new builder release. Only builder profiles on aliased SoCs are affected (gk7205v210 here, and possibly others that @alias covers), since firmware-repo images are already named after the canonical model.

openipc-ai avatar Oct 25 '26 15:10 openipc-ai

Fixed in #2689 (ee5aa69e). Cameras pick it up on their next -k/-r/--channel/--build through self_update (scr_version 1.0.79).

Cause: resolve_model_alias renamed the model gk7205v210 → gk7205v200, but builder names and stamps these profiles' images for gk7205v210. The archive's images were never found, and with the names fixed, check_soc refused the stamp.

Fix:

  • sysupgrade keeps the SoC token of the camera's own BUILD_PLATFORM from before the alias.
  • When nothing the run unpacked is named for the aliased model and something is named for that SoC, it takes those images, and check_soc accepts that SoC.
  • A foreign SoC is still refused, and an archive named for the canonical model is taken as before.
  • From review: a firmware.bin's device profile is now also checked before the pivot.

The manifest half (--list-builds empty, --build answering No artifact) went in with #2687.

Evidence: on the lab gk7205v210 gk7205v210_lite_vixand-ivg-g4h camera, a plain sysupgrade --build=nightly-20261023-e642e22, with no --force_soc and no local files, flashed and booted. The rollback command it printed, --build=nightly-20261024-ce9538f, took it back. The output is in #2689. The test suite gained 5 cases.

Gaps: a split-NOR firmware.bin for an aliased builder profile is covered only in the harness. builder publishes no nor_split packages today, so no camera reaches that path yet.

openipc-ai avatar Oct 25 '26 20:10 openipc-ai