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'.
This commit is contained in:
Ludovic Courtès 2014-01-31 12:01:23 +01:00
parent fc4bc4b6de
commit 217b862f0e

View file

@ -27,6 +27,7 @@ (define-module (gnu system linux-initrd)
#: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 @@ (define* (expression->initrd exp
;; 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 @@ (define builder
(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/"