sysupgrade: read manifest, learn --channel/--build/--list-builds (1.0.50)#2114
Merged
Conversation
….50) Extends the on-device updater to consume the JSON-free manifest.flat published by #2112 at https://openipc.github.io/firmware/manifest.flat. No new rootfs dependency: parsing is pure busybox awk/grep. New flags: --channel=<nightly|latest> Resolve via @channel records; pin to the rolling channel target. --build=<nightly-YYYYMMDD-xxxxxxx> Pin to a specific dated build (downgrade or bisect). --list-builds[=N] Print the last N (default 20) builds available for this camera's ${soc}_${osr} platform; mark the running build with '*' using BUILD_ID from /etc/os-release (#2111). download_firmware() resolves the manifest into a URL before the legacy fw_printenv/'releases/download/latest' fallback, so unmodified invocations (-k / -r / --url / --archive) keep their exact prior behaviour. self_update()'s regex is extended to fire on --channel and --build so users running a stale script get the manifest-aware version pulled before flashing. Verified locally against a hand-crafted manifest.flat covering three builds and two platforms (hi3520dv200_lite, gk7205v200_lite — the latter is the canonical busybox-only path, see kaeru lab-gk7205v200-now-online): resolve_channel, resolve_url, and the --list-builds 'you-are-here' marker all behave correctly, including empty/unknown-id error paths. scr_version bumped 1.0.49 -> 1.0.50. PR-C of six. Independent of any future dated release; the empty- manifest first-run state from #2112 is already live and surfaces a friendly "No builds available for <platform> yet." message via --list-builds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR-C of six. Teaches on-device
sysupgradeto read the busybox-friendlymanifest.flatpublished by #2112 athttps://openipc.github.io/firmware/manifest.flat. No new rootfs dependency — parsing is pure busyboxawk/grep.New flags
--channel=<nightly|latest>@channelrecords in the manifest; pin to the rolling channel target.--build=<nightly-YYYYMMDD-xxxxxxx>--list-builds[=N]${soc}_${osr}platform; mark the running build with*usingBUILD_IDfrom/etc/os-release(#2111).scr_versionbumped1.0.49 → 1.0.50andself_update()'s regex now fires on--channel/--buildso users on a stale script get the manifest-aware version pulled before flashing.Backward compatibility
download_firmware()resolves the manifest into aurlbefore the legacyfw_printenv/releases/download/latest/fallback, so unmodified invocations (-k/-r/--url/--archive) keep their exact prior behaviour. No flag day.Local verification
Tested against a hand-crafted
manifest.flatcovering three dated builds across two platforms (hi3520dv200_lite,gk7205v200_lite):Empty/unknown-id error paths die with explicit messages.
Test plan (on physical hardware after merge)
ssh root@openipc-hi3520dv200.dlab.torturelabs.com sysupgrade --list-builds=5returns the friendly empty-state message right now (no dated nightly-* releases exist yet).*on the running build (gates BUILD_ID/manifest end-to-end).ssh root@openipc-gk7205v200.dlab.torturelabs.com sysupgrade --list-builds— same, on a board whose defconfig does NOT enable BR2_PACKAGE_JSONFILTER, proving zero JSON-parser dependency (per kaerulab-gk7205v200-now-online).sysupgrade --channel=nightlyflashes the rolling channel target.sysupgrade --build=<historic-id>flashes the named build.sysupgrade --url=…legacy path unchanged.🤖 Generated with Claude Code