summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Volf <~@wolfsden.cz>2024-01-11 13:30:38 +0100
committerJonathan Brielmaier <jonathan.brielmaier@web.de>2024-01-23 18:25:40 +0100
commit3857d86267284000dc48660a5dfd56cb2a8cf004 (patch)
tree6386770e7591566a468899384594473beb9b1538
parentd0a8b135d3c75dca774e55e15b4671dcf5965cd1 (diff)
nongnu: linux: Enable mt7921e driver.
In order to be able to use WiFi chip in P14s ThinkPad, the mt7921e module is required. This commit enables it in kernels that do have it. I originally implemented this using a list of additional option, same way %default-extra-linux-options is done. However I quickly realized that approach is not suitable for hardware enablement. The older versions do not support the same drivers as the newer ones. Solution is to create a new procedure that generates the list for a specific kernel version and use it as a default value for #:configs. * nongnu/packages/linux.scm (nonguix-extra-linux-options): New procedure. (corrupt-linux): Use it as default value for #:configs. Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
-rw-r--r--nongnu/packages/linux.scm35
1 files changed, 34 insertions, 1 deletions
diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm
index 652f258..365590c 100644
--- a/nongnu/packages/linux.scm
+++ b/nongnu/packages/linux.scm
@@ -24,6 +24,7 @@
;;; Copyright © 2023 Adam Kandur <rndd@tuta.io>
;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Ada Stevenson <adanskana@gmail.com>
+;;; Copyright © 2023 Tomas Volf <~@wolfsden.cz>
(define-module (nongnu packages linux)
#:use-module (gnu packages)
@@ -52,10 +53,42 @@
"/linux/kernel/v" (version-major version) ".x"
"/linux-" version ".tar.xz"))
+;;; If you are corrupting the kernel on your own, consider using output of
+;;; this procedure as a base for your options:
+;;; (corrupt-linux linux-libre-lts
+;;; #:configs (cons* "CONFIG_FOO=y"
+;;; (nonguix-extra-linux-options linux-libre-lts)
+(define-public (nonguix-extra-linux-options linux-or-version)
+ "Return a list containing additional options that nonguix sets by default
+for a corrupted linux package of specified version. linux-or-version can be
+some freedo package or an output of package-version procedure."
+ (define linux-version
+ (if (package? linux-or-version)
+ (package-version linux-or-version)
+ linux-or-version))
+
+ (reverse (fold (lambda (opt opts)
+ (if (version>=? linux-version (car opt))
+ (cons* (cdr opt) opts)
+ opts))
+ '()
+ ;; List of additional options for nonguix corrupted linux.
+ ;; Each member is a pair of a minimal version (>=) and the
+ ;; option itself. Option has to be in a format suitable for
+ ;; (@ (guix build kconfig) modify-defconfig) procedure.
+ ;;
+ ;; Do note that this list is intended for enabling use of
+ ;; hardware requiring non-free firmware. If a configuration
+ ;; option does work under linux-libre, it should go into Guix
+ ;; actual.
+ '(
+ ;; Driver for MediaTek mt7921e wireless chipset
+ ("5.15" . "CONFIG_MT7921E=m")))))
+
(define* (corrupt-linux freedo
#:key
(name "linux")
- (configs '())
+ (configs (nonguix-extra-linux-options freedo))
(defconfig #f))
;; TODO: This very directly depends on guix internals.