diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2024-04-16 19:18:43 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-04-17 12:13:01 +0200 |
| commit | 9f1ef201142e0b3369d55cd486e2d7d7da3a4ed7 (patch) | |
| tree | 28a6e0c547730e5b4ce76e6daa6b2ac068753b52 /gnu/system/linux-initrd.scm | |
| parent | d33965908dc8e21e9c9834ce1061cdcc664295ab (diff) | |
linux-initrd: Gracefully handle lack of “modules.builtin” file.
Fixes a regression introduced in
8f8ec56052766aa5105d672b77ad9eaca5c1ab3c, 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
Diffstat (limited to 'gnu/system/linux-initrd.scm')
| -rw-r--r-- | gnu/system/linux-initrd.scm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 561cfe2fd0e..40ff2dc808b 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm | |||
| @@ -134,18 +134,23 @@ MODULES and taken from LINUX." | |||
| 134 | (guix build utils) | 134 | (guix build utils) |
| 135 | (rnrs io ports) | 135 | (rnrs io ports) |
| 136 | (srfi srfi-1) | 136 | (srfi srfi-1) |
| 137 | (srfi srfi-26)) | 137 | (srfi srfi-26) |
| 138 | (ice-9 match)) | ||
| 138 | 139 | ||
| 139 | (define module-dir | 140 | (define module-dir |
| 140 | (string-append #$linux "/lib/modules")) | 141 | (string-append #$linux "/lib/modules")) |
| 141 | 142 | ||
| 142 | (define builtin-modules | 143 | (define builtin-modules |
| 143 | (call-with-input-file | 144 | (match (find-files module-dir (lambda (file stat) |
| 144 | (first (find-files module-dir "modules.builtin$")) | 145 | (string=? (basename file) |
| 145 | (lambda (port) | 146 | "modules.builtin"))) |
| 146 | (map file-name->module-name | 147 | ((file . _) |
| 147 | (string-tokenize | 148 | (call-with-input-file file |
| 148 | (get-string-all port)))))) | 149 | (lambda (port) |
| 150 | (map file-name->module-name | ||
| 151 | (string-tokenize (get-string-all port)))))) | ||
| 152 | (_ | ||
| 153 | '()))) | ||
| 149 | 154 | ||
| 150 | (define modules-to-lookup | 155 | (define modules-to-lookup |
| 151 | (lset-difference string=? '#$modules builtin-modules)) | 156 | (lset-difference string=? '#$modules builtin-modules)) |
