Skip to content

Use image board records for update admission and channels - #75

Merged
pjeweb merged 5 commits into
osb/base/merged-20261114.1from
osb/board-updates
Nov 14, 2026
Merged

pjeweb merged 5 commits into
osb/base/merged-20261114.1from
osb/board-updates

Conversation

@pjeweb

@pjeweb pjeweb commented Nov 13, 2026 •

Copy link
Copy Markdown

Why

The box picks its system and kernel updates from a fixed mapping of two known boards, with RK3588 defaults. That mapping cannot describe other boards. The address of the image channel, where the box looks for system updates, is also fixed.

What it adds

  • The box takes its update identity from the image's board record (Gate device services using image capabilities #73). If the record is unsupported or incomplete, the update dialog says "Updates aren't offered on this board yet" instead of trying.
  • Kernel discovery and download checks follow the record's board family and architecture.
  • A new authenticated setting in the update dialog changes the image-channel address. It defaults to the existing address. HTTPS, signature checks, board matching and release-path restrictions stay enforced.
  • A saved kernel-update record that was never acknowledged gets the same calm message on such a board. The box keeps that record as recovery evidence, and automatic slot mirroring between the two system slots is blocked so it cannot overwrite it.
  • Older images keep the existing two-board mapping and RK3588 defaults.

Screenshots

Before and after at phone and desktop widths

Mock data; the same state at the PR base and head.

Before After
Before: Image channel address and board update availability (390 px) After: Image channel address and board update availability (390 px)
Before: Image channel address and board update availability (1280 px) After: Image channel address and board update availability (1280 px)

How

Update admission (the check that decides whether an update may be looked for, downloaded or staged) now refuses malformed records before any effect. A second fence on the raw record also guards development mode, device overrides, kernel operations and receipt/activation effects; both share one fail-closed parser verdict (refuse when unsure). The new address is stored in image-channel preferences, so the legacy six-key settings file stays as it is.

Stacked on #73 (6f535260470975593b155b3fa9e9f6f2b8d6bfd3; gating device services on image capabilities). Companion image metadata: openstreambox/image-building-pipeline#25 (unchanged at ba66c907, stacked on image #24).

Technical detail

Read update identity from the image-owned board record and show “Updates aren't offered on this board yet” for unsupported records. Kernel discovery and download verification follow the record's family and architecture. Legacy images retain the existing two-board mapping and RK3588 defaults. Persisted, unacknowledged kernel-update records follow the same calm refusal without discarding recovery evidence.

Add an authenticated image-channel address setting with the existing address as its default. The update dialog exposes the address; pointers, release artifacts and kernel sidecars follow it. HTTPS, signature admission, board matching and release-path restrictions remain enforced. The address lives in image-channel preferences to preserve the legacy six-key settings file.

The corrected base rejects malformed records and denies update submission, discovery, startup and staging before effects. The independent raw-record update fence remains because it additionally guards development mode and device overrides, kernel operations and receipt/activation effects. Both fences now share the same fail-closed parser verdict; lowercase and malformed branding-only records cannot select legacy fallback. Package checks reuse the shared aptUpdatesEnabled fence instead of repeating denial logic at each call site. Regression coverage includes malformed records and refusal under development/device overrides.

Re-stack verification

Re-stack verification: git range-diff ec0830ba..fca02e29 6f535260..HEAD maps the original single topic commit to the rebased topic commit. Family/architecture selection, channel URL/schema/transport, UI and catalog changes are retained; 29 of the original 35 paths are byte-for-byte identical. Remaining differences integrate admission with the corrected base, share its parser, and extend regression tests/documentation.

Validation

Validation of rebased head 2e75caa1: Bun 1.4.4, single worker (--parallel=1 --max-concurrency=1): backend 12,702 pass / 19 optional skips / zero failures across 1,103 files; RPC 827, i18n 797, sender 123 pass. One clean complete Node 24 frontend run (--maxWorkers=1): 7,653 pass across 460 files, zero failures or collection errors; hardware preflight 4/4 pass. The prior stale-transform assertion and concurrent generated-import collection failures did not reproduce with checkout-local generated catalogs held fixed throughout the full frontend run. Full lint/types pass (Svelte: zero errors and warnings); technical-debt check and production build pass. All gates ran in transient units with UMask 0022, Nice 10, CPUWeight 50, C.UTF-8 locale and PID isolation. No multi-worker runs.

Review fixes

Incomplete update records

  • Incomplete update metadata now returns no kernel candidate before APT or booted-kernel discovery. Manual and scheduled checks reach the calm unsupported-board state rather than throwing kernel_identity_mismatch; kernel and OS install/staging effects remain refused. Branding-only legacy fallback is unchanged.
  • Added 21 regression cases covering an older capability record and missing/empty update board, compatible and architecture fields. The cases failed before the fix, then passed with the early return. Scheduled coverage exercises the package and OS check ticks.

Review-fix validation: full backend 12,723 pass / 19 optional skips / zero failures across 1,104 files on Bun 1.4.4 (--parallel=1 --max-concurrency=1). Focused update-dialog and update-copy frontend tests: 365 pass across 26 files on Node 24 (--maxWorkers=1). Gates used transient units with UMask 0022, Nice 10, CPUWeight 50, C.UTF-8 locale and PID isolation.

Full lint/type checks and the technical-debt check also pass (Svelte: zero errors and warnings).

Persisted kernel-update records under unsupported policy

  • Reconciliation now checks unsupported update policy after inspecting any pending writer, before booted-kernel identity reads. Manual and scheduled checks with persisted unacknowledged records reach the calm unsupported-board state, and kernel/OS install requests return not_available.
  • Recovery evidence is retained: no acknowledgement, download cleanup, receipt/overlay rewrite or activation occurs under unsupported policy. Running writers remain fenced and uncertain ownership is still refused. Supported policy can resume reconciliation of the retained record. Automatic slot mirroring is also blocked under unsupported policy, including with an otherwise eligible mirror, so it cannot overwrite retained kernel recovery evidence. Added 21 persisted-state cases and 10 recovery-state/writer cases. The initial persisted-state regressions failed in 22 cases before reconciliation handling; the expanded mirror test then failed in all seven scheduled cases before the mirror guard.

Latest review-fix validation (1e8dfeb7): full backend 12,754 pass / 19 optional skips / zero failures across 1,105 files, Bun 1.4.4 (--parallel=1 --max-concurrency=1). Focused update-dialog, kernel-action/view and update-copy frontend: 340 pass across 26 files, Node 24 (--maxWorkers=1). Full lint/type checks pass, including zero Svelte errors or warnings; technical-debt check passes. All gates used transient units with UMask 0022, Nice 10, CPUWeight 50, C.UTF-8 locale and PID isolation. No multi-worker run or browser E2E.

Limits and follow-ups

Boot/recovery adapter qualification and changing the APT repository are separate work. No hardware or deployment. Browser E2E was not run.

@pjeweb
pjeweb changed the base branch from osb/board-capabilities to osb/base/merged-20261114.1 November 14, 2026 07:45
@pjeweb
pjeweb merged commit f3faa82 into osb/base/merged-20261114.1 Nov 14, 2026
3 checks passed
@pjeweb pjeweb added upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal. stacked Depends on another pull request; review and integrate parents first. labels Nov 16, 2026
@pjeweb

pjeweb commented Nov 25, 2026

Copy link
Copy Markdown
Author

Still carried in the integration train and not upstream, so it continues as #241.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stacked Depends on another pull request; review and integrate parents first. upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal.

Development

Successfully merging this pull request may close these issues.

1 participant