diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2024-10-18 23:12:19 +0900 |
---|---|---|
committer | John Kehayias <john.kehayias@protonmail.com> | 2024-10-18 14:51:28 -0400 |
commit | 8cffc6b1688dd9a933ac63b5fe934cf99d8febf9 (patch) | |
tree | d3372bbd980b0cebd7028b911cf02c532f03e7d8 | |
parent | 15fa7d02b6d57e8db30b001120f841b7d4efeb45 (diff) |
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>
-rw-r--r-- | nongnu/packages/linux.scm | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index 9731294..038027e 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm @@ -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") |