Skip to content
Snippets Groups Projects
Commit 0d275f4a authored by Andy Wingo's avatar Andy Wingo Committed by Ludovic Courtès
Browse files

system: Take kernel modules from the user-specified kernel.


* gnu/system/linux-initrd.scm (base-initrd): Add #:linux option to
  specify the linux kernel to use.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Propagate
  #:linux to base-initrd.
* gnu/system.scm (operating-system-initrd-file): Pass #:linux to
  'make-initrd'.

Co-authored-by: default avatarLudovic Courtès <ludo@gnu.org>
parent 59446b20
No related branches found
No related tags found
No related merge requests found
...@@ -737,6 +737,7 @@ (define make-initrd ...@@ -737,6 +737,7 @@ (define make-initrd
(operating-system-initrd os)) (operating-system-initrd os))
(mlet %store-monad ((initrd (make-initrd boot-file-systems (mlet %store-monad ((initrd (make-initrd boot-file-systems
#:linux (operating-system-kernel os)
#:mapped-devices mapped-devices))) #:mapped-devices mapped-devices)))
(return #~(string-append #$initrd "/initrd")))) (return #~(string-append #$initrd "/initrd"))))
......
...@@ -143,16 +143,17 @@ (define (file-system->spec fs) ...@@ -143,16 +143,17 @@ (define (file-system->spec fs)
(define* (base-initrd file-systems (define* (base-initrd file-systems
#:key #:key
(linux linux-libre)
(mapped-devices '()) (mapped-devices '())
qemu-networking? qemu-networking?
virtio? virtio?
volatile-root? volatile-root?
(extra-modules '())) (extra-modules '()))
"Return a monadic derivation that builds a generic initrd. FILE-SYSTEMS is "Return a monadic derivation that builds a generic initrd, with kernel
a list of file-systems to be mounted by the initrd, possibly in addition to modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be
the root file system specified on the kernel command line via '--root'. mounted by the initrd, possibly in addition to the root file system specified
MAPPED-DEVICES is a list of device mappings to realize before FILE-SYSTEMS are on the kernel command line via '--root'. MAPPED-DEVICES is a list of device
mounted. mappings to realize before FILE-SYSTEMS are mounted.
When QEMU-NETWORKING? is true, set up networking with the standard QEMU When QEMU-NETWORKING? is true, set up networking with the standard QEMU
parameters. When VIRTIO? is true, load additional modules so the initrd can parameters. When VIRTIO? is true, load additional modules so the initrd can
...@@ -224,7 +225,7 @@ (define device-mapping-commands ...@@ -224,7 +225,7 @@ (define device-mapping-commands
(open source target))) (open source target)))
mapped-devices)) mapped-devices))
(mlet %store-monad ((kodir (flat-linux-module-directory linux-libre (mlet %store-monad ((kodir (flat-linux-module-directory linux
linux-modules))) linux-modules)))
(expression->initrd (expression->initrd
#~(begin #~(begin
......
...@@ -149,6 +149,7 @@ (define* (expression->derivation-in-linux-vm name exp ...@@ -149,6 +149,7 @@ (define* (expression->derivation-in-linux-vm name exp
(initrd (if initrd ; use the default initrd? (initrd (if initrd ; use the default initrd?
(return initrd) (return initrd)
(base-initrd %linux-vm-file-systems (base-initrd %linux-vm-file-systems
#:linux linux
#:virtio? #t #:virtio? #t
#:qemu-networking? #t)))) #:qemu-networking? #t))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment