From 5288f5aa553d1851efd468630b202d335b8a630a Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Tue, 21 Nov 2023 17:49:28 +0100 Subject: Install MT7922 firmware on Framework laptop --- tw/system/frm.scm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tw/system/frm.scm b/tw/system/frm.scm index 6226eb84..9d5c815d 100644 --- a/tw/system/frm.scm +++ b/tw/system/frm.scm @@ -11,10 +11,14 @@ #:use-module (gnu system nss) #:use-module (guix gexp) #:use-module (guix packages) + #:use-module ((guix utils) + #:select (substitute-keyword-arguments)) #:use-module ((nongnu packages linux) #:prefix nongnu:) ; don't interfere with (gnu packages linux) #:use-module ((nongnu system linux-initrd) #:prefix nongnu:) + #:use-module ((nonguix licenses) + #:prefix nongnu:) #:use-module (tw channels) #:use-module (tw packages scanner) #:use-module (tw services secrets) @@ -43,6 +47,30 @@ (keyboard-layout %british-keyboard) (extra-config (list touchpad-xorg-config)))) +(define select-firmware + (@@ (nongnu packages linux) select-firmware)) + +(define-public mt7922-firmware + (package + (inherit nongnu:linux-firmware) + (name "mt7922-firmware") + (arguments + `(#:license-file-regexp "LICENSE.mediatek" + ,@(substitute-keyword-arguments (package-arguments nongnu:linux-firmware) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'select-firmware + ,(select-firmware "^mediatek/.*7922.*"))))))) + (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/mediatek") + (synopsis "Nonfree firmware for Mediatek MT7922 (AMD RZ616) wireless chips") + (description "Nonfree firmware for AMD RZ616 Wi-Fi and Bluetooth chips. +These are actually Mediatek MT7922 chips.") + (license + (nongnu:nonfree + (string-append + "https://git.kernel.org/pub/scm/linux/kernel/git/firmware" + "/linux-firmware.git/plain/LICENSE.mediatek"))))) + (define-public %frm-system (operating-system (host-name "frm.twilken.net") @@ -75,7 +103,7 @@ (kernel (nongnu:corrupt-linux linux-libre #:configs '("CONFIG_MT7921E=m"))) (initrd nongnu:microcode-initrd) ;; TODO: Enable wifi firmware, if necessary? - (firmware (cons* nongnu:amdgpu-firmware %base-firmware)) + (firmware (cons* nongnu:amdgpu-firmware mt7922-firmware %base-firmware)) (file-systems (cons* (file-system -- cgit v1.2.3