Skip to content

sysupgrade: read manifest, learn --channel/--build/--list-builds (1.0.50)#2114

Merged
widgetii merged 1 commit into
masterfrom
ci/sysupgrade-manifest-client
May 20, 2026
Merged

sysupgrade: read manifest, learn --channel/--build/--list-builds (1.0.50)#2114
widgetii merged 1 commit into
masterfrom
ci/sysupgrade-manifest-client

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

PR-C of six. Teaches on-device sysupgrade to read the busybox-friendly 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

Flag Behaviour
--channel=<nightly|latest> Resolve via @channel records in the manifest; pin to the rolling channel target.
--build=<nightly-YYYYMMDD-xxxxxxx> Pin to a specific dated build (downgrade / bisect).
--list-builds[=N] Print the last N (default 20) builds for this camera's ${soc}_${osr} platform; mark the running build with * using BUILD_ID from /etc/os-release (#2111).

scr_version bumped 1.0.49 → 1.0.50 and self_update()'s regex now fires on --channel/--build so users on a stale script get the manifest-aware version pulled before flashing.

Backward compatibility

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. No flag day.

Local verification

Tested against a hand-crafted manifest.flat covering three dated builds across two platforms (hi3520dv200_lite, gk7205v200_lite):

=== resolve_channel nightly ===
nightly-20260520-b9d5883

=== resolve_url nightly-20260519-aabbccd hi3520dv200_lite nor ===
https://github.com/.../openipc.hi3520dv200-nor-lite.tgz

=== list builds for hi3520dv200_lite, running == nightly-20260519-aabbccd ===
    nightly-20260520-b9d5883
  * nightly-20260519-aabbccd
    nightly-20260518-1111111

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=5 returns the friendly empty-state message right now (no dated nightly-* releases exist yet).
  • After tonight's first cron, same command lists ≥1 entry with * 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 kaeru lab-gk7205v200-now-online).
  • sysupgrade --channel=nightly flashes the rolling channel target.
  • sysupgrade --build=<historic-id> flashes the named build.
  • sysupgrade --url=… legacy path unchanged.

🤖 Generated with Claude Code

….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>
@widgetii widgetii merged commit 887328c into master May 20, 2026
93 checks passed
@widgetii widgetii deleted the ci/sysupgrade-manifest-client branch May 20, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant