Repository navigation
Add signed preserving USB application updates - #31
Merged
Merged
Conversation
9 of 11 tasks
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
Existing speakers need a preserving USB update path separate from full-flash installation. Add read-only firmware information and a signed, bounded transfer into the inactive application slot. Firmware verifies the descriptor, image/hash/version and rollback bootloader while retaining settings, credentials, prayer-consumption history, shared audio and both application slots.
USB and Wi-Fi update ownership are exclusive. Selected USB updates wait for the owner to switch from Atom USB to Pyramid bottom-only power; startup health confirmation and rollback determine the outcome. Failed or contradictory selection reads retain the durable journal and block discard or another update. Interrupted discard rechecks selection before clearing the request, and a newer running version cannot prematurely clear an older, still-selected USB request. Interrupted USB requests never become network downloads.
Authenticated playback Stop remains available throughout USB ownership, including interrupted transfers and uncertain power handoffs. Only exact
POST /api/stoprequests are exempt from the mutation lock; existing access checks and local API payload validation still apply. Stopping playback preserves the update journal and ownership, settings and prayer history. Other writes remain blocked.See the protocol and qualification contract and development validation. Companion website PR #12 keeps public USB updates disabled until physical qualification and a capable release.
Hardware impact
The reference AtomS3R C126 + Pyramid A167 and partition layout are unchanged.
Standalone impact
Prayer calculations, scheduling, audio, settings and device controls retain standalone operation. USB needs no internet or valid clock; beginning a transfer requires healthy confirmed services, a compatible rollback bootloader and no active playback. The device-local Updates group displays USB ownership and hides network cancellation while USB owns the update. Owners can still stop later playback from Today or Settings.
Testing
Automated:
c89804f.39c3d14with Stop returning 409 after a simulated partial-transfer restart, and passes with the correction across all five USB states. It verifies access checks, other mutation blocking and unchanged journal/OTA/boot-selection state. Real local API tests verify malformed payload rejection, scheduled playback stopping and settings/history preservation.Hardware: none accessed or changed. USB transfer, actual preservation/power handoff/rollback, responsiveness and runtime heap/fragmentation remain unqualified for this transport. Synthetic CI recordings were compile fixtures only and were not installed or played.
Licensing/media