unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [WIP PATCH] linux-initrd: Allow own set of kernel modules.
@ 2016-07-28 10:42 Tomáš Čech
  2016-07-28 13:05 ` Ludovic Courtès
  2016-07-30 15:38 ` Alex Kost
  0 siblings, 2 replies; 6+ messages in thread
From: Tomáš Čech @ 2016-07-28 10:42 UTC (permalink / raw)
  To: guix-devel

* gnu/system/linux-initrd.scm(base-initrd): Add `linux-modules'
  parameter. Rename former `linux-modules' to
  `default-linux-modules'. Introduce used-linux-modules to make the code
  more readable.
---
 gnu/system/linux-initrd.scm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index bbaa5c0..4934c92 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -138,6 +138,7 @@ MODULES and taken from LINUX."
                       qemu-networking?
                       (virtio? #t)
                       volatile-root?
+                      (linux-modules #f)
                       (extra-modules '()))
   "Return a monadic derivation that builds a generic initrd, with kernel
 modules taken from LINUX.  FILE-SYSTEMS is a list of file-systems to be
@@ -174,7 +175,7 @@ loaded at boot time in the order in which they appear."
     (lambda (fs)
       (string=? (file-system-type fs) type)))
 
-  (define linux-modules
+  (define default-linux-modules
     ;; Modules added to the initrd and loaded from the initrd.
     `("ahci"                                  ;for SATA controllers
       "usb-storage" "uas"                     ;for the installation image etc.
@@ -220,8 +221,13 @@ loaded at boot time in the order in which they appear."
              (open source target)))
          mapped-devices))
 
+  (define used-linux-modules
+    (if (equal? linux-modules #f)
+        default-linux-modules
+        linux-modules))
+
   (mlet %store-monad ((kodir (flat-linux-module-directory linux
-                                                          linux-modules)))
+                                                          used-linux-modules)))
     (expression->initrd
      (with-imported-modules '((guix build bournish)
                               (guix build utils)
@@ -251,7 +257,7 @@ loaded at boot time in the order in which they appear."
            (boot-system #:mounts '#$(map file-system->spec file-systems)
                         #:pre-mount (lambda ()
                                       (and #$@device-mapping-commands))
-                        #:linux-modules '#$linux-modules
+                        #:linux-modules '#$used-linux-modules
                         #:linux-module-directory '#$kodir
                         #:qemu-guest-networking? #$qemu-networking?
                         #:volatile-root? '#$volatile-root?)))
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-30 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-28 10:42 [WIP PATCH] linux-initrd: Allow own set of kernel modules Tomáš Čech
2016-07-28 13:05 ` Ludovic Courtès
2016-07-28 13:35   ` Tomáš Čech
2016-07-28 15:32     ` Ludovic Courtès
2016-07-28 16:53       ` Tobias Geerinckx-Rice
2016-07-30 15:38 ` Alex Kost

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).