diff options
Diffstat (limited to 'gnu/bootloader/grub.scm')
| -rw-r--r-- | gnu/bootloader/grub.scm | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 0899fab61fa..af7b7561ff0 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm | |||
| @@ -573,21 +573,24 @@ fi~%")))) | |||
| 573 | 573 | ||
| 574 | (define install-grub-efi | 574 | (define install-grub-efi |
| 575 | #~(lambda (bootloader efi-dir mount-point) | 575 | #~(lambda (bootloader efi-dir mount-point) |
| 576 | ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the | 576 | ;; There is nothing useful to do when called in the context of a disk |
| 577 | ;; system whose root is mounted at MOUNT-POINT. | 577 | ;; image generation. |
| 578 | (let ((grub-install (string-append bootloader "/sbin/grub-install")) | 578 | (when efi-dir |
| 579 | (install-dir (string-append mount-point "/boot")) | 579 | ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the |
| 580 | ;; When installing Guix, it's common to mount EFI-DIR below | 580 | ;; system whose root is mounted at MOUNT-POINT. |
| 581 | ;; MOUNT-POINT rather than /boot/efi on the live image. | 581 | (let ((grub-install (string-append bootloader "/sbin/grub-install")) |
| 582 | (target-esp (if (file-exists? (string-append mount-point efi-dir)) | 582 | (install-dir (string-append mount-point "/boot")) |
| 583 | (string-append mount-point efi-dir) | 583 | ;; When installing Guix, it's common to mount EFI-DIR below |
| 584 | efi-dir))) | 584 | ;; MOUNT-POINT rather than /boot/efi on the live image. |
| 585 | ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or | 585 | (target-esp (if (file-exists? (string-append mount-point efi-dir)) |
| 586 | ;; root partition. | 586 | (string-append mount-point efi-dir) |
| 587 | (setenv "GRUB_ENABLE_CRYPTODISK" "y") | 587 | efi-dir))) |
| 588 | (invoke/quiet grub-install "--boot-directory" install-dir | 588 | ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or |
| 589 | "--bootloader-id=Guix" | 589 | ;; root partition. |
| 590 | "--efi-directory" target-esp)))) | 590 | (setenv "GRUB_ENABLE_CRYPTODISK" "y") |
| 591 | (invoke/quiet grub-install "--boot-directory" install-dir | ||
| 592 | "--bootloader-id=Guix" | ||
| 593 | "--efi-directory" target-esp))))) | ||
| 591 | 594 | ||
| 592 | (define (install-grub-efi-netboot subdir) | 595 | (define (install-grub-efi-netboot subdir) |
| 593 | "Define a grub-efi-netboot bootloader installer for installation in SUBDIR, | 596 | "Define a grub-efi-netboot bootloader installer for installation in SUBDIR, |
