linux-initrd: Add USB kernel modules to the default initrd.
[jackhill/guix/guix.git] / gnu / system / linux-initrd.scm
index 71aba1e..e66d9fe 100644 (file)
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -18,6 +18,7 @@
 
 (define-module (gnu system linux-initrd)
   #:use-module (guix monads)
+  #:use-module (guix store)
   #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module ((guix store)
@@ -166,16 +167,16 @@ modules can be listed in EXTRA-MODULES.  They will be added to the initrd, and
 loaded at boot time in the order in which they appear."
   (define virtio-modules
     ;; Modules for Linux para-virtualized devices, for use in QEMU guests.
-    '("virtio.ko" "virtio_ring.ko" "virtio_pci.ko"
-      "virtio_balloon.ko" "virtio_blk.ko" "virtio_net.ko"))
+    '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net"
+      "virtio_console"))
 
   (define cifs-modules
     ;; Modules needed to mount CIFS file systems.
-    '("md4.ko" "ecb.ko" "cifs.ko"))
+    '("md4" "ecb" "cifs"))
 
   (define virtio-9p-modules
     ;; Modules for the 9p paravirtualized file system.
-    '("fscache.ko" "9pnet.ko" "9p.ko" "9pnet_virtio.ko"))
+    '("9p" "9pnet_virtio"))
 
   (define (file-system-type-predicate type)
     (lambda (fs)
@@ -183,8 +184,10 @@ loaded at boot time in the order in which they appear."
 
   (define linux-modules
     ;; Modules added to the initrd and loaded from the initrd.
-    `("libahci.ko" "ahci.ko"                      ;for SATA controllers
-      "pata_acpi.ko" "pata_atiixp.ko"             ;for ATA controllers
+    `("ahci"                                  ;for SATA controllers
+      "pata_acpi" "pata_atiixp"               ;for ATA controllers
+      "usb-storage" "uas"                     ;for the installation image etc.
+      "usbkbd" "usbhid"                       ;USB keyboards, for debugging
       ,@(if (or virtio? qemu-networking?)
             virtio-modules
             '())
@@ -195,7 +198,7 @@ loaded at boot time in the order in which they appear."
             virtio-9p-modules
             '())
       ,@(if volatile-root?
-            '("fuse.ko")
+            '("fuse")
             '())
       ,@extra-modules))
 
@@ -236,14 +239,15 @@ 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 (map (lambda (file)
-                                             (string-append #$kodir "/" file))
-                                           '#$linux-modules)
+                      #:linux-modules '#$linux-modules
+                      #:linux-module-directory '#$kodir
                       #:qemu-guest-networking? #$qemu-networking?
                       #:volatile-root? '#$volatile-root?))
      #:name "base-initrd"
      #:modules '((guix build utils)
                  (gnu build linux-boot)
-                 (gnu build file-systems)))))
+                 (gnu build linux-modules)
+                 (gnu build file-systems)
+                 (guix elf)))))
 
 ;;; linux-initrd.scm ends here