Skip to content

Draft: main/linux-firmware: compress firmware with zstd

Newbyte requested to merge Newbyte/aports:compress-firmware into master

Uses the upstream install-zst target. ZSTD_CLEVEL=19 saves around 40 MB over the default (which is 3, I think).

  • Uncompressed: 1,0 GB
  • ZSTD_CLEVEL unset: 509,1 MB
  • ZSTD_CLEVEL=10: 494,4 MB
  • ZSTD_CLEVEL=19: 469,7 MB

xz with the default compression level was 445,8 MB, but it is slower to decompress and about as slow as ZSTD_CLEVEL=19 to compress. I didn't measure the exact time, but it felt similarly long. ZSTD_CLEVEL=10 and ZSTD_CLEVEL unset were fast to compress. These tests were conducted on an i5-6200U with 8 GB of RAM, so not the beefiest system.

Closes #15756


TODO:

  • postmarketos-mkinitfs support: https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/merge_requests/49
  • (Alpine) mkinitfs support: mkinitfs!164
  • pd-mapper support, pd-mapper moved into kernel, or ".jsn" files marked as uncompressable upstream
  • tqftpserv support, or relevant firmware marked as uncompressable upstream
  • CONFIG_FW_LOADER_COMPRESS_ZSTD enabled in linux-lts: 8ff17746
  • CONFIG_FW_LOADER_COMPRESS_ZSTD enabled in linux-edge
  • CONFIG_FW_LOADER_COMPRESS_ZSTD enabled in linux-rpi

More things?

Edited by Newbyte

Merge request reports