Skip to content

orchestrator: Add the Updatable update capability trait - #431

Merged
chrysh merged 3 commits into
OpenPRoT:mainfrom
9elements:add-updatable
Aug 27, 2026
Merged

orchestrator: Add the Updatable update capability trait#431
chrysh merged 3 commits into
OpenPRoT:mainfrom
9elements:add-updatable

Conversation

@chrysh

@chrysh chrysh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Adds the Updatable capability trait to the orchestrator's capability crate, covering the staging and activation half of the update flow.

  • poll_stage advances the transfer one bounded step per call, so a single-threaded runtime stays live and cancellation takes effect between steps.
  • activate marks the staged image as the boot candidate only tentatively; committing the image is TrialBoot's job.
  • PayloadSource is the chunked read seam, serving both direct-flash adapters and PLDM devices that pull their own chunks.

Trait-level tests included in updatable.rs.

Part of 9elements#8. Related: #377 — the trial-boot/commit/rollback capabilities; activate here stays tentative because committing is that seam's job.

@leongross

leongross commented Aug 19, 2026

Copy link
Copy Markdown
Member

@chrysh I can't inspect your claude session links, please fix the permissions

@leongross leongross linked an issue Aug 19, 2026 that may be closed by this pull request
@chrysh

chrysh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@chrysh I can't inspect your claude session links, please fix the permissions

Sorry, there wasn't meant to be a session link. The commit is still in draft state, because I didn't have the time to clean it up yet.

@chrysh
chrysh marked this pull request as ready for review August 19, 2026 19:37
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
@chrysh
chrysh marked this pull request as draft August 20, 2026 11:11
@chrysh chrysh moved this from Todo to In Progress in OpenPRoT PFR Aug 20, 2026
@chrysh
chrysh force-pushed the add-updatable branch 5 times, most recently from 68847ae to 9cadbff Compare August 25, 2026 10:32
@chrysh
chrysh marked this pull request as ready for review August 25, 2026 10:35
@chrysh
chrysh force-pushed the add-updatable branch 2 times, most recently from 535202d to 28d42e8 Compare August 25, 2026 11:20
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs Outdated
Comment thread services/orchestrator/capabilities/src/updatable.rs
Comment thread services/orchestrator/capabilities/src/updatable.rs
Comment thread services/orchestrator/capabilities/src/updatable.rs
@chrysh
chrysh force-pushed the add-updatable branch 3 times, most recently from 1eac03d to 4458062 Compare August 27, 2026 10:47
chrysh added 3 commits August 27, 2026 21:10
poll_stage advances the transfer one bounded step per call, keeping a
single-threaded runtime live and cancellation immediate. activate
marks the staged image as boot candidate, tentatively; committing is
TrialBoot's job. PayloadSource is the chunked read seam, serving both
direct-flash adapters and PLDM devices that pull their own chunks.

Assisted-by: Claude:claude-fable-5

Signed-off-by: Christina Quast <christina.quast@9elements.com>
Boards usually mix archetypes (flash and PLDM devices side by side),
and the associated Error plus the generic payload parameter forced one
concrete Updatable type per board. Follows BootWatch: poll_stage takes
&dyn PayloadSource and errors are the erased UpdateError; adapters log
concrete causes while they are in scope. A board preferring static
dispatch can still wrap its devices in an enum.

Assisted-by: Claude (Fable 5)
With len() == 0 the written == total termination check held on the
first poll, so an image-less staging reached Ready and could be
activated. An empty payload is a caller bug: poll_stage now returns
the new UpdateError::EmptyPayload before touching the device.

Assisted-by: Claude (Fable 5)
@chrysh
chrysh merged commit d5ada04 into OpenPRoT:main Aug 27, 2026
2 checks passed
@chrysh
chrysh deleted the add-updatable branch August 27, 2026 20:38
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.

eRoT self-update Update of all configured devices Update of single downstream device firmware

4 participants