commit:     b5f6b85b5d1516749d2a310746b6b460de266d30
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 18 14:51:03 2023 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Sat Mar 18 14:51:03 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5f6b85b

sys-kernel/linux-firmware: fix kernel config checking for -99999999

Remove the ! linux_config_exists check because the function will
always fail when /proc/config.gz support is not enabled because
KV_OUT_DIR needed by linux_config_src_exists is not populated yet

die if USE=compress-zstd is set with an unsupported kernel
Thanks to xxc3nsoredxx

Bug: https://bugs.gentoo.org/899958

Author: xxc2ensoredxx
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 .../linux-firmware/linux-firmware-99999999.ebuild  | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild 
b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
index 47424bcb967c..feed015c3e3e 100644
--- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
@@ -65,22 +65,18 @@ QA_PREBUILT="*"
 
 pkg_setup() {
        if use compress-xz || use compress-zstd ; then
-               if ! linux_config_exists; then
-                       eerror "Unable to check your kernel for compressed 
firmware support"
+               local CONFIG_CHECK
+
+               if kernel_is -ge 5 19; then
+                       use compress-xz && CONFIG_CHECK="~FW_LOADER_COMPRESS_XZ"
+                       use compress-zstd && 
CONFIG_CHECK="~FW_LOADER_COMPRESS_ZSTD"
                else
-                       local CONFIG_CHECK
-
-                       if kernel_is -ge 5 19; then
-                               use compress-xz && 
CONFIG_CHECK="~FW_LOADER_COMPRESS_XZ"
-                               use compress-zstd && 
CONFIG_CHECK="~FW_LOADER_COMPRESS_ZSTD"
-                       else
-                               use compress-xz && 
CONFIG_CHECK="~FW_LOADER_COMPRESS"
-                               if use compress-zstd; then
-                                       eerror "You kernel does not support 
ZSTD-compressed firmware files"
-                               fi
+                       use compress-xz && CONFIG_CHECK="~FW_LOADER_COMPRESS"
+                       if use compress-zstd; then
+                               eerror "Kernels <5.19 do not support 
ZSTD-compressed firmware files"
                        fi
-                       linux-info_pkg_setup
                fi
+               linux-info_pkg_setup
        fi
 }
 

Reply via email to