From b25a4d9f18aad6bc329a5ea5b42e03f7694f3db4 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sat, 13 Jan 2024 21:33:33 +0100 Subject: Support AMD RZ616 WiFi card in installer image --- tw/system/installer/nonfree.scm | 64 +++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/tw/system/installer/nonfree.scm b/tw/system/installer/nonfree.scm index 60ec244c..14dffccb 100644 --- a/tw/system/installer/nonfree.scm +++ b/tw/system/installer/nonfree.scm @@ -8,35 +8,40 @@ #:use-module (gnu services ssh) #:use-module (gnu system) #:use-module (guix gexp) + #:use-module ((nongnu packages linux) + #:prefix nongnu:) ; don't interfere with (gnu packages linux) #:use-module ((nongnu system install) #:select (installation-os-nonfree)) + #:use-module ((nongnu system linux-initrd) + #:prefix nongnu:) #:use-module ((srfi srfi-26) #:select (cut)) - #:use-module (tw channels)) + #:use-module (tw channels) + #:use-module (tw packages firmware)) (operating-system (inherit installation-os-nonfree) (host-name "guixinstall") (timezone "Europe/Paris") (locale "en_GB.utf8") + + ;; Use non-free kernel to load non-free firmware (e.g. for wifi). + ;; Enable MT7921 module for Mediatek MT7922 (AMD RZ616) WiFi card. + ;; The MT7921E module is for the card connected via PCIe, which it is + ;; (it's in an M.2 slot). Alternatives are S (SDIO) and U (USB). + (kernel (nongnu:corrupt-linux linux-libre #:configs '("CONFIG_MT7921E=m"))) + (kernel-loadable-modules (list ddcci-driver-linux)) + (initrd nongnu:microcode-initrd) + (firmware (cons* nongnu:amdgpu-firmware mt7922-firmware %base-firmware)) + (packages (cons* efibootmgr htop git (operating-system-packages installation-os-nonfree))) (services (cons* - ;; Add the nonguix channel, so we can install nonfree packages directly. + ;; Add this channel, so we can install nonfree packages directly. (extra-special-file "/etc/guix/channels.scm" - (scheme-file "channels.scm" - #~(cons* - (channel - (name 'nonguix) - (url "https://gitlab.com/nonguix/nonguix") - (introduction - (channel-introduction - (version 0) - (commit "897c1a470da759236cc11798f4e0a5f7d4d59fbc") - (signer "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))) - %system-channels))) + (scheme-file "channels.scm" %system-channels)) ;; Use nonguix' substitute server. (simple-service 'nonguix guix-service-type @@ -44,21 +49,18 @@ (authorized-keys (list %nonguix-signing-key)) (substitute-urls '("https://substitutes.nonguix.org")))) - ;; Add an SSH server to facilitate remote installs. - (service openssh-service-type - (openssh-configuration - (port-number 22) - (%auto-start? #t) - (permit-root-login #t) - ;; The root account is passwordless, so make sure - ;; a password is set before allowing logins. - (allow-empty-passwords? #f) - (password-authentication? #f) - (authorized-keys - `(("root" ,(local-file "../files/timo.pub")))))) - - ;; Make sure to remove the SSH service from the base services, - ;; so we can override it fully. - (filter - (compose not (cut eq? openssh-service-type <>) service-kind) - ((@@ (gnu system install) %installation-services)))))) + (modify-services ((@@ (gnu system install) %installation-services)) + ;; Set up an SSH server to facilitate remote installs. + (openssh-service-type + config => + (openssh-configuration + (inherit config) + (port-number 22) + (%auto-start? #t) + (permit-root-login #t) + ;; The root account is passwordless, so make sure + ;; a password is set before allowing logins. + (allow-empty-passwords? #f) + (password-authentication? #f) + (authorized-keys + `(("root" ,(local-file "../files/timo.pub")))))))))) -- cgit v1.2.3