summaryrefslogtreecommitdiff
path: root/gnu/system.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2020-02-18 10:42:07 +0100
committerDanny Milosavljevic <dannym@scratchpost.org>2020-03-22 12:51:50 +0100
commit5c79f238634c5adb6657f1b4b1bb4ddb8bb73ef1 (patch)
tree9aa461be2cf3ede11048d3e7c4280b89de4ac73b /gnu/system.scm
parent66a198c8075f02d7075a555b48dd3adde88ebbbf (diff)
system: Add kernel-loadable-modules to operating-system.
* gnu/system.scm (<operating-system>): Add kernel-loadable-modules. (operating-system-directory-base-entries): Use it. * doc/guix.texi (operating-system Reference): Document KERNEL-LOADABLE-MODULES. * gnu/build/linux-modules.scm (depmod): New procedure. (make-linux-module-directory): New procedure. Export it. * guix/profiles.scm (linux-module-database): New procedure. Export it. * gnu/tests/linux-modules.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/linux.scm (make-linux-libre*)[arguments]<#:phases>[install]: Disable depmod. Remove "build" and "source" symlinks. [native-inputs]: Remove kmod.
Diffstat (limited to 'gnu/system.scm')
-rw-r--r--gnu/system.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index 06c58c27ba..c90d8c6cbc 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Meiyo Peng <meiyo.peng@gmail.com>
+;;; Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -168,6 +169,8 @@
(kernel operating-system-kernel ; package
(default linux-libre))
+ (kernel-loadable-modules operating-system-kernel-loadable-modules
+ (default '())) ; list of packages
(kernel-arguments operating-system-user-kernel-arguments
(default '("quiet"))) ; list of gexps/strings
(bootloader operating-system-bootloader) ; <bootloader-configuration>
@@ -472,9 +475,16 @@ OS."
"Return the basic entries of the 'system' directory of OS for use as the
value of the SYSTEM-SERVICE-TYPE service."
(let ((locale (operating-system-locale-directory os)))
- (mlet %store-monad ((kernel -> (operating-system-kernel os))
- (initrd -> (operating-system-initrd-file os))
- (params (operating-system-boot-parameters-file os)))
+ (mlet* %store-monad ((kernel -> (operating-system-kernel os))
+ (modules ->
+ (operating-system-kernel-loadable-modules os))
+ (kernel
+ (profile-derivation
+ (packages->manifest
+ (cons kernel modules))
+ #:hooks (list linux-module-database)))
+ (initrd -> (operating-system-initrd-file os))
+ (params (operating-system-boot-parameters-file os)))
(return `(("kernel" ,kernel)
("parameters" ,params)
("initrd" ,initrd)