summary refs log tree commit diff
path: root/gnu/system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-01-31 12:01:23 +0100
committerLudovic Courtès <ludo@gnu.org>2014-01-31 12:01:23 +0100
commit217b862f0e8dfac18874f9c6ec8cafdb2471b4fb (patch)
tree54c55743ac6fa437052f9903d907c9ef20ee36fe /gnu/system
parentfc4bc4b6debecf9acc7e86ecb519c03b5b598bc4 (diff)
downloadguix-217b862f0e8dfac18874f9c6ec8cafdb2471b4fb.tar.gz
gnu: linux-initrd: Match kernel module file names exactly.
* gnu/system/linux-initrd.scm (expression->initrd)[string->regexp]: New
  procedure.  Use it in the call to 'find-files'.
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/linux-initrd.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index ea9d708dac..408fb9f211 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -27,6 +27,7 @@
   #:use-module (gnu packages guile)
   #:use-module ((gnu packages make-bootstrap)
                 #:select (%guile-static-stripped))
+  #:use-module (ice-9 regex)
   #:export (expression->initrd
             qemu-initrd
             gnu-system-initrd))
@@ -58,6 +59,10 @@ list of Guile module names to be embedded in the initrd."
   ;; General Linux overview in `Documentation/early-userspace/README' and
   ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'.
 
+  (define (string->regexp str)
+    ;; Return a regexp that matches STR exactly.
+    (string-append "^" (regexp-quote str) "$"))
+
   (define builder
     `(begin
        (use-modules (guix build utils)
@@ -119,7 +124,8 @@ list of Guile module names to be embedded in the initrd."
                                    (string-append linux "/lib/modules"))))
              (mkdir "modules")
              ,@(map (lambda (module)
-                      `(match (find-files module-dir ,module)
+                      `(match (find-files module-dir
+                                          ,(string->regexp module))
                          ((file)
                           (format #t "copying '~a'...~%" file)
                           (copy-file file (string-append "modules/"