Skip to content

Enable chunk based OTA updates #1918

Open
MattCatz wants to merge 2 commits into
OnionUI:mainfrom
MattCatz:ota
Open

Enable chunk based OTA updates #1918
MattCatz wants to merge 2 commits into
OnionUI:mainfrom
MattCatz:ota

Conversation

@MattCatz
Copy link
Copy Markdown
Contributor

Pull in the Go project Desync. This allows us to split release files into chunks. Then OTA upgrades only need to get the new chunks between release. This saves a bit of time on network transfers depending on network conditions and starting version.

The desync binary is on the large side but is a statically linked executable. (no need to worry about compiling and linking dependencies).

Chunking enables upgrades from any version without requiring per-version deltas. A traditional delta system would need to generate and store a delta for every possible source/target pair; with chunking, unchanged data is reused regardless of the starting version.

This change-set does make OnionOS hold on to the old zip files. This is needed to seed the OTA download and consumes an extra 415 MB on the SD card depending on the release.

A few rough edges with this PR:

  • go needs to be added to the toolchain docker image. Right now building desync requires the host machine to have go installed.
  • No idea where to store chunks. The content store is all static. gh-pages could store a few releases worth of chunks. Cloudflares R2 free tier is another candidate.

I ported my changes back to some older releases to compare overlap. Below shows the number of unique chunks between each release.

# comm -23 ./Onion-v4.3.1.txt ./Onion-v4.3.1-1.txt | wc -l
268
# comm -23 ./Onion-v4.3.1.txt ./Onion-v4.4.0-beta-20260120.txt | wc -l
167
# comm -23 ./Onion-v4.3.1-1.txt ./Onion-v4.4.0-beta-20260120.txt | wc -l
12

I probably should have purposed this on the discord first but it ended up being a much smaller initial PR than I though it was going to be. Let me know what needs rework.

Copilot AI added a commit to Amiga500/Onion that referenced this pull request Mar 18, 2026
Add desync submodule for content-addressable chunking.
Update Makefile with desync build targets, 7z deterministic archive flags,
and chunk generation target.
Update OTA update script with delta download support via --chunk flag.
Update install.sh with promote_initial_seed function.
Update tagged-release workflow to build desync and include .caidx artifact.

Co-authored-by: Amiga500 <16525337+Amiga500@users.noreply.github.com>
Amiga500 added a commit to Amiga500/Onion that referenced this pull request Mar 18, 2026
Integrate chunk-based OTA updates via desync (OnionUI#1918)
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