summaryrefslogtreecommitdiff
path: root/gnu/system/linux-initrd.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-03-10 00:15:59 +0100
committerLudovic Courtès <ludo@gnu.org>2018-03-10 00:15:59 +0100
commit8d5c14edf5a6d01f859b1aa00c836ffdb5ddecf4 (patch)
tree8b4cd15bdba1785fee1b66d9a160429f83b9f2ff /gnu/system/linux-initrd.scm
parent464f5447396fcec9b43f7eab71d5d42b522a157f (diff)
linux-initrd: Skip initrd module check when 'modules.alias' can't be found.
Fixes <https://bugs.gnu.org/30760>. Reported by Tomáš Čech <sleep_walker@gnu.org>. * gnu/system/linux-initrd.scm (check-device-initrd-modules): Call 'known-module-aliases' and catch 'system-error around it. Pass it to 'matching-modules'.
Diffstat (limited to 'gnu/system/linux-initrd.scm')
-rw-r--r--gnu/system/linux-initrd.scm36
1 files changed, 23 insertions, 13 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 1eb5f5130d6..16a8c437538 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -353,17 +353,27 @@ loaded at boot time in the order in which they appear."
353(define (check-device-initrd-modules device linux-modules location) 353(define (check-device-initrd-modules device linux-modules location)
354 "Raise an error if DEVICE needs modules beyond LINUX-MODULES to operate. 354 "Raise an error if DEVICE needs modules beyond LINUX-MODULES to operate.
355DEVICE must be a \"/dev\" file name." 355DEVICE must be a \"/dev\" file name."
356 (let ((modules (delete-duplicates 356 (define aliases
357 (append-map matching-modules 357 ;; Attempt to load 'modules.alias' from the current kernel, assuming we're
358 (device-module-aliases device))))) 358 ;; on GuixSD, and assuming that corresponds to the kernel we'll be
359 (unless (every (cute member <> linux-modules) modules) 359 ;; installing. Skip the whole thing if that file cannot be read.
360 (raise (condition 360 (catch 'system-error
361 (&message 361 (lambda ()
362 (message (format #f (G_ "you may need these modules \ 362 (known-module-aliases))
363 (const #f)))
364
365 (when aliases
366 (let ((modules (delete-duplicates
367 (append-map (cut matching-modules <> aliases)
368 (device-module-aliases device)))))
369 (unless (every (cute member <> linux-modules) modules)
370 (raise (condition
371 (&message
372 (message (format #f (G_ "you may need these modules \
363in the initrd for ~a:~{ ~a~}") 373in the initrd for ~a:~{ ~a~}")
364 device modules))) 374 device modules)))
365 (&fix-hint 375 (&fix-hint
366 (hint (format #f (G_ "Try adding them to the 376 (hint (format #f (G_ "Try adding them to the
367@code{initrd-modules} field of your @code{operating-system} declaration, along 377@code{initrd-modules} field of your @code{operating-system} declaration, along
368these lines: 378these lines:
369 379
@@ -373,8 +383,8 @@ these lines:
373 (initrd-modules (append (list~{ ~s~}) 383 (initrd-modules (append (list~{ ~s~})
374 %base-initrd-modules))) 384 %base-initrd-modules)))
375@end example\n") 385@end example\n")
376 modules))) 386 modules)))
377 (&error-location 387 (&error-location
378 (location (source-properties->location location)))))))) 388 (location (source-properties->location location)))))))))
379 389
380;;; linux-initrd.scm ends here 390;;; linux-initrd.scm ends here