summary refs log tree commit diff
path: root/gnu/system
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/linux-initrd.scm26
-rw-r--r--gnu/system/mapped-devices.scm4
2 files changed, 9 insertions, 21 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index d73ebfd8d3..a5a111908f 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -108,34 +108,18 @@ the derivations referenced by EXP are automatically copied to the initrd."
 MODULES and taken from LINUX."
   (define build-exp
     (with-imported-modules (source-module-closure
-                            '((guix build utils)
-                              (gnu build linux-modules)))
+                            '((gnu build linux-modules)))
       #~(begin
-          (use-modules (ice-9 match) (ice-9 regex)
+          (use-modules (gnu build linux-modules)
                        (srfi srfi-1)
-                       (guix build utils)
-                       (gnu build linux-modules))
-
-          (define (string->regexp str)
-            ;; Return a regexp that matches STR exactly.
-            (string-append "^" (regexp-quote str) "$"))
+                       (srfi srfi-26))
 
           (define module-dir
             (string-append #$linux "/lib/modules"))
 
-          (define (lookup module)
-            (let ((name (ensure-dot-ko module)))
-              (match (find-files module-dir (string->regexp name))
-                ((file)
-                 file)
-                (()
-                 (error "module not found" name module-dir))
-                ((_ ...)
-                 (error "several modules by that name"
-                        name module-dir)))))
-
           (define modules
-            (let ((modules (map lookup '#$modules)))
+            (let* ((lookup  (cut find-module-file module-dir <>))
+                   (modules (map lookup '#$modules)))
               (append modules
                       (recursive-module-dependencies modules
                                                      #:lookup-module lookup))))
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index aec49322e7..384b1aaf7d 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -137,6 +137,10 @@ DEVICE must be a \"/dev\" file name."
           ;; LINUX-MODULES is file names without '.ko', so normalize them.
           (provided (map file-name->module-name linux-modules)))
       (unless (every (cut member <> provided) modules)
+        ;; Note: What we suggest here is a list of module names (e.g.,
+        ;; "usb_storage"), not file names (e.g., "usb-storage.ko").  This is
+        ;; OK because we have machinery that accepts both the hyphen and the
+        ;; underscore version.
         (raise (condition
                 (&message
                  (message (format #f (G_ "you may need these modules \