rockusb: support zstd-compressed images in write-bmap#64
Open
Yury-MonZon wants to merge 1 commit into
Open
Conversation
Add a ".zst" arm to write-bmap alongside the existing gzip handling, so compressed images can be flashed without decompressing them first. The sync (libusb) path uses zstd::stream::read::Decoder, which decodes all concatenated frames to EOF by default. The async (nusb) path uses async_compression's ZstdDecoder, which defaults to first-frame-only; enable multiple_members(true) there so multi-frame images (e.g. from pzstd) match the sync path and are not silently truncated. Deps: add zstd 0.13 (dev) and the "zstd" feature to async-compression.
obbardc
approved these changes
Jul 9, 2026
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.
Closes #65.
Add a
.zstarm towrite-bmapalongside the existing gzip handling, so compressed images can be flashed without decompressing them first.The sync (libusb) path uses
zstd::stream::read::Decoder, which decodes all concatenated frames to EOF by default. The async (nusb) path usesasync_compression'sZstdDecoder, which defaults to first-frame-only;multiple_members(true)is enabled there so multi-frame images (e.g. frompzstd) match the sync path and are not silently truncated.Deps: add
zstd0.13 (dev) and thezstdfeature toasync-compression.Tested by flashing a
.zstimage via the libusb backend.