diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2018-03-15 23:41:31 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2018-03-15 23:46:16 +0100 |
| commit | 8ab10c19d72caab7459034a6e72b0117d7c5cec8 (patch) | |
| tree | 35ab14d1f7f1514ab906580bd871a3409180e26e /gnu/system/linux-initrd.scm | |
| parent | d661ed521eedf4663c57e5d96e409a32a52113e0 (diff) | |
linux-initrd: Move 'check-device-initrd-modules' elsewhere.
This mostly reverts ca23693d280de5c4031058da4d3041d830080484, 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.
Diffstat (limited to 'gnu/system/linux-initrd.scm')
| -rw-r--r-- | gnu/system/linux-initrd.scm | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 410484390c5..e0cb59c0098 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #:use-module (guix store) | 24 | #:use-module (guix store) |
| 25 | #:use-module (guix gexp) | 25 | #:use-module (guix gexp) |
| 26 | #:use-module (guix utils) | 26 | #:use-module (guix utils) |
| 27 | #:use-module (guix i18n) | ||
| 28 | #:use-module ((guix store) | 27 | #:use-module ((guix store) |
| 29 | #:select (%store-prefix)) | 28 | #:select (%store-prefix)) |
| 30 | #:use-module ((guix derivations) | 29 | #:use-module ((guix derivations) |
| @@ -38,22 +37,16 @@ | |||
| 38 | #:select (%guile-static-stripped)) | 37 | #:select (%guile-static-stripped)) |
| 39 | #:use-module (gnu system file-systems) | 38 | #:use-module (gnu system file-systems) |
| 40 | #:use-module (gnu system mapped-devices) | 39 | #:use-module (gnu system mapped-devices) |
| 41 | #:autoload (gnu build linux-modules) | ||
| 42 | (device-module-aliases matching-modules known-module-aliases) | ||
| 43 | #:use-module (ice-9 match) | 40 | #:use-module (ice-9 match) |
| 44 | #:use-module (ice-9 regex) | 41 | #:use-module (ice-9 regex) |
| 45 | #:use-module (ice-9 vlist) | 42 | #:use-module (ice-9 vlist) |
| 46 | #:use-module (ice-9 format) | ||
| 47 | #:use-module (srfi srfi-1) | 43 | #:use-module (srfi srfi-1) |
| 48 | #:use-module (srfi srfi-26) | 44 | #:use-module (srfi srfi-26) |
| 49 | #:use-module (srfi srfi-34) | ||
| 50 | #:use-module (srfi srfi-35) | ||
| 51 | #:export (expression->initrd | 45 | #:export (expression->initrd |
| 52 | %base-initrd-modules | 46 | %base-initrd-modules |
| 53 | raw-initrd | 47 | raw-initrd |
| 54 | file-system-packages | 48 | file-system-packages |
| 55 | base-initrd | 49 | base-initrd)) |
| 56 | check-device-initrd-modules)) | ||
| 57 | 50 | ||
| 58 | 51 | ||
| 59 | ;;; Commentary: | 52 | ;;; Commentary: |
| @@ -350,41 +343,4 @@ loaded at boot time in the order in which they appear." | |||
| 350 | #:volatile-root? volatile-root? | 343 | #:volatile-root? volatile-root? |
| 351 | #:on-error on-error)) | 344 | #:on-error on-error)) |
| 352 | 345 | ||
| 353 | (define (check-device-initrd-modules device linux-modules location) | ||
| 354 | "Raise an error if DEVICE needs modules beyond LINUX-MODULES to operate. | ||
| 355 | DEVICE must be a \"/dev\" file name." | ||
| 356 | (define aliases | ||
| 357 | ;; Attempt to load 'modules.alias' from the current kernel, assuming we're | ||
| 358 | ;; on GuixSD, and assuming that corresponds to the kernel we'll be | ||
| 359 | ;; installing. Skip the whole thing if that file cannot be read. | ||
| 360 | (catch 'system-error | ||
| 361 | (lambda () | ||
| 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 \ | ||
| 373 | in the initrd for ~a:~{ ~a~}") | ||
| 374 | device modules))) | ||
| 375 | (&fix-hint | ||
| 376 | (hint (format #f (G_ "Try adding them to the | ||
| 377 | @code{initrd-modules} field of your @code{operating-system} declaration, along | ||
| 378 | these lines: | ||
| 379 | |||
| 380 | @example | ||
| 381 | (operating-system | ||
| 382 | ;; @dots{} | ||
| 383 | (initrd-modules (append (list~{ ~s~}) | ||
| 384 | %base-initrd-modules))) | ||
| 385 | @end example\n") | ||
| 386 | modules))) | ||
| 387 | (&error-location | ||
| 388 | (location (source-properties->location location))))))))) | ||
| 389 | |||
| 390 | ;;; linux-initrd.scm ends here | 346 | ;;; linux-initrd.scm ends here |
