Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS
@ 2024-10-19  4:59 classabbyamp
  2024-10-19  5:00 ` classabbyamp
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: classabbyamp @ 2024-10-19  4:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages linux-fw-loader-compress
https://github.com/void-linux/void-packages/pull/52686

kernels: enable CONFIG_FW_LOADER_COMPRESS
Enabling this will allow us to compress firmware files in `linux-firmware`, which provides a pretty massive storage saving for on-disk size:

```
linux-firmware            193MB  ->     24MB  (87.6%)
linux-firmware-amd         76MB  ->     26MB  (65.8%)
linux-firmware-broadcom    18MB  ->     12MB  (33.3%)
linux-firmware-intel       26MB  ->    9.9MB  (61.9%)
linux-firmware-network    615MB  ->    346MB  (43.7%)
linux-firmware-nvidia      63MB  ->     41MB  (34.9%)
linux-firmware-qualcomm   177MB  ->     71MB  (59.9%)
TOTAL                    1168MB  ->  529.9MB  (54.6%)
```

This is supported in all packaged kernels except for `linux4.19`, which will go EOL at the end of the year.

I plan on enabling compression in `linux-firmware` (the final commit in this PR) several months after merging the rest of this PR (early 2025). It probably make sense to announce this change, as it could cause unbootable systems.

#### Testing the changes
I tested the changes in this PR:

- [ ] 5.15 x86_64
- [ ] 6.1 x86_64
- [ ] 6.6 x86_64
- [ ] 6.11 aarch64 (x13s)
- [ ] 6.6 rpi

[ci skip]


A patch file from https://github.com/void-linux/void-packages/pull/52686.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-linux-fw-loader-compress-52686.patch --]
[-- Type: text/x-diff, Size: 19848 bytes --]

From 7dda31dce2ec9d777d1f9fbafbde159d23082af9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:04:13 -0400
Subject: [PATCH 01/11] linux5.4: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux5.4/files/arm-dotconfig    | 2 +-
 srcpkgs/linux5.4/files/i386-dotconfig   | 2 +-
 srcpkgs/linux5.4/files/x86_64-dotconfig | 2 +-
 srcpkgs/linux5.4/template               | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/linux5.4/files/arm-dotconfig b/srcpkgs/linux5.4/files/arm-dotconfig
index 6832ad8ebbce0d..91c3343562f362 100644
--- a/srcpkgs/linux5.4/files/arm-dotconfig
+++ b/srcpkgs/linux5.4/files/arm-dotconfig
@@ -1680,7 +1680,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 # end of Firmware loader
 
 CONFIG_WANT_DEV_COREDUMP=y
diff --git a/srcpkgs/linux5.4/files/i386-dotconfig b/srcpkgs/linux5.4/files/i386-dotconfig
index 2d60db23205798..e95465826a5db7 100644
--- a/srcpkgs/linux5.4/files/i386-dotconfig
+++ b/srcpkgs/linux5.4/files/i386-dotconfig
@@ -1972,7 +1972,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 # end of Firmware loader
 
 CONFIG_WANT_DEV_COREDUMP=y
diff --git a/srcpkgs/linux5.4/files/x86_64-dotconfig b/srcpkgs/linux5.4/files/x86_64-dotconfig
index 4c41a75aa6471e..81e1a07102280d 100644
--- a/srcpkgs/linux5.4/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.4/files/x86_64-dotconfig
@@ -2027,7 +2027,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 # end of Firmware loader
 
 CONFIG_WANT_DEV_COREDUMP=y
diff --git a/srcpkgs/linux5.4/template b/srcpkgs/linux5.4/template
index 138e1fb2b7b5c2..37af826cf206d2 100644
--- a/srcpkgs/linux5.4/template
+++ b/srcpkgs/linux5.4/template
@@ -1,7 +1,7 @@
 # Template file for 'linux5.4'
 pkgname=linux5.4
 version=5.4.266
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-only"

From 07ea8de1584d1ef696e924230c4ce0974e4b6a2c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:13:46 -0400
Subject: [PATCH 02/11] linux5.10: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux5.10/files/i386-dotconfig   | 2 +-
 srcpkgs/linux5.10/files/x86_64-dotconfig | 2 +-
 srcpkgs/linux5.10/template               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux5.10/files/i386-dotconfig b/srcpkgs/linux5.10/files/i386-dotconfig
index ad274091157581..4d5e942576bfe3 100644
--- a/srcpkgs/linux5.10/files/i386-dotconfig
+++ b/srcpkgs/linux5.10/files/i386-dotconfig
@@ -2060,7 +2060,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.10/files/x86_64-dotconfig b/srcpkgs/linux5.10/files/x86_64-dotconfig
index 18aa3481eeeaab..83a74ba5b7b597 100644
--- a/srcpkgs/linux5.10/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.10/files/x86_64-dotconfig
@@ -2124,7 +2124,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.10/template b/srcpkgs/linux5.10/template
index fa4cb192f6af1b..9f63b1a1eca715 100644
--- a/srcpkgs/linux5.10/template
+++ b/srcpkgs/linux5.10/template
@@ -1,7 +1,7 @@
 # Template file for 'linux5.10'
 pkgname=linux5.10
 version=5.10.219
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="GPL-2.0-only"

From a250c16ff81025ad0f0a95d0c3582cc7fe1df609 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:25:10 -0400
Subject: [PATCH 03/11] linux5.15: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux5.15/files/i386-dotconfig   | 2 +-
 srcpkgs/linux5.15/files/x86_64-dotconfig | 2 +-
 srcpkgs/linux5.15/template               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux5.15/files/i386-dotconfig b/srcpkgs/linux5.15/files/i386-dotconfig
index f43758e7b23aba..581f7c51a72f8b 100644
--- a/srcpkgs/linux5.15/files/i386-dotconfig
+++ b/srcpkgs/linux5.15/files/i386-dotconfig
@@ -2073,7 +2073,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.15/files/x86_64-dotconfig b/srcpkgs/linux5.15/files/x86_64-dotconfig
index 47c6415caa2643..e617fc722e957a 100644
--- a/srcpkgs/linux5.15/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.15/files/x86_64-dotconfig
@@ -2142,7 +2142,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.15/template b/srcpkgs/linux5.15/template
index 816dff7a9c1563..9f9aaa48b8305d 100644
--- a/srcpkgs/linux5.15/template
+++ b/srcpkgs/linux5.15/template
@@ -1,7 +1,7 @@
 # Template file for 'linux5.15'
 pkgname=linux5.15
 version=5.15.161
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="GPL-2.0-only"

From db14151bff00c899f13972198f40fbe78045888a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:35:47 -0400
Subject: [PATCH 04/11] linux6.1: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.1/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.1/files/x86_64-dotconfig | 4 +++-
 srcpkgs/linux6.1/template               | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index ca9a5db42efefb..4d136ed9c9bc9f 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -2077,7 +2077,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index 041097afbd0c4c..6ab2f0e9db65fe 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -2162,7 +2162,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.1/template b/srcpkgs/linux6.1/template
index 181a1f0bc724e7..2fd0dc94a89801 100644
--- a/srcpkgs/linux6.1/template
+++ b/srcpkgs/linux6.1/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.1'
 pkgname=linux6.1
 version=6.1.106
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-only"

From 2bb9ddef3fe69de8323e1ed4b469d5994e1ef09e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:44:53 -0400
Subject: [PATCH 05/11] linux6.6: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.6/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.6/files/x86_64-dotconfig | 4 +++-
 srcpkgs/linux6.6/template               | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux6.6/files/i386-dotconfig b/srcpkgs/linux6.6/files/i386-dotconfig
index 07be318d6cfa8c..86851adbead84c 100644
--- a/srcpkgs/linux6.6/files/i386-dotconfig
+++ b/srcpkgs/linux6.6/files/i386-dotconfig
@@ -2111,7 +2111,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.6/files/x86_64-dotconfig b/srcpkgs/linux6.6/files/x86_64-dotconfig
index 40f9a7d7b6d962..5113cd5923d810 100644
--- a/srcpkgs/linux6.6/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.6/files/x86_64-dotconfig
@@ -2261,7 +2261,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.6/template b/srcpkgs/linux6.6/template
index 614bd646c527c5..352c6c86c6e071 100644
--- a/srcpkgs/linux6.6/template
+++ b/srcpkgs/linux6.6/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.6'
 pkgname=linux6.6
 version=6.6.56
-revision=2
+revision=3
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

From 98ad98d3661f2725f62d9306341daf9398d0e8f4 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:48:15 -0400
Subject: [PATCH 06/11] linux6.10: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.10/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.10/files/x86_64-dotconfig | 4 +++-
 srcpkgs/linux6.10/template               | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux6.10/files/i386-dotconfig b/srcpkgs/linux6.10/files/i386-dotconfig
index 2e4ac7c993bff1..6984675de148af 100644
--- a/srcpkgs/linux6.10/files/i386-dotconfig
+++ b/srcpkgs/linux6.10/files/i386-dotconfig
@@ -2137,7 +2137,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.10/files/x86_64-dotconfig b/srcpkgs/linux6.10/files/x86_64-dotconfig
index 701f6a5f961bb2..bbe413bb345a1d 100644
--- a/srcpkgs/linux6.10/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.10/files/x86_64-dotconfig
@@ -2298,7 +2298,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.10/template b/srcpkgs/linux6.10/template
index 49b36fe2ab5aa1..f5575785620b08 100644
--- a/srcpkgs/linux6.10/template
+++ b/srcpkgs/linux6.10/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.10'
 pkgname=linux6.10
 version=6.10.14
-revision=2
+revision=3
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

From c1fea4f7b0aea7c6c7b6511e283ef25853430e2f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:48:16 -0400
Subject: [PATCH 07/11] linux6.11: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.11/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.11/files/x86_64-dotconfig | 4 +++-
 srcpkgs/linux6.11/template               | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux6.11/files/i386-dotconfig b/srcpkgs/linux6.11/files/i386-dotconfig
index 176f19271b9d5e..559b8cfec2ffc6 100644
--- a/srcpkgs/linux6.11/files/i386-dotconfig
+++ b/srcpkgs/linux6.11/files/i386-dotconfig
@@ -2145,7 +2145,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.11/files/x86_64-dotconfig b/srcpkgs/linux6.11/files/x86_64-dotconfig
index 599190045d2415..55e859b28cd18b 100644
--- a/srcpkgs/linux6.11/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.11/files/x86_64-dotconfig
@@ -2309,7 +2309,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.11/template b/srcpkgs/linux6.11/template
index 29cf9df48c86d4..6bfeab262fc8a2 100644
--- a/srcpkgs/linux6.11/template
+++ b/srcpkgs/linux6.11/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.11'
 pkgname=linux6.11
 version=6.11.4
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

From 3a65540c81dacd34c57d63638d188efedbf5db0b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:56:13 -0400
Subject: [PATCH 08/11] pinephone-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/pinephone-kernel/files/pinephone-dotconfig | 4 +++-
 srcpkgs/pinephone-kernel/template                  | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
index eb3a128660e668..787fbd293a291b 100644
--- a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
+++ b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
@@ -1370,7 +1370,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/pinephone-kernel/template b/srcpkgs/pinephone-kernel/template
index fd7028805e286f..66cd5eb2f58786 100644
--- a/srcpkgs/pinephone-kernel/template
+++ b/srcpkgs/pinephone-kernel/template
@@ -7,7 +7,8 @@ short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="John Sullivan <jsullivan@csumb.edu>"
 license="GPL-2.0-only"
 homepage="https://www.kernel.org"
-distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+#distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+distfiles="https://sources.voidlinux.org/pinephone-kernel-${version}/${_tag}.tar.gz"
 checksum=2a7a8d73b5477fb1d191a1d2c7bfb927829781311d0492f1154f8609b9263faf
 python_version=3
 

From 2b9020d7a6c94d7bd154471577787ce7b220e21d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:02:52 -0400
Subject: [PATCH 09/11] pinebookpro-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/pinebookpro-kernel/files/dotconfig | 4 +++-
 srcpkgs/pinebookpro-kernel/template        | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinebookpro-kernel/files/dotconfig b/srcpkgs/pinebookpro-kernel/files/dotconfig
index 8df4e836e3db40..4bd28d02cab9e5 100644
--- a/srcpkgs/pinebookpro-kernel/files/dotconfig
+++ b/srcpkgs/pinebookpro-kernel/files/dotconfig
@@ -2009,7 +2009,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/pinebookpro-kernel/template b/srcpkgs/pinebookpro-kernel/template
index 929d5b4d81bda0..61e3919807d3d8 100644
--- a/srcpkgs/pinebookpro-kernel/template
+++ b/srcpkgs/pinebookpro-kernel/template
@@ -1,7 +1,7 @@
 # Template file for 'pinebookpro-kernel'
 pkgname=pinebookpro-kernel
 version=6.1.9
-revision=1
+revision=2
 archs="aarch64*"
 short_desc="Linux kernel for Pinebook Pro"
 maintainer="Cameron Nemo <cam@nohom.org>"

From 40dc99d856ce5ae9b2bbaa4d3198ea5b0e04d31c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:03:16 -0400
Subject: [PATCH 10/11] rpi-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/rpi-kernel/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index a7202d02d6cc3c..efa6d520208e85 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -13,7 +13,7 @@
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
 pkgname=rpi-kernel
 version=6.6.42
-revision=1
+revision=2
 _githash=bfbd468e81defa70d4356a1a3e467cc5d67ca89b
 archs="aarch64* armv6l* armv7l*"
 build_wrksrc="build-rpi"
@@ -139,6 +139,9 @@ _configure() {
 	CONFIG_F2FS_CHECK_FS=y
 	CONFIG_F2FS_FS_COMPRESSION=y
 	CONFIG_F2FS_UNFAIR_RWSEM=y
+	CONFIG_FW_LOADER_COMPRESS=y
+	CONFIG_FW_LOADER_COMPRESS_XZ=y
+	CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 	!
 
 	while read -r line; do

From a4b6b5cf144f9d817cbf284f698874675dad4b18 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:07:24 -0400
Subject: [PATCH 11/11] NOMERGE: linux-firmware: compress firmware

---
 srcpkgs/linux-firmware/template | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/linux-firmware/template b/srcpkgs/linux-firmware/template
index 7c2226c9697ba2..dffe6d0d4b5a44 100644
--- a/srcpkgs/linux-firmware/template
+++ b/srcpkgs/linux-firmware/template
@@ -1,8 +1,8 @@
 # Template file for 'linux-firmware'
 pkgname=linux-firmware
 version=20241017
-revision=1
-hostmakedepends="rdfind which"
+revision=2
+hostmakedepends="rdfind which zstd"
 depends="linux-firmware-amd>=${version}_${revision} linux-firmware-network>=${version}_${revision}"
 short_desc="Binary firmware blobs for the Linux kernel"
 maintainer="classabbyamp <void@placeviolette.net>"
@@ -15,7 +15,8 @@ python_version=3
 nostrip=yes
 
 do_install() {
-	make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR=$DESTDIR
+	env ZSTD_CLEVEL=9 ZSTD_NBTHREADS="$XBPS_MAKEJOBS" \
+		make install-zst dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
 
 	for _l in LICEN* WHENCE
 	do
@@ -109,7 +110,7 @@ linux-firmware-network_package() {
 			# Cavium LiquidIO NIC
 			liquidio
 			# Mediatek WLAN/bluetooth
-			"mt7*.bin"
+			"mt7*.bin*"
 			# Mellanox ethernet
 			mellanox
 			# Marvell WLAN/bluetooth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
@ 2024-10-19  5:00 ` classabbyamp
  2024-12-12  7:08 ` [PR PATCH] [Updated] [RFC] " classabbyamp
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2024-10-19  5:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/52686#issuecomment-2423571846

Comment:
rfc @void-linux/pkg-committers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
  2024-10-19  5:00 ` classabbyamp
@ 2024-12-12  7:08 ` classabbyamp
  2024-12-12 12:10 ` leahneukirchen
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2024-12-12  7:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages linux-fw-loader-compress
https://github.com/void-linux/void-packages/pull/52686

[RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
Enabling this will allow us to compress firmware files in `linux-firmware`, which provides a pretty massive storage saving for on-disk size:

```
linux-firmware            193MB  ->     24MB  (87.6%)
linux-firmware-amd         76MB  ->     26MB  (65.8%)
linux-firmware-broadcom    18MB  ->     12MB  (33.3%)
linux-firmware-intel       26MB  ->    9.9MB  (61.9%)
linux-firmware-network    615MB  ->    346MB  (43.7%)
linux-firmware-nvidia      63MB  ->     41MB  (34.9%)
linux-firmware-qualcomm   177MB  ->     71MB  (59.9%)
TOTAL                    1168MB  ->  529.9MB  (54.6%)
```

This is supported in all packaged kernels.

I plan on enabling compression in `linux-firmware` (the final commit in this PR) several months after merging the rest of this PR (early 2025). It probably make sense to announce this change, as it could cause unbootable systems.

#### Testing the changes
I tested the changes in this PR:

- [ ] 5.15 x86_64
- [ ] 6.1 x86_64
- [ ] 6.6 x86_64
- [ ] 6.12 x86_64
- [ ] 6.12 aarch64 (x13s)
- [x] 6.6 rpi (does not need linux-firmware, still boots)

[ci skip]


A patch file from https://github.com/void-linux/void-packages/pull/52686.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-linux-fw-loader-compress-52686.patch --]
[-- Type: text/x-diff, Size: 17346 bytes --]

From 723a3ffe14711ae17a35893c3b3404c9e1d8ae24 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:04:13 -0400
Subject: [PATCH 01/10] linux5.4: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux5.4/files/arm-dotconfig    | 2 +-
 srcpkgs/linux5.4/files/i386-dotconfig   | 2 +-
 srcpkgs/linux5.4/files/x86_64-dotconfig | 2 +-
 srcpkgs/linux5.4/template               | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/linux5.4/files/arm-dotconfig b/srcpkgs/linux5.4/files/arm-dotconfig
index 6832ad8ebbce0d..91c3343562f362 100644
--- a/srcpkgs/linux5.4/files/arm-dotconfig
+++ b/srcpkgs/linux5.4/files/arm-dotconfig
@@ -1680,7 +1680,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 # end of Firmware loader
 
 CONFIG_WANT_DEV_COREDUMP=y
diff --git a/srcpkgs/linux5.4/files/i386-dotconfig b/srcpkgs/linux5.4/files/i386-dotconfig
index 2d60db23205798..e95465826a5db7 100644
--- a/srcpkgs/linux5.4/files/i386-dotconfig
+++ b/srcpkgs/linux5.4/files/i386-dotconfig
@@ -1972,7 +1972,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 # end of Firmware loader
 
 CONFIG_WANT_DEV_COREDUMP=y
diff --git a/srcpkgs/linux5.4/files/x86_64-dotconfig b/srcpkgs/linux5.4/files/x86_64-dotconfig
index 4c41a75aa6471e..81e1a07102280d 100644
--- a/srcpkgs/linux5.4/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.4/files/x86_64-dotconfig
@@ -2027,7 +2027,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 # end of Firmware loader
 
 CONFIG_WANT_DEV_COREDUMP=y
diff --git a/srcpkgs/linux5.4/template b/srcpkgs/linux5.4/template
index 138e1fb2b7b5c2..37af826cf206d2 100644
--- a/srcpkgs/linux5.4/template
+++ b/srcpkgs/linux5.4/template
@@ -1,7 +1,7 @@
 # Template file for 'linux5.4'
 pkgname=linux5.4
 version=5.4.266
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-only"

From 6f960d876b6e6493c24c79eb738f1c41f7ff8d2c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:13:46 -0400
Subject: [PATCH 02/10] linux5.10: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux5.10/files/i386-dotconfig   | 2 +-
 srcpkgs/linux5.10/files/x86_64-dotconfig | 2 +-
 srcpkgs/linux5.10/template               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux5.10/files/i386-dotconfig b/srcpkgs/linux5.10/files/i386-dotconfig
index 3842e7f964ae60..5ccce862e2379f 100644
--- a/srcpkgs/linux5.10/files/i386-dotconfig
+++ b/srcpkgs/linux5.10/files/i386-dotconfig
@@ -2060,7 +2060,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.10/files/x86_64-dotconfig b/srcpkgs/linux5.10/files/x86_64-dotconfig
index 674b0265704cb6..c4ba5eac0300d1 100644
--- a/srcpkgs/linux5.10/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.10/files/x86_64-dotconfig
@@ -2124,7 +2124,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.10/template b/srcpkgs/linux5.10/template
index e716510d01e416..8582d910a00772 100644
--- a/srcpkgs/linux5.10/template
+++ b/srcpkgs/linux5.10/template
@@ -1,7 +1,7 @@
 # Template file for 'linux5.10'
 pkgname=linux5.10
 version=5.10.228
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="GPL-2.0-only"

From d950d68dc6ceb0b908f4286f078388d3c1aace71 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:25:10 -0400
Subject: [PATCH 03/10] linux5.15: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux5.15/files/i386-dotconfig   | 2 +-
 srcpkgs/linux5.15/files/x86_64-dotconfig | 2 +-
 srcpkgs/linux5.15/template               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux5.15/files/i386-dotconfig b/srcpkgs/linux5.15/files/i386-dotconfig
index 2ec06377d3ba02..b9fca424503c77 100644
--- a/srcpkgs/linux5.15/files/i386-dotconfig
+++ b/srcpkgs/linux5.15/files/i386-dotconfig
@@ -2073,7 +2073,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.15/files/x86_64-dotconfig b/srcpkgs/linux5.15/files/x86_64-dotconfig
index 4a8937078be852..ec56d8a415ff15 100644
--- a/srcpkgs/linux5.15/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.15/files/x86_64-dotconfig
@@ -2142,7 +2142,7 @@ CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
 CONFIG_FW_CACHE=y
 # end of Firmware loader
 
diff --git a/srcpkgs/linux5.15/template b/srcpkgs/linux5.15/template
index b63bee1fa860dc..051b0d3fe6d9ce 100644
--- a/srcpkgs/linux5.15/template
+++ b/srcpkgs/linux5.15/template
@@ -1,7 +1,7 @@
 # Template file for 'linux5.15'
 pkgname=linux5.15
 version=5.15.169
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="GPL-2.0-only"

From 98e1460446dd91d7e761df524b5b4f9cfba9fa66 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:35:47 -0400
Subject: [PATCH 04/10] linux6.1: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.1/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.1/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 4d34de3107a6ab..24d1e27cf235ea 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -2077,7 +2077,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index 055e5f610c2754..1f8e5b3af5e31e 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -2162,7 +2162,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From 69f37d5a45da4a817d32afe1b3b17c7f09737ef3 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:44:53 -0400
Subject: [PATCH 05/10] linux6.6: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.6/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.6/files/x86_64-dotconfig | 4 +++-
 srcpkgs/linux6.6/template               | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux6.6/files/i386-dotconfig b/srcpkgs/linux6.6/files/i386-dotconfig
index 3a9f55726068ef..70024255f156a7 100644
--- a/srcpkgs/linux6.6/files/i386-dotconfig
+++ b/srcpkgs/linux6.6/files/i386-dotconfig
@@ -2111,7 +2111,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.6/files/x86_64-dotconfig b/srcpkgs/linux6.6/files/x86_64-dotconfig
index 8c491250a4a430..ad112ffd99e2dd 100644
--- a/srcpkgs/linux6.6/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.6/files/x86_64-dotconfig
@@ -2260,7 +2260,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.6/template b/srcpkgs/linux6.6/template
index 0f7c06b6a93e68..18d9eb4f57170a 100644
--- a/srcpkgs/linux6.6/template
+++ b/srcpkgs/linux6.6/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.6'
 pkgname=linux6.6
 version=6.6.64
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

From d81bed4ab862b536d7c9fd263c553ce89b5e3136 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 11 Dec 2024 22:51:12 -0500
Subject: [PATCH 06/10] linux6.12: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.12/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.12/files/x86_64-dotconfig | 4 +++-
 srcpkgs/linux6.12/template               | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/linux6.12/files/i386-dotconfig b/srcpkgs/linux6.12/files/i386-dotconfig
index 5c8d5a707da6ea..6af76b9f5fd622 100644
--- a/srcpkgs/linux6.12/files/i386-dotconfig
+++ b/srcpkgs/linux6.12/files/i386-dotconfig
@@ -2170,7 +2170,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.12/files/x86_64-dotconfig b/srcpkgs/linux6.12/files/x86_64-dotconfig
index 101fb382abe160..dd9d645d6433ca 100644
--- a/srcpkgs/linux6.12/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.12/files/x86_64-dotconfig
@@ -2338,7 +2338,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.12/template b/srcpkgs/linux6.12/template
index c65a6f798cd14e..be61edfd77d3b7 100644
--- a/srcpkgs/linux6.12/template
+++ b/srcpkgs/linux6.12/template
@@ -1,7 +1,7 @@
 # Template file for 'linux6.12'
 pkgname=linux6.12
 version=6.12.4
-revision=1
+revision=2
 short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-only"

From 811128ef9ccdd508785039c0b8bc51a5cc380c0a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:56:13 -0400
Subject: [PATCH 07/10] pinephone-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/pinephone-kernel/files/pinephone-dotconfig | 4 +++-
 srcpkgs/pinephone-kernel/template                  | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
index eb3a128660e668..787fbd293a291b 100644
--- a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
+++ b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
@@ -1370,7 +1370,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/pinephone-kernel/template b/srcpkgs/pinephone-kernel/template
index fd7028805e286f..66cd5eb2f58786 100644
--- a/srcpkgs/pinephone-kernel/template
+++ b/srcpkgs/pinephone-kernel/template
@@ -7,7 +7,8 @@ short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="John Sullivan <jsullivan@csumb.edu>"
 license="GPL-2.0-only"
 homepage="https://www.kernel.org"
-distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+#distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+distfiles="https://sources.voidlinux.org/pinephone-kernel-${version}/${_tag}.tar.gz"
 checksum=2a7a8d73b5477fb1d191a1d2c7bfb927829781311d0492f1154f8609b9263faf
 python_version=3
 

From cfb54c14563ddca04ab5c1d1d4953fa3a2975b54 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:02:52 -0400
Subject: [PATCH 08/10] pinebookpro-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/pinebookpro-kernel/files/dotconfig | 4 +++-
 srcpkgs/pinebookpro-kernel/template        | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinebookpro-kernel/files/dotconfig b/srcpkgs/pinebookpro-kernel/files/dotconfig
index 8df4e836e3db40..4bd28d02cab9e5 100644
--- a/srcpkgs/pinebookpro-kernel/files/dotconfig
+++ b/srcpkgs/pinebookpro-kernel/files/dotconfig
@@ -2009,7 +2009,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/pinebookpro-kernel/template b/srcpkgs/pinebookpro-kernel/template
index 929d5b4d81bda0..61e3919807d3d8 100644
--- a/srcpkgs/pinebookpro-kernel/template
+++ b/srcpkgs/pinebookpro-kernel/template
@@ -1,7 +1,7 @@
 # Template file for 'pinebookpro-kernel'
 pkgname=pinebookpro-kernel
 version=6.1.9
-revision=1
+revision=2
 archs="aarch64*"
 short_desc="Linux kernel for Pinebook Pro"
 maintainer="Cameron Nemo <cam@nohom.org>"

From 4e327cd79674095b5c6d1a882da3d5ac5978b009 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:03:16 -0400
Subject: [PATCH 09/10] rpi-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/rpi-kernel/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index a7202d02d6cc3c..efa6d520208e85 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -13,7 +13,7 @@
 # Upstream documentation: https://www.raspberrypi.com/documentation/computers/linux_kernel.html
 pkgname=rpi-kernel
 version=6.6.42
-revision=1
+revision=2
 _githash=bfbd468e81defa70d4356a1a3e467cc5d67ca89b
 archs="aarch64* armv6l* armv7l*"
 build_wrksrc="build-rpi"
@@ -139,6 +139,9 @@ _configure() {
 	CONFIG_F2FS_CHECK_FS=y
 	CONFIG_F2FS_FS_COMPRESSION=y
 	CONFIG_F2FS_UNFAIR_RWSEM=y
+	CONFIG_FW_LOADER_COMPRESS=y
+	CONFIG_FW_LOADER_COMPRESS_XZ=y
+	CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 	!
 
 	while read -r line; do

From decf0d6040489ece90c1854f56b8564918957d90 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:07:24 -0400
Subject: [PATCH 10/10] NOMERGE: linux-firmware: compress firmware

---
 srcpkgs/linux-firmware/template | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/linux-firmware/template b/srcpkgs/linux-firmware/template
index 4b6fe77d83cb4a..aee187445a668f 100644
--- a/srcpkgs/linux-firmware/template
+++ b/srcpkgs/linux-firmware/template
@@ -1,8 +1,8 @@
 # Template file for 'linux-firmware'
 pkgname=linux-firmware
 version=20241110
-revision=1
-hostmakedepends="rdfind which"
+revision=2
+hostmakedepends="rdfind which zstd"
 depends="linux-firmware-amd>=${version}_${revision} linux-firmware-network>=${version}_${revision}"
 short_desc="Binary firmware blobs for the Linux kernel"
 maintainer="classabbyamp <void@placeviolette.net>"
@@ -15,7 +15,8 @@ python_version=3
 nostrip=yes
 
 do_install() {
-	make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR=$DESTDIR
+	env ZSTD_CLEVEL=9 ZSTD_NBTHREADS="$XBPS_MAKEJOBS" \
+		make install-zst dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
 
 	for _l in LICEN* WHENCE
 	do
@@ -109,7 +110,7 @@ linux-firmware-network_package() {
 			# Cavium LiquidIO NIC
 			liquidio
 			# Mediatek WLAN/bluetooth
-			"mt7*.bin"
+			"mt7*.bin*"
 			# Mellanox ethernet
 			mellanox
 			# Marvell WLAN/bluetooth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
  2024-10-19  5:00 ` classabbyamp
  2024-12-12  7:08 ` [PR PATCH] [Updated] [RFC] " classabbyamp
@ 2024-12-12 12:10 ` leahneukirchen
  2024-12-12 23:52 ` [PR PATCH] [Updated] " classabbyamp
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: leahneukirchen @ 2024-12-12 12:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 159 bytes --]

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/52686#issuecomment-2538729614

Comment:
Very nice!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
                   ` (2 preceding siblings ...)
  2024-12-12 12:10 ` leahneukirchen
@ 2024-12-12 23:52 ` classabbyamp
  2024-12-12 23:56 ` classabbyamp
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2024-12-12 23:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages linux-fw-loader-compress
https://github.com/void-linux/void-packages/pull/52686

[RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
Enabling this will allow us to compress firmware files in `linux-firmware`, which provides a pretty massive storage saving for on-disk size:

```
linux-firmware            193MB  ->     24MB  (87.6%)
linux-firmware-amd         76MB  ->     26MB  (65.8%)
linux-firmware-broadcom    18MB  ->     12MB  (33.3%)
linux-firmware-intel       26MB  ->    9.9MB  (61.9%)
linux-firmware-network    615MB  ->    346MB  (43.7%)
linux-firmware-nvidia      63MB  ->     41MB  (34.9%)
linux-firmware-qualcomm   177MB  ->     71MB  (59.9%)
TOTAL                    1168MB  ->  529.9MB  (54.6%)
```

This is supported in all packaged kernels.

I plan on enabling compression in `linux-firmware` (the final commit in this PR) several months after merging the rest of this PR (early 2025). It probably make sense to announce this change, as it could cause unbootable systems.

#### Testing the changes
I tested the changes in this PR:

- [ ] 5.4 x86_64
- [ ] 5.10 x86_64
- [ ] 5.15 x86_64
- [x] 6.1 x86_64
- [x] 6.6 x86_64
- [x] 6.12 x86_64
- [ ] 6.12 aarch64 (x13s)
- [x] 6.6 rpi (does not need linux-firmware, still boots)

[ci skip]


A patch file from https://github.com/void-linux/void-packages/pull/52686.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-linux-fw-loader-compress-52686.patch --]
[-- Type: text/x-diff, Size: 10277 bytes --]

From 83ba0616c3162f8be38e416df022a58977f423b6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:35:47 -0400
Subject: [PATCH 1/7] linux6.1: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.1/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.1/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 4d34de3107a6ab..24d1e27cf235ea 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -2077,7 +2077,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index 055e5f610c2754..1f8e5b3af5e31e 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -2162,7 +2162,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From 3a5e67e7df73a8bb0da9daa12a559ae17a51fb58 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:44:53 -0400
Subject: [PATCH 2/7] linux6.6: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.6/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.6/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.6/files/i386-dotconfig b/srcpkgs/linux6.6/files/i386-dotconfig
index 3a9f55726068ef..70024255f156a7 100644
--- a/srcpkgs/linux6.6/files/i386-dotconfig
+++ b/srcpkgs/linux6.6/files/i386-dotconfig
@@ -2111,7 +2111,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.6/files/x86_64-dotconfig b/srcpkgs/linux6.6/files/x86_64-dotconfig
index 8c491250a4a430..ad112ffd99e2dd 100644
--- a/srcpkgs/linux6.6/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.6/files/x86_64-dotconfig
@@ -2260,7 +2260,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From d509d55f97ef615ef2701a74464fe8c9d926c7f2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 11 Dec 2024 22:51:12 -0500
Subject: [PATCH 3/7] linux6.12: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.12/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.12/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.12/files/i386-dotconfig b/srcpkgs/linux6.12/files/i386-dotconfig
index 5c8d5a707da6ea..6af76b9f5fd622 100644
--- a/srcpkgs/linux6.12/files/i386-dotconfig
+++ b/srcpkgs/linux6.12/files/i386-dotconfig
@@ -2170,7 +2170,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.12/files/x86_64-dotconfig b/srcpkgs/linux6.12/files/x86_64-dotconfig
index 101fb382abe160..dd9d645d6433ca 100644
--- a/srcpkgs/linux6.12/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.12/files/x86_64-dotconfig
@@ -2338,7 +2338,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From d9282c1d07af58325dd770aef940222f743487e0 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:56:13 -0400
Subject: [PATCH 4/7] pinephone-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/pinephone-kernel/files/pinephone-dotconfig | 4 +++-
 srcpkgs/pinephone-kernel/template                  | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
index eb3a128660e668..787fbd293a291b 100644
--- a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
+++ b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
@@ -1370,7 +1370,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/pinephone-kernel/template b/srcpkgs/pinephone-kernel/template
index fd7028805e286f..66cd5eb2f58786 100644
--- a/srcpkgs/pinephone-kernel/template
+++ b/srcpkgs/pinephone-kernel/template
@@ -7,7 +7,8 @@ short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="John Sullivan <jsullivan@csumb.edu>"
 license="GPL-2.0-only"
 homepage="https://www.kernel.org"
-distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+#distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+distfiles="https://sources.voidlinux.org/pinephone-kernel-${version}/${_tag}.tar.gz"
 checksum=2a7a8d73b5477fb1d191a1d2c7bfb927829781311d0492f1154f8609b9263faf
 python_version=3
 

From 2090f1d21a0e4ce79e7c2cdcf7659d1163e94416 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:02:52 -0400
Subject: [PATCH 5/7] pinebookpro-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/pinebookpro-kernel/files/dotconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/pinebookpro-kernel/files/dotconfig b/srcpkgs/pinebookpro-kernel/files/dotconfig
index 8df4e836e3db40..4bd28d02cab9e5 100644
--- a/srcpkgs/pinebookpro-kernel/files/dotconfig
+++ b/srcpkgs/pinebookpro-kernel/files/dotconfig
@@ -2009,7 +2009,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader

From de3e20e8c7a0066e0d0632a50f20e292f14cad56 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:03:16 -0400
Subject: [PATCH 6/7] rpi-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/rpi-kernel/template | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index a7202d02d6cc3c..627999c74e651a 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -139,6 +139,9 @@ _configure() {
 	CONFIG_F2FS_CHECK_FS=y
 	CONFIG_F2FS_FS_COMPRESSION=y
 	CONFIG_F2FS_UNFAIR_RWSEM=y
+	CONFIG_FW_LOADER_COMPRESS=y
+	CONFIG_FW_LOADER_COMPRESS_XZ=y
+	CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 	!
 
 	while read -r line; do

From 98e577f69218034735b28301e583be6c66f688bd Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:07:24 -0400
Subject: [PATCH 7/7] linux-firmware: update to 20241210.

add build option for compression that will be made default at a later date.
---
 srcpkgs/linux-firmware/template | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/linux-firmware/template b/srcpkgs/linux-firmware/template
index 4b6fe77d83cb4a..8e9352a9214cba 100644
--- a/srcpkgs/linux-firmware/template
+++ b/srcpkgs/linux-firmware/template
@@ -1,8 +1,8 @@
 # Template file for 'linux-firmware'
 pkgname=linux-firmware
-version=20241110
+version=20241210
 revision=1
-hostmakedepends="rdfind which"
+hostmakedepends="rdfind which $(vopt_if compressed zstd)"
 depends="linux-firmware-amd>=${version}_${revision} linux-firmware-network>=${version}_${revision}"
 short_desc="Binary firmware blobs for the Linux kernel"
 maintainer="classabbyamp <void@placeviolette.net>"
@@ -10,12 +10,20 @@ license="custom:see /usr/share/licenses/linux-firmware"
 homepage="https://www.kernel.org/"
 changelog="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/log/"
 distfiles="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${version}.tar.gz"
-checksum=c8a561dfdbd54157692fe166b84a173f9bc01f89c78f6196863beea2450e4938
+checksum=c7b83ae05d9943ab7f09e18e3c673ea8a55402f96e3b059a7d05b88c81670b78
 python_version=3
 nostrip=yes
 
+build_options="compressed"
+desc_option_compressed="compress firmware with zstd"
+
 do_install() {
-	make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR=$DESTDIR
+	if [ -n "$build_option_compressed" ]; then
+		env ZSTD_CLEVEL=9 ZSTD_NBTHREADS="$XBPS_MAKEJOBS" \
+			make install-zst dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
+	else
+		make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
+	fi
 
 	for _l in LICEN* WHENCE
 	do
@@ -109,7 +117,7 @@ linux-firmware-network_package() {
 			# Cavium LiquidIO NIC
 			liquidio
 			# Mediatek WLAN/bluetooth
-			"mt7*.bin"
+			"mt7*.bin*"
 			# Mellanox ethernet
 			mellanox
 			# Marvell WLAN/bluetooth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
                   ` (3 preceding siblings ...)
  2024-12-12 23:52 ` [PR PATCH] [Updated] " classabbyamp
@ 2024-12-12 23:56 ` classabbyamp
  2024-12-21 14:05 ` [PR PATCH] [Updated] " classabbyamp
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2024-12-12 23:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/52686#issuecomment-2540240646

Comment:
because 5.x kernels have issues, I am just going to enable the kconfig option in 6.x kernels, so that when they are next built, they get the new options. Enabling the `compressed` build option in linux-firmware will have to wait until 5.x kernels are gone unless the issues are otherwise resolved.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
                   ` (4 preceding siblings ...)
  2024-12-12 23:56 ` classabbyamp
@ 2024-12-21 14:05 ` classabbyamp
  2024-12-21 14:06 ` classabbyamp
  2024-12-21 14:08 ` [PR PATCH] [Merged]: " classabbyamp
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2024-12-21 14:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages linux-fw-loader-compress
https://github.com/void-linux/void-packages/pull/52686

[RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
Enabling this will allow us to compress firmware files in `linux-firmware`, which provides a pretty massive storage saving for on-disk size:

```
linux-firmware            193MB  ->     24MB  (87.6%)
linux-firmware-amd         76MB  ->     26MB  (65.8%)
linux-firmware-broadcom    18MB  ->     12MB  (33.3%)
linux-firmware-intel       26MB  ->    9.9MB  (61.9%)
linux-firmware-network    615MB  ->    346MB  (43.7%)
linux-firmware-nvidia      63MB  ->     41MB  (34.9%)
linux-firmware-qualcomm   177MB  ->     71MB  (59.9%)
TOTAL                    1168MB  ->  529.9MB  (54.6%)
```

This is supported in all packaged kernels.

I plan on enabling compression in `linux-firmware` (the final commit in this PR) several months after merging the rest of this PR (early 2025). It probably make sense to announce this change, as it could cause unbootable systems.

#### Testing the changes
I tested the changes in this PR:

- [ ] 5.4 x86_64 - amdgpu fails
- [ ] 5.10 x86_64 - amdgpu fails
- [ ] 5.15 x86_64 - amdgpu fails
- [x] 6.1 x86_64
- [x] 6.6 x86_64
- [x] 6.12 x86_64
- [ ] 6.12 aarch64 (x13s)
- [x] 6.6 rpi (does not need linux-firmware, still boots)


[ci skip]


A patch file from https://github.com/void-linux/void-packages/pull/52686.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-linux-fw-loader-compress-52686.patch --]
[-- Type: text/x-diff, Size: 9345 bytes --]

From 524f2c9d748753af3f7a495fedf17565ce599611 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:35:47 -0400
Subject: [PATCH 1/6] linux6.1: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.1/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.1/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 4d34de3107a6ab..24d1e27cf235ea 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -2077,7 +2077,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index 055e5f610c2754..1f8e5b3af5e31e 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -2162,7 +2162,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From 158c4fb34edb5bd3880d834269f221899434784e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:44:53 -0400
Subject: [PATCH 2/6] linux6.6: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.6/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.6/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.6/files/i386-dotconfig b/srcpkgs/linux6.6/files/i386-dotconfig
index 1f594277d9b72f..c01b7239650ce0 100644
--- a/srcpkgs/linux6.6/files/i386-dotconfig
+++ b/srcpkgs/linux6.6/files/i386-dotconfig
@@ -2111,7 +2111,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.6/files/x86_64-dotconfig b/srcpkgs/linux6.6/files/x86_64-dotconfig
index 69d58559c38596..f2a28254582b40 100644
--- a/srcpkgs/linux6.6/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.6/files/x86_64-dotconfig
@@ -2260,7 +2260,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From 1ec2f518e3fe88e0e22862fcbca2eab39babadd6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 11 Dec 2024 22:51:12 -0500
Subject: [PATCH 3/6] linux6.12: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.12/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.12/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.12/files/i386-dotconfig b/srcpkgs/linux6.12/files/i386-dotconfig
index 4a7a24a47adf31..d9c4e668cf15d0 100644
--- a/srcpkgs/linux6.12/files/i386-dotconfig
+++ b/srcpkgs/linux6.12/files/i386-dotconfig
@@ -2169,7 +2169,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.12/files/x86_64-dotconfig b/srcpkgs/linux6.12/files/x86_64-dotconfig
index 01f001642134a8..aa70b5f5e1b094 100644
--- a/srcpkgs/linux6.12/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.12/files/x86_64-dotconfig
@@ -2337,7 +2337,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From eebc8b10becec01e4c53d575fa4011d1a2dfeffa Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:56:13 -0400
Subject: [PATCH 4/6] pinephone-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/pinephone-kernel/files/pinephone-dotconfig | 4 +++-
 srcpkgs/pinephone-kernel/template                  | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
index eb3a128660e668..787fbd293a291b 100644
--- a/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
+++ b/srcpkgs/pinephone-kernel/files/pinephone-dotconfig
@@ -1370,7 +1370,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_FW_LOADER_USER_HELPER is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/pinephone-kernel/template b/srcpkgs/pinephone-kernel/template
index fd7028805e286f..66cd5eb2f58786 100644
--- a/srcpkgs/pinephone-kernel/template
+++ b/srcpkgs/pinephone-kernel/template
@@ -7,7 +7,8 @@ short_desc="Linux kernel and modules (${version%.*} series)"
 maintainer="John Sullivan <jsullivan@csumb.edu>"
 license="GPL-2.0-only"
 homepage="https://www.kernel.org"
-distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+#distfiles="https://github.com/megous/linux/archive/${_tag}.tar.gz"
+distfiles="https://sources.voidlinux.org/pinephone-kernel-${version}/${_tag}.tar.gz"
 checksum=2a7a8d73b5477fb1d191a1d2c7bfb927829781311d0492f1154f8609b9263faf
 python_version=3
 

From 251a6d116c706a3307b83229099766317c94f386 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:03:16 -0400
Subject: [PATCH 5/6] rpi-kernel: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/rpi-kernel/template | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index a7202d02d6cc3c..627999c74e651a 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -139,6 +139,9 @@ _configure() {
 	CONFIG_F2FS_CHECK_FS=y
 	CONFIG_F2FS_FS_COMPRESSION=y
 	CONFIG_F2FS_UNFAIR_RWSEM=y
+	CONFIG_FW_LOADER_COMPRESS=y
+	CONFIG_FW_LOADER_COMPRESS_XZ=y
+	CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 	!
 
 	while read -r line; do

From c227bcd126cd47207aae1affab609716607e3afd Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:07:24 -0400
Subject: [PATCH 6/6] linux-firmware: update to 20241210.

add build option for compression that will be made default at a later date.
---
 srcpkgs/linux-firmware/template | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/linux-firmware/template b/srcpkgs/linux-firmware/template
index 4b6fe77d83cb4a..8e9352a9214cba 100644
--- a/srcpkgs/linux-firmware/template
+++ b/srcpkgs/linux-firmware/template
@@ -1,8 +1,8 @@
 # Template file for 'linux-firmware'
 pkgname=linux-firmware
-version=20241110
+version=20241210
 revision=1
-hostmakedepends="rdfind which"
+hostmakedepends="rdfind which $(vopt_if compressed zstd)"
 depends="linux-firmware-amd>=${version}_${revision} linux-firmware-network>=${version}_${revision}"
 short_desc="Binary firmware blobs for the Linux kernel"
 maintainer="classabbyamp <void@placeviolette.net>"
@@ -10,12 +10,20 @@ license="custom:see /usr/share/licenses/linux-firmware"
 homepage="https://www.kernel.org/"
 changelog="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/log/"
 distfiles="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${version}.tar.gz"
-checksum=c8a561dfdbd54157692fe166b84a173f9bc01f89c78f6196863beea2450e4938
+checksum=c7b83ae05d9943ab7f09e18e3c673ea8a55402f96e3b059a7d05b88c81670b78
 python_version=3
 nostrip=yes
 
+build_options="compressed"
+desc_option_compressed="compress firmware with zstd"
+
 do_install() {
-	make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR=$DESTDIR
+	if [ -n "$build_option_compressed" ]; then
+		env ZSTD_CLEVEL=9 ZSTD_NBTHREADS="$XBPS_MAKEJOBS" \
+			make install-zst dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
+	else
+		make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
+	fi
 
 	for _l in LICEN* WHENCE
 	do
@@ -109,7 +117,7 @@ linux-firmware-network_package() {
 			# Cavium LiquidIO NIC
 			liquidio
 			# Mediatek WLAN/bluetooth
-			"mt7*.bin"
+			"mt7*.bin*"
 			# Mellanox ethernet
 			mellanox
 			# Marvell WLAN/bluetooth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
                   ` (5 preceding siblings ...)
  2024-12-21 14:05 ` [PR PATCH] [Updated] " classabbyamp
@ 2024-12-21 14:06 ` classabbyamp
  2024-12-21 14:08 ` [PR PATCH] [Merged]: " classabbyamp
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2024-12-21 14:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages linux-fw-loader-compress
https://github.com/void-linux/void-packages/pull/52686

[RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
Enabling this will allow us to compress firmware files in `linux-firmware`, which provides a pretty massive storage saving for on-disk size:

```
linux-firmware            193MB  ->     24MB  (87.6%)
linux-firmware-amd         76MB  ->     26MB  (65.8%)
linux-firmware-broadcom    18MB  ->     12MB  (33.3%)
linux-firmware-intel       26MB  ->    9.9MB  (61.9%)
linux-firmware-network    615MB  ->    346MB  (43.7%)
linux-firmware-nvidia      63MB  ->     41MB  (34.9%)
linux-firmware-qualcomm   177MB  ->     71MB  (59.9%)
TOTAL                    1168MB  ->  529.9MB  (54.6%)
```

This is supported in all packaged kernels.

I plan on enabling compression in `linux-firmware` (the final commit in this PR) several months after merging the rest of this PR (early 2025). It probably make sense to announce this change, as it could cause unbootable systems.

#### Testing the changes
I tested the changes in this PR:

- [ ] 5.4 x86_64 - amdgpu fails
- [ ] 5.10 x86_64 - amdgpu fails
- [ ] 5.15 x86_64 - amdgpu fails
- [x] 6.1 x86_64
- [x] 6.6 x86_64
- [x] 6.12 x86_64
- [ ] 6.12 aarch64 (x13s)
- [x] 6.6 rpi (does not need linux-firmware, still boots)


[ci skip]


A patch file from https://github.com/void-linux/void-packages/pull/52686.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-linux-fw-loader-compress-52686.patch --]
[-- Type: text/x-diff, Size: 6874 bytes --]

From 524f2c9d748753af3f7a495fedf17565ce599611 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:35:47 -0400
Subject: [PATCH 1/4] linux6.1: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.1/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.1/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.1/files/i386-dotconfig b/srcpkgs/linux6.1/files/i386-dotconfig
index 4d34de3107a6ab..24d1e27cf235ea 100644
--- a/srcpkgs/linux6.1/files/i386-dotconfig
+++ b/srcpkgs/linux6.1/files/i386-dotconfig
@@ -2077,7 +2077,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 # CONFIG_FW_UPLOAD is not set
 # end of Firmware loader
diff --git a/srcpkgs/linux6.1/files/x86_64-dotconfig b/srcpkgs/linux6.1/files/x86_64-dotconfig
index 055e5f610c2754..1f8e5b3af5e31e 100644
--- a/srcpkgs/linux6.1/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.1/files/x86_64-dotconfig
@@ -2162,7 +2162,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From 158c4fb34edb5bd3880d834269f221899434784e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 18 Oct 2024 23:44:53 -0400
Subject: [PATCH 2/4] linux6.6: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.6/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.6/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.6/files/i386-dotconfig b/srcpkgs/linux6.6/files/i386-dotconfig
index 1f594277d9b72f..c01b7239650ce0 100644
--- a/srcpkgs/linux6.6/files/i386-dotconfig
+++ b/srcpkgs/linux6.6/files/i386-dotconfig
@@ -2111,7 +2111,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.6/files/x86_64-dotconfig b/srcpkgs/linux6.6/files/x86_64-dotconfig
index 69d58559c38596..f2a28254582b40 100644
--- a/srcpkgs/linux6.6/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.6/files/x86_64-dotconfig
@@ -2260,7 +2260,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From 1ec2f518e3fe88e0e22862fcbca2eab39babadd6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Wed, 11 Dec 2024 22:51:12 -0500
Subject: [PATCH 3/4] linux6.12: enable CONFIG_FW_LOADER_COMPRESS

---
 srcpkgs/linux6.12/files/i386-dotconfig   | 4 +++-
 srcpkgs/linux6.12/files/x86_64-dotconfig | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/linux6.12/files/i386-dotconfig b/srcpkgs/linux6.12/files/i386-dotconfig
index 4a7a24a47adf31..d9c4e668cf15d0 100644
--- a/srcpkgs/linux6.12/files/i386-dotconfig
+++ b/srcpkgs/linux6.12/files/i386-dotconfig
@@ -2169,7 +2169,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader
diff --git a/srcpkgs/linux6.12/files/x86_64-dotconfig b/srcpkgs/linux6.12/files/x86_64-dotconfig
index 01f001642134a8..aa70b5f5e1b094 100644
--- a/srcpkgs/linux6.12/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.12/files/x86_64-dotconfig
@@ -2337,7 +2337,9 @@ CONFIG_FW_LOADER_SYSFS=y
 CONFIG_EXTRA_FIRMWARE=""
 CONFIG_FW_LOADER_USER_HELPER=y
 # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
-# CONFIG_FW_LOADER_COMPRESS is not set
+CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y
 CONFIG_FW_CACHE=y
 CONFIG_FW_UPLOAD=y
 # end of Firmware loader

From 15aa64fbaab2adc59d39fde7156ed0688d87ace4 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 19 Oct 2024 00:07:24 -0400
Subject: [PATCH 4/4] linux-firmware: update to 20241210.

add build option for compression that will be made default at a later date.
---
 srcpkgs/linux-firmware/template | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/linux-firmware/template b/srcpkgs/linux-firmware/template
index 4b6fe77d83cb4a..8e9352a9214cba 100644
--- a/srcpkgs/linux-firmware/template
+++ b/srcpkgs/linux-firmware/template
@@ -1,8 +1,8 @@
 # Template file for 'linux-firmware'
 pkgname=linux-firmware
-version=20241110
+version=20241210
 revision=1
-hostmakedepends="rdfind which"
+hostmakedepends="rdfind which $(vopt_if compressed zstd)"
 depends="linux-firmware-amd>=${version}_${revision} linux-firmware-network>=${version}_${revision}"
 short_desc="Binary firmware blobs for the Linux kernel"
 maintainer="classabbyamp <void@placeviolette.net>"
@@ -10,12 +10,20 @@ license="custom:see /usr/share/licenses/linux-firmware"
 homepage="https://www.kernel.org/"
 changelog="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/log/"
 distfiles="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${version}.tar.gz"
-checksum=c8a561dfdbd54157692fe166b84a173f9bc01f89c78f6196863beea2450e4938
+checksum=c7b83ae05d9943ab7f09e18e3c673ea8a55402f96e3b059a7d05b88c81670b78
 python_version=3
 nostrip=yes
 
+build_options="compressed"
+desc_option_compressed="compress firmware with zstd"
+
 do_install() {
-	make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR=$DESTDIR
+	if [ -n "$build_option_compressed" ]; then
+		env ZSTD_CLEVEL=9 ZSTD_NBTHREADS="$XBPS_MAKEJOBS" \
+			make install-zst dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
+	else
+		make install dedup FIRMWAREDIR=/usr/lib/firmware DESTDIR="$DESTDIR"
+	fi
 
 	for _l in LICEN* WHENCE
 	do
@@ -109,7 +117,7 @@ linux-firmware-network_package() {
 			# Cavium LiquidIO NIC
 			liquidio
 			# Mediatek WLAN/bluetooth
-			"mt7*.bin"
+			"mt7*.bin*"
 			# Mellanox ethernet
 			mellanox
 			# Marvell WLAN/bluetooth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PR PATCH] [Merged]: [RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
  2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
                   ` (6 preceding siblings ...)
  2024-12-21 14:06 ` classabbyamp
@ 2024-12-21 14:08 ` classabbyamp
  7 siblings, 0 replies; 9+ messages in thread
From: classabbyamp @ 2024-12-21 14:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]

There's a merged pull request on the void-packages repository

[RFC] kernels: enable CONFIG_FW_LOADER_COMPRESS
https://github.com/void-linux/void-packages/pull/52686

Description:
Enabling this will allow us to compress firmware files in `linux-firmware`, which provides a pretty massive storage saving for on-disk size:

```
linux-firmware            193MB  ->     24MB  (87.6%)
linux-firmware-amd         76MB  ->     26MB  (65.8%)
linux-firmware-broadcom    18MB  ->     12MB  (33.3%)
linux-firmware-intel       26MB  ->    9.9MB  (61.9%)
linux-firmware-network    615MB  ->    346MB  (43.7%)
linux-firmware-nvidia      63MB  ->     41MB  (34.9%)
linux-firmware-qualcomm   177MB  ->     71MB  (59.9%)
TOTAL                    1168MB  ->  529.9MB  (54.6%)
```

This is supported in all packaged kernels.

I plan on enabling compression in `linux-firmware` (the final commit in this PR) several months after merging the rest of this PR (early 2025). It probably make sense to announce this change, as it could cause unbootable systems.

#### Testing the changes
I tested the changes in this PR:

- [ ] 5.4 x86_64 - amdgpu fails
- [ ] 5.10 x86_64 - amdgpu fails
- [ ] 5.15 x86_64 - amdgpu fails
- [x] 6.1 x86_64
- [x] 6.6 x86_64
- [x] 6.12 x86_64
- [ ] 6.12 aarch64 (x13s)
- [x] 6.6 rpi (does not need linux-firmware, still boots)


[ci skip]


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-12-21 14:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-19  4:59 [PR PATCH] kernels: enable CONFIG_FW_LOADER_COMPRESS classabbyamp
2024-10-19  5:00 ` classabbyamp
2024-12-12  7:08 ` [PR PATCH] [Updated] [RFC] " classabbyamp
2024-12-12 12:10 ` leahneukirchen
2024-12-12 23:52 ` [PR PATCH] [Updated] " classabbyamp
2024-12-12 23:56 ` classabbyamp
2024-12-21 14:05 ` [PR PATCH] [Updated] " classabbyamp
2024-12-21 14:06 ` classabbyamp
2024-12-21 14:08 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).