driver: Settle the eRoT's last self-update at boot - #509
Merged
Merged
Conversation
This was referenced Sep 27, 2026
chrysh
force-pushed
the
self-update-resume
branch
2 times, most recently
from
September 27, 2026 07:40
ae4ddd1 to
5b812af
Compare
chrysh
force-pushed
the
self-update-resume
branch
from
September 27, 2026 08:06
5b812af to
d0cdce3
Compare
chrysh
force-pushed
the
self-update-resume
branch
16 times, most recently
from
October 3, 2026 19:49
97410e3 to
4c3f8d5
Compare
settle_self_update reads the session and the image this boot is running, and says what it found. An update writes the new image to the secondary slot and marks the session pending, so the next reset runs that image once, and the trial run is then either confirmed or reverted. A session nothing will confirm is reverted, so the update is done again rather than counted as finished. A trial that is running is left alone, the update agent judges it with UpdateSecurityRevision. A confirmed session is kept until the floor takes its SVN, and closed here when the floor already reads it, which covers the crash point between the two. The answer is Settled when nothing is left to do, AwaitingUpdateAgent while a session is still being judged, or UnclaimedImageRunning when a trial image is running that no session claims. The last one reverts the session, which clears the pending mark, so the confirmed image runs after a reset rather than the one nothing vouched for. Failures come back as SettleError carrying the session's or the floor's own error, which is what the core::error::Error bound on those seams is for. The rest of the driver flattens storage errors into DriverError because that enum is shared and carries no payload; a free function with its own generics can keep them. It is a free function over the session and the floor, not a board seam. Nothing calls it yet, and a capability joins BoardCapabilities when an executor needs it. Assisted-by: Claude
chrysh
force-pushed
the
self-update-resume
branch
from
October 4, 2026 08:34
4c3f8d5 to
602ec95
Compare
chrysh
marked this pull request as ready for review
October 4, 2026 08:37
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.
When the eRoT updates its own firmware, it has to reboot into the new image. Everything it knew in RAM is gone after that, so before the reboot it writes a note to durable storage saying which image it is trying and with which SVN. That note is the session.
The new image goes into the secondary slot and the session is marked pending, so the next reset runs that image once. That trial run is then either confirmed or reverted.
This PR adds
settle_self_update, which runs at the start of the next boot. It reads the session plus one more fact, which image actually booted, and says what it found:The three answers are
Settled,AwaitingUpdateAgent { svn }andUnclaimedImageRunning.Settledmeans nothing is left to do, so the boot carries on and a new self-update may start.AwaitingUpdateAgentmeans a session is still being judged, so no new self-update may start: recording one would overwrite the session.Running it twice lands in the same place, which is what lets a boot that died partway through simply repeat it. A storage fault leaves the session as it is and fails secure rather than guessing, and the failure carries the session's or the floor's own error in a
SettleError, which is what thecore::error::Errorbound on those seams is for.It is a free function taking the session and the eRoT's own floor, not a board seam. Nothing calls it yet, and a capability joins
BoardCapabilitieswhen an executor needs it, soboard.rsis untouched.Not in this PR: the call site, turning the answer into a state machine event, and the 0x22 path that confirms and advances the floor. Those belong with the message plumbing, which this repo does not have yet.