nongnu: linux-firmware: Use Zstd compression.

This halves the size of the firmware collection from 1.1 GiB to 509 MiB.

* nongnu/packages/linux.scm (linux-firmware)[phases]: Override install phase.
[native-inputs]: Add zstd.

Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
This commit is contained in:
Maxim Cournoyer 2024-10-18 23:12:19 +09:00 committed by John Kehayias
parent 15fa7d02b6
commit 8cffc6b168
No known key found for this signature in database
GPG key ID: 499097AE5EA815D9

View file

@ -26,6 +26,7 @@
;;; Copyright © 2023 Ada Stevenson <adanskana@gmail.com>
;;; Copyright © 2023 Tomas Volf <~@wolfsden.cz>
;;; Copyright © 2023 PRESFIL <presfil@protonmail.com>
;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
(define-module (nongnu packages linux)
#:use-module (gnu packages)
@ -338,8 +339,21 @@ stable, responsive and smooth desktop experience.")))
(substitute* "copy-firmware.sh"
(("./check_whence.py")
"true"))))
(delete 'configure))))
(native-inputs (list rdfind))
(delete 'configure)
(replace 'install
;; Use Zstd compression to reduce space requirements.
(lambda* (#:key (parallel-build? #t) (make-flags '())
#:allow-other-keys)
(let ((num-jobs (if parallel-build?
(number->string (parallel-job-count))
"1")))
;; Use the best 'standard' compression level.
(setenv "ZSTD_CLEVEL" "19")
;; Compress using multiple threads.
(setenv "ZSTD_NBTHREADS" num-jobs)
(apply invoke "make" "install-zst" "-j" num-jobs
make-flags)))))))
(native-inputs (list rdfind zstd))
(home-page
"https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git")
(synopsis "Nonfree firmware blobs for Linux")