summaryrefslogtreecommitdiff
path: root/gnu/bootloader
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-03-16 17:09:19 +0100
committerLudovic Courtès <ludo@gnu.org>2019-03-16 18:15:13 +0100
commit21fcfe1ee969cc477dc41486ae4074e655d44274 (patch)
treeb7663173568ecdddba0d38917657ac4831cd50f7 /gnu/bootloader
parentf0cc5e7e1e4c03af29c5d4855dc5962502c49147 (diff)
downloadpatches-21fcfe1ee969cc477dc41486ae4074e655d44274.tar
patches-21fcfe1ee969cc477dc41486ae4074e655d44274.tar.gz
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.scm8
-rw-r--r--gnu/bootloader/grub.scm16
2 files changed, 11 insertions, 13 deletions
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm
index 2bb711eed1..40108584a8 100644
--- a/gnu/bootloader/extlinux.scm
+++ b/gnu/bootloader/extlinux.scm
@@ -91,11 +91,9 @@ TIMEOUT ~a~%"
(for-each (lambda (file)
(install-file file install-dir))
(find-files syslinux-dir "\\.c32$"))
- (unless
- (and (zero? (system* extlinux "--install" install-dir))
- (write-file-on-device
- (string-append syslinux-dir "/" #$mbr) 440 device 0))
- (error "failed to install SYSLINUX")))))
+ (invoke/quiet extlinux "--install" install-dir)
+ (write-file-on-device (string-append syslinux-dir "/" #$mbr)
+ 440 device 0))))
(define install-extlinux-mbr
(install-extlinux "mbr.bin"))
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 51d5787364..14aede72c5 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -369,10 +369,11 @@ submenu \"GNU system, old configurations...\" {~%")
;; root partition.
(setenv "GRUB_ENABLE_CRYPTODISK" "y")
- (unless (zero? (system* grub "--no-floppy" "--target=i386-pc"
- "--boot-directory" install-dir
- device))
- (error "failed to install GRUB (BIOS)")))))
+ ;; Hide potentially confusing messages from the user, such as
+ ;; "Installing for i386-pc platform."
+ (invoke/quiet grub "--no-floppy" "--target=i386-pc"
+ "--boot-directory" install-dir
+ device))))
(define install-grub-efi
#~(lambda (bootloader efi-dir mount-point)
@@ -388,10 +389,9 @@ submenu \"GNU system, old configurations...\" {~%")
;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
;; root partition.
(setenv "GRUB_ENABLE_CRYPTODISK" "y")
- (unless (zero? (system* grub-install "--boot-directory" install-dir
- "--bootloader-id=Guix"
- "--efi-directory" target-esp))
- (error "failed to install GRUB (EFI)")))))
+ (invoke/quiet grub-install "--boot-directory" install-dir
+ "--bootloader-id=Guix"
+ "--efi-directory" target-esp))))