diff options
author | raid5atemyhomework <raid5atemyhomework@protonmail.com> | 2021-03-22 11:23:32 +0800 |
---|---|---|
committer | Danny Milosavljevic <dannym@scratchpost.org> | 2021-05-11 16:13:48 +0200 |
commit | a3df382525ac515d1aa083f7f5bd3bd31eb1df40 (patch) | |
tree | ceaa4eaf3a5c2d2a85e64ca83b7d23a9e9d306ed /gnu/system.scm | |
parent | bddad00bffc5837e89942756fa5b7234f63f1f47 (diff) | |
download | guix-a3df382525ac515d1aa083f7f5bd3bd31eb1df40.tar.gz |
gnu: Allow services to install kernel-loadable modules.
* gnu/system.scm (operating-system-directory-base-entries): Remove code to handle generation of "kernel" for linux-libre kernels. (operating-system-default-essential-services): Instantiate linux-builder-service-type. (package-for-kernel): Move ... * gnu/services.scm: ... to here. (linux-builder-service-type): New variable. (linux-builder-configuration): New type. (linux-loadable-module-service-type): New variable. * gnu/tests/linux-modules.scm (run-loadable-kernel-modules-test): Move code to ... (run-loadable-kernel-modules-test-base): ... new procedure here. (run-loadable-kernel-modules-service-test): New procedure. (%test-loadable-kernel-modules-service-0): New variable. (%test-loadable-kernel-modules-service-1): New variable. (%test-loadable-kernel-modules-service-2): New variable. * doc/guix.texi: Document linux-loadable-module-service-type. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Diffstat (limited to 'gnu/system.scm')
-rw-r--r-- | gnu/system.scm | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/gnu/system.scm b/gnu/system.scm index 5bf2a85272..7cc4f134b7 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <jannek@gnu.org> ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> +;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -601,16 +602,6 @@ OS." (file-append (operating-system-kernel os) "/" (system-linux-image-file-name)))) -(define (package-for-kernel target-kernel module-package) - "Return a package like MODULE-PACKAGE, adapted for TARGET-KERNEL, if -possible (that is if there's a LINUX keyword argument in the build system)." - (package - (inherit module-package) - (arguments - (substitute-keyword-arguments (package-arguments module-package) - ((#:linux kernel #f) - target-kernel))))) - (define %default-modprobe-blacklist ;; List of kernel modules to blacklist by default. '("usbmouse" ;races with bcm5974, see <https://bugs.gnu.org/35574> @@ -628,23 +619,12 @@ value of the SYSTEM-SERVICE-TYPE service." (let* ((locale (operating-system-locale-directory os)) (kernel (operating-system-kernel os)) (hurd (operating-system-hurd os)) - (modules (operating-system-kernel-loadable-modules os)) - (kernel (if hurd - kernel - (profile - (content (packages->manifest - (cons kernel - (map (lambda (module) - (if (package? module) - (package-for-kernel kernel - module) - module)) - modules)))) - (hooks (list linux-module-database))))) (initrd (and (not hurd) (operating-system-initrd-file os))) (params (operating-system-boot-parameters-file os))) - `(("kernel" ,kernel) - ,@(if hurd `(("hurd" ,hurd)) '()) + `(,@(if hurd + `(("hurd" ,hurd) + ("kernel" ,kernel)) + '()) ("parameters" ,params) ,@(if initrd `(("initrd" ,initrd)) '()) ("locale" ,locale)))) ;used by libc @@ -664,6 +644,10 @@ bookkeeping." (host-name (host-name-service (operating-system-host-name os))) (entries (operating-system-directory-base-entries os))) (cons* (service system-service-type entries) + (service linux-builder-service-type + (linux-builder-configuration + (kernel (operating-system-kernel os)) + (modules (operating-system-kernel-loadable-modules os)))) %boot-service ;; %SHEPHERD-ROOT-SERVICE must come last so that the gexp that |