diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2019-03-16 17:09:19 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-03-16 18:15:13 +0100 |
| commit | 21fcfe1ee969cc477dc41486ae4074e655d44274 (patch) | |
| tree | b7663173568ecdddba0d38917657ac4831cd50f7 /gnu/bootloader | |
| parent | f0cc5e7e1e4c03af29c5d4855dc5962502c49147 (diff) | |
bootloader: Use 'invoke/quiet' when running 'grub-install' and co.
This hides potentially confusing GRUB messages from the user, such as
"Installing for i386-pc platform."
* gnu/bootloader/extlinux.scm (install-extlinux): Use 'invoke/quiet'
instead of 'system*' and 'error'.
* gnu/bootloader/grub.scm (install-grub, install-grub-efi): Likewise.
* guix/scripts/system.scm (bootloader-installer-script): Guard against
'message-condition?' and handle them properly.
Diffstat (limited to 'gnu/bootloader')
| -rw-r--r-- | gnu/bootloader/extlinux.scm | 8 | ||||
| -rw-r--r-- | gnu/bootloader/grub.scm | 16 |
2 files changed, 11 insertions, 13 deletions
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm index 2bb711eed13..40108584a8f 100644 --- a/gnu/bootloader/extlinux.scm +++ b/gnu/bootloader/extlinux.scm | |||
| @@ -91,11 +91,9 @@ TIMEOUT ~a~%" | |||
| 91 | (for-each (lambda (file) | 91 | (for-each (lambda (file) |
| 92 | (install-file file install-dir)) | 92 | (install-file file install-dir)) |
| 93 | (find-files syslinux-dir "\\.c32$")) | 93 | (find-files syslinux-dir "\\.c32$")) |
| 94 | (unless | 94 | (invoke/quiet extlinux "--install" install-dir) |
| 95 | (and (zero? (system* extlinux "--install" install-dir)) | 95 | (write-file-on-device (string-append syslinux-dir "/" #$mbr) |
| 96 | (write-file-on-device | 96 | 440 device 0)))) |
| 97 | (string-append syslinux-dir "/" #$mbr) 440 device 0)) | ||
| 98 | (error "failed to install SYSLINUX"))))) | ||
| 99 | 97 | ||
| 100 | (define install-extlinux-mbr | 98 | (define install-extlinux-mbr |
| 101 | (install-extlinux "mbr.bin")) | 99 | (install-extlinux "mbr.bin")) |
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 51d57873643..14aede72c5e 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm | |||
| @@ -369,10 +369,11 @@ submenu \"GNU system, old configurations...\" {~%") | |||
| 369 | ;; root partition. | 369 | ;; root partition. |
| 370 | (setenv "GRUB_ENABLE_CRYPTODISK" "y") | 370 | (setenv "GRUB_ENABLE_CRYPTODISK" "y") |
| 371 | 371 | ||
| 372 | (unless (zero? (system* grub "--no-floppy" "--target=i386-pc" | 372 | ;; Hide potentially confusing messages from the user, such as |
| 373 | "--boot-directory" install-dir | 373 | ;; "Installing for i386-pc platform." |
| 374 | device)) | 374 | (invoke/quiet grub "--no-floppy" "--target=i386-pc" |
| 375 | (error "failed to install GRUB (BIOS)"))))) | 375 | "--boot-directory" install-dir |
| 376 | device)))) | ||
| 376 | 377 | ||
| 377 | (define install-grub-efi | 378 | (define install-grub-efi |
| 378 | #~(lambda (bootloader efi-dir mount-point) | 379 | #~(lambda (bootloader efi-dir mount-point) |
| @@ -388,10 +389,9 @@ submenu \"GNU system, old configurations...\" {~%") | |||
| 388 | ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or | 389 | ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or |
| 389 | ;; root partition. | 390 | ;; root partition. |
| 390 | (setenv "GRUB_ENABLE_CRYPTODISK" "y") | 391 | (setenv "GRUB_ENABLE_CRYPTODISK" "y") |
| 391 | (unless (zero? (system* grub-install "--boot-directory" install-dir | 392 | (invoke/quiet grub-install "--boot-directory" install-dir |
| 392 | "--bootloader-id=Guix" | 393 | "--bootloader-id=Guix" |
| 393 | "--efi-directory" target-esp)) | 394 | "--efi-directory" target-esp)))) |
| 394 | (error "failed to install GRUB (EFI)"))))) | ||
| 395 | 395 | ||
| 396 | 396 | ||
| 397 | 397 | ||
