Skip to content

chore(images): compress disk images with xz instead of zstd#3107

Merged
vpetersson merged 2 commits into
masterfrom
chore/xz-disk-image-compression
Jul 2, 2026
Merged

chore(images): compress disk images with xz instead of zstd#3107
vpetersson merged 2 commits into
masterfrom
chore/xz-disk-image-compression

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

No linked issue. Distributable disk images were compressed with zstd (.img.zst), which balenaEtcher cannot flash — Etcher has no native zstd support (etcher#2856 is still open), forcing users to manually decompress first. Raspberry Pi Imager's zstd path has also been flaky.

Description

Switch release disk-image compression from zstd to xz (.img.xz, xz -9e -T0).

  • xz is the only format flashed natively out of the box by both Raspberry Pi Imager and balenaEtcher, and is the format official Raspberry Pi OS images already ship as.
  • Measured on a real pi4-64 image (4.67 GB raw): xz is ~12% smaller than the current zstd (794 MB vs 907 MB). Kept -T0 (multi-threaded) — single-threaded shaved only ~0.7% more but took ~4× longer.
  • Updates the rpi-imager JSON generator + its tests to match .img.xz assets.
  • Updates the install docs / FAQ and drops the now-unnecessary "decompress first for Etcher" workaround.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

- Package release images as `.img.xz` (`xz -9e -T0`) instead of `.img.zst`
- Fixes flashing in balenaEtcher, which has no native zstd support
- ~12% smaller downloads than zstd -19 (794 MB vs 907 MB on pi4-64)
- Update rpi-imager JSON generator + tests to match `.img.xz` assets
- Update install docs/FAQ; drop the Etcher "decompress first" workaround

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson requested a review from a team as a code owner July 2, 2026 09:55
@vpetersson vpetersson self-assigned this Jul 2, 2026
@vpetersson vpetersson requested a review from Copilot July 2, 2026 09:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Switches release disk-image compression from zstd (.img.zst) to xz (.img.xz) so that release artifacts can be flashed directly by both Raspberry Pi Imager and balenaEtcher, and updates the Raspberry Pi Imager JSON tooling + docs accordingly.

Changes:

  • Update the disk-image build workflow to produce .img.xz artifacts (and matching checksums/metadata).
  • Update the Raspberry Pi Imager JSON generator (and tests) to discover .img.xz assets.
  • Update website “get started” + installation/FAQ docs to reference .img.xz and xz -d extraction.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/layouts/_default/get-started.html Updates the website “Pre-built disk images” blurb to reference .img.xz instead of .zst.
website/data/faq.yaml Updates macOS Imager FAQ guidance to reference .img.xz and xz -d.
website/content/docs/installation-options.md Updates installation docs to reflect .img.xz assets and removes Etcher-specific zstd workaround.
tools/raspberry_pi_imager/tests/test_build_pi_imager_json.py Adjusts unit tests to expect .img.xz release assets and non-image filtering.
tools/raspberry_pi_imager/README.md Updates tool documentation to describe filtering .xz assets.
tools/raspberry_pi_imager/build_pi_imager_json.py Updates asset filtering/board parsing and metadata URL derivation for .img.xz.
.github/workflows/build-balena-disk-image.yaml Changes CI packaging from zstd to xz and updates artifact/attestation patterns accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/data/faq.yaml Outdated
Comment thread website/content/docs/installation-options.md Outdated
Addresses Copilot review on #3107.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@vpetersson vpetersson merged commit fbee7bf into master Jul 2, 2026
9 checks passed
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.

2 participants