mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
linux-initrd: Move 'check-device-initrd-modules' elsewhere.
This mostly reverts ca23693d28
, which
introduced a circular dependency between (gnu system linux-initrd)
and (gnu system mapped-devices).
Reported by Eric Bavier.
* gnu/system/linux-initrd.scm (check-device-initrd-modules): Move to...
* gnu/system/mapped-devices.scm (check-device-initrd-modules): ... here.
* po/guix/POTFILES.in: Adjust accordingly.
This commit is contained in:
parent
d661ed521e
commit
8ab10c19d7
3 changed files with 49 additions and 48 deletions
|
@ -24,7 +24,6 @@
|
|||
#:use-module (guix store)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (guix i18n)
|
||||
#:use-module ((guix store)
|
||||
#:select (%store-prefix))
|
||||
#:use-module ((guix derivations)
|
||||
|
@ -38,22 +37,16 @@
|
|||
#:select (%guile-static-stripped))
|
||||
#:use-module (gnu system file-systems)
|
||||
#:use-module (gnu system mapped-devices)
|
||||
#:autoload (gnu build linux-modules)
|
||||
(device-module-aliases matching-modules known-module-aliases)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 regex)
|
||||
#:use-module (ice-9 vlist)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (srfi srfi-34)
|
||||
#:use-module (srfi srfi-35)
|
||||
#:export (expression->initrd
|
||||
%base-initrd-modules
|
||||
raw-initrd
|
||||
file-system-packages
|
||||
base-initrd
|
||||
check-device-initrd-modules))
|
||||
base-initrd))
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
|
@ -350,41 +343,4 @@ loaded at boot time in the order in which they appear."
|
|||
#:volatile-root? volatile-root?
|
||||
#:on-error on-error))
|
||||
|
||||
(define (check-device-initrd-modules device linux-modules location)
|
||||
"Raise an error if DEVICE needs modules beyond LINUX-MODULES to operate.
|
||||
DEVICE must be a \"/dev\" file name."
|
||||
(define aliases
|
||||
;; Attempt to load 'modules.alias' from the current kernel, assuming we're
|
||||
;; on GuixSD, and assuming that corresponds to the kernel we'll be
|
||||
;; installing. Skip the whole thing if that file cannot be read.
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(known-module-aliases))
|
||||
(const #f)))
|
||||
|
||||
(when aliases
|
||||
(let ((modules (delete-duplicates
|
||||
(append-map (cut matching-modules <> aliases)
|
||||
(device-module-aliases device)))))
|
||||
(unless (every (cute member <> linux-modules) modules)
|
||||
(raise (condition
|
||||
(&message
|
||||
(message (format #f (G_ "you may need these modules \
|
||||
in the initrd for ~a:~{ ~a~}")
|
||||
device modules)))
|
||||
(&fix-hint
|
||||
(hint (format #f (G_ "Try adding them to the
|
||||
@code{initrd-modules} field of your @code{operating-system} declaration, along
|
||||
these lines:
|
||||
|
||||
@example
|
||||
(operating-system
|
||||
;; @dots{}
|
||||
(initrd-modules (append (list~{ ~s~})
|
||||
%base-initrd-modules)))
|
||||
@end example\n")
|
||||
modules)))
|
||||
(&error-location
|
||||
(location (source-properties->location location)))))))))
|
||||
|
||||
;;; linux-initrd.scm ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue