me
/
guix
Archived
1
0
Fork 0

linux-initrd: Gracefully handle lack of “modules.builtin” file.

Fixes a regression introduced in
8f8ec56052, whereby passing a “fake”
kernel package would no longer work.

Fixes <https://issues.guix.gnu.org/70239>.

* gnu/system/linux-initrd.scm (flat-linux-module-directory)[build-exp]:
Gracefully handle lack of “modules.builtin” file.

Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I3acf48123b20f0b6a3b9cc0bf22f76cec3e64361
master
Ludovic Courtès 2024-04-16 19:18:43 +02:00
parent d33965908d
commit 9f1ef20114
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 12 additions and 7 deletions

View File

@ -134,18 +134,23 @@ MODULES and taken from LINUX."
(guix build utils) (guix build utils)
(rnrs io ports) (rnrs io ports)
(srfi srfi-1) (srfi srfi-1)
(srfi srfi-26)) (srfi srfi-26)
(ice-9 match))
(define module-dir (define module-dir
(string-append #$linux "/lib/modules")) (string-append #$linux "/lib/modules"))
(define builtin-modules (define builtin-modules
(call-with-input-file (match (find-files module-dir (lambda (file stat)
(first (find-files module-dir "modules.builtin$")) (string=? (basename file)
(lambda (port) "modules.builtin")))
(map file-name->module-name ((file . _)
(string-tokenize (call-with-input-file file
(get-string-all port)))))) (lambda (port)
(map file-name->module-name
(string-tokenize (get-string-all port))))))
(_
'())))
(define modules-to-lookup (define modules-to-lookup
(lset-difference string=? '#$modules builtin-modules)) (lset-difference string=? '#$modules builtin-modules))