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:
		
							parent
							
								
									fc4bc4b6de
								
							
						
					
					
						commit
						217b862f0e
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
					@ -27,6 +27,7 @@
 | 
				
			||||||
  #:use-module (gnu packages guile)
 | 
					  #:use-module (gnu packages guile)
 | 
				
			||||||
  #:use-module ((gnu packages make-bootstrap)
 | 
					  #:use-module ((gnu packages make-bootstrap)
 | 
				
			||||||
                #:select (%guile-static-stripped))
 | 
					                #:select (%guile-static-stripped))
 | 
				
			||||||
 | 
					  #:use-module (ice-9 regex)
 | 
				
			||||||
  #:export (expression->initrd
 | 
					  #:export (expression->initrd
 | 
				
			||||||
            qemu-initrd
 | 
					            qemu-initrd
 | 
				
			||||||
            gnu-system-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
 | 
					  ;; General Linux overview in `Documentation/early-userspace/README' and
 | 
				
			||||||
  ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'.
 | 
					  ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  (define (string->regexp str)
 | 
				
			||||||
 | 
					    ;; Return a regexp that matches STR exactly.
 | 
				
			||||||
 | 
					    (string-append "^" (regexp-quote str) "$"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (define builder
 | 
					  (define builder
 | 
				
			||||||
    `(begin
 | 
					    `(begin
 | 
				
			||||||
       (use-modules (guix build utils)
 | 
					       (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"))))
 | 
					                                   (string-append linux "/lib/modules"))))
 | 
				
			||||||
             (mkdir "modules")
 | 
					             (mkdir "modules")
 | 
				
			||||||
             ,@(map (lambda (module)
 | 
					             ,@(map (lambda (module)
 | 
				
			||||||
                      `(match (find-files module-dir ,module)
 | 
					                      `(match (find-files module-dir
 | 
				
			||||||
 | 
					                                          ,(string->regexp module))
 | 
				
			||||||
                         ((file)
 | 
					                         ((file)
 | 
				
			||||||
                          (format #t "copying '~a'...~%" file)
 | 
					                          (format #t "copying '~a'...~%" file)
 | 
				
			||||||
                          (copy-file file (string-append "modules/"
 | 
					                          (copy-file file (string-append "modules/"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue