diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2018-03-03 09:33:34 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2018-03-03 09:41:21 +0100 |
| commit | eac026e5c80caae88a6cef317a46007dca343578 (patch) | |
| tree | a5aa55267a87e3c53b626960a14f837539521da5 /gnu/system/linux-initrd.scm | |
| parent | f850e0da8e56b8e38b0a6c49f4c0618f16c8c572 (diff) | |
linux-initrd: Add virtio modules to '%base-initrd-modules'.
Fixes a regression in installation tests, whereby 'guix system init'
would report that virtio modules are missing for the target devices.
In practice virtio modules were always available since 'base-initrd' was
always called with #:virtio? #t. This commit simply moves them to
'%base-initrd-modules' so that 'guix system' knows they're available.
Reported by Danny Milosavljevic <dannym@scratchpost.org> at
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30629#112>.
* gnu/system/linux-initrd.scm (default-initrd-modules): Add virtio
modules.
(base-initrd): Remove #:virtio? and 'virtio-modules'.
* gnu/system/vm.scm (expression->derivation-in-linux-vm)
(system-qemu-image, virtualized-operating-system): Remove uses of
#:virtio?.
* doc/guix.texi (Initial RAM Disk): Update 'base-initrd' doc.
Diffstat (limited to 'gnu/system/linux-initrd.scm')
| -rw-r--r-- | gnu/system/linux-initrd.scm | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 7a7592bf0a1..e0cb59c0098 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm | |||
| @@ -280,6 +280,11 @@ FILE-SYSTEMS." | |||
| 280 | 280 | ||
| 281 | (define* (default-initrd-modules #:optional (system (%current-system))) | 281 | (define* (default-initrd-modules #:optional (system (%current-system))) |
| 282 | "Return the list of modules included in the initrd by default." | 282 | "Return the list of modules included in the initrd by default." |
| 283 | (define virtio-modules | ||
| 284 | ;; Modules for Linux para-virtualized devices, for use in QEMU guests. | ||
| 285 | '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net" | ||
| 286 | "virtio_console")) | ||
| 287 | |||
| 283 | `("ahci" ;for SATA controllers | 288 | `("ahci" ;for SATA controllers |
| 284 | "usb-storage" "uas" ;for the installation image etc. | 289 | "usb-storage" "uas" ;for the installation image etc. |
| 285 | "usbhid" "hid-generic" "hid-apple" ;keyboards during early boot | 290 | "usbhid" "hid-generic" "hid-apple" ;keyboards during early boot |
| @@ -288,7 +293,9 @@ FILE-SYSTEMS." | |||
| 288 | ,@(if (string-match "^(x86_64|i[3-6]86)-" system) | 293 | ,@(if (string-match "^(x86_64|i[3-6]86)-" system) |
| 289 | '("pata_acpi" "pata_atiixp" ;for ATA controllers | 294 | '("pata_acpi" "pata_atiixp" ;for ATA controllers |
| 290 | "isci") ;for SAS controllers like Intel C602 | 295 | "isci") ;for SAS controllers like Intel C602 |
| 291 | '()))) | 296 | '()) |
| 297 | |||
| 298 | ,@virtio-modules)) | ||
| 292 | 299 | ||
| 293 | (define-syntax %base-initrd-modules | 300 | (define-syntax %base-initrd-modules |
| 294 | ;; This more closely matches our naming convention. | 301 | ;; This more closely matches our naming convention. |
| @@ -301,7 +308,6 @@ FILE-SYSTEMS." | |||
| 301 | (mapped-devices '()) | 308 | (mapped-devices '()) |
| 302 | qemu-networking? | 309 | qemu-networking? |
| 303 | volatile-root? | 310 | volatile-root? |
| 304 | (virtio? #t) | ||
| 305 | (extra-modules '()) ;deprecated | 311 | (extra-modules '()) ;deprecated |
| 306 | (on-error 'debug)) | 312 | (on-error 'debug)) |
| 307 | "Return a monadic derivation that builds a generic initrd, with kernel | 313 | "Return a monadic derivation that builds a generic initrd, with kernel |
| @@ -312,25 +318,13 @@ mappings to realize before FILE-SYSTEMS are mounted. | |||
| 312 | 318 | ||
| 313 | QEMU-NETWORKING? and VOLATILE-ROOT? behaves as in raw-initrd. | 319 | QEMU-NETWORKING? and VOLATILE-ROOT? behaves as in raw-initrd. |
| 314 | 320 | ||
| 315 | When VIRTIO? is true, load additional modules so the initrd can | ||
| 316 | be used as a QEMU guest with the root file system on a para-virtualized block | ||
| 317 | device. | ||
| 318 | |||
| 319 | The initrd is automatically populated with all the kernel modules necessary | 321 | The initrd is automatically populated with all the kernel modules necessary |
| 320 | for FILE-SYSTEMS and for the given options. However, additional kernel | 322 | for FILE-SYSTEMS and for the given options. Additional kernel |
| 321 | modules can be listed in EXTRA-MODULES. They will be added to the initrd, and | 323 | modules can be listed in LINUX-MODULES. They will be added to the initrd, and |
| 322 | loaded at boot time in the order in which they appear." | 324 | loaded at boot time in the order in which they appear." |
| 323 | (define virtio-modules | ||
| 324 | ;; Modules for Linux para-virtualized devices, for use in QEMU guests. | ||
| 325 | '("virtio_pci" "virtio_balloon" "virtio_blk" "virtio_net" | ||
| 326 | "virtio_console")) | ||
| 327 | |||
| 328 | (define linux-modules* | 325 | (define linux-modules* |
| 329 | ;; Modules added to the initrd and loaded from the initrd. | 326 | ;; Modules added to the initrd and loaded from the initrd. |
| 330 | `(,@linux-modules | 327 | `(,@linux-modules |
| 331 | ,@(if (or virtio? qemu-networking?) | ||
| 332 | virtio-modules | ||
| 333 | '()) | ||
| 334 | ,@(file-system-modules file-systems) | 328 | ,@(file-system-modules file-systems) |
| 335 | ,@(if volatile-root? | 329 | ,@(if volatile-root? |
| 336 | '("overlay") | 330 | '("overlay") |
