mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
linux-initrd: Try several file names when looking up modules.
Fixes <https://bugs.gnu.org/31714>. Reported by Tonton <tonton@riseup.net>. * gnu/build/linux-modules.scm (find-module-file): New procedure. * gnu/system/linux-initrd.scm (flat-linux-module-directory)[build-exp]: Remove 'lookup' procedure and use 'find-module-file' instead. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Add comment.
This commit is contained in:
parent
d2a1cf45f7
commit
fcd068e984
3 changed files with 44 additions and 21 deletions
|
@ -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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue