[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#44353: [PATCH version-1.2.0 v2 2/3] bootloader: grub: Skip install-g
From: |
Maxim Cournoyer |
Subject: |
bug#44353: [PATCH version-1.2.0 v2 2/3] bootloader: grub: Skip install-grub-efi when producing a disk image. |
Date: |
Wed, 11 Nov 2020 22:57:12 -0500 |
Fixes <http://issues.guix.gnu.org/44353>.
Every bootloader should try their best to install themselves using only the
MOUNT-POINT and otherwise do nothing. This requirement comes from the
necessity to call INSTALL-GRUB when installing the (non-EFI) GRUB bootloader,
which needs to populate the root file system with extra modules that cannot be
fit in the core.img file, limited in size to 491520 bytes (by the i386-pc
format required for legacy BIOS compatibility).
As introducing bootloader knowledge at the level of the image code is
undesirable, every bootloader should be adapted to support this fall-back for
their installation procedure (TODO).
* gnu/bootloader/grub.scm (install-grub-efi)[efi-dir]: Skip when the EFI-DIR
argument is set to #f.
---
gnu/bootloader/grub.scm | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 0899fab61f..af7b7561ff 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -573,21 +573,24 @@ fi~%"))))
(define install-grub-efi
#~(lambda (bootloader efi-dir mount-point)
- ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the
- ;; system whose root is mounted at MOUNT-POINT.
- (let ((grub-install (string-append bootloader "/sbin/grub-install"))
- (install-dir (string-append mount-point "/boot"))
- ;; When installing Guix, it's common to mount EFI-DIR below
- ;; MOUNT-POINT rather than /boot/efi on the live image.
- (target-esp (if (file-exists? (string-append mount-point efi-dir))
- (string-append mount-point efi-dir)
- efi-dir)))
- ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
- ;; root partition.
- (setenv "GRUB_ENABLE_CRYPTODISK" "y")
- (invoke/quiet grub-install "--boot-directory" install-dir
- "--bootloader-id=Guix"
- "--efi-directory" target-esp))))
+ ;; There is nothing useful to do when called in the context of a disk
+ ;; image generation.
+ (when efi-dir
+ ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the
+ ;; system whose root is mounted at MOUNT-POINT.
+ (let ((grub-install (string-append bootloader "/sbin/grub-install"))
+ (install-dir (string-append mount-point "/boot"))
+ ;; When installing Guix, it's common to mount EFI-DIR below
+ ;; MOUNT-POINT rather than /boot/efi on the live image.
+ (target-esp (if (file-exists? (string-append mount-point
efi-dir))
+ (string-append mount-point efi-dir)
+ efi-dir)))
+ ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
+ ;; root partition.
+ (setenv "GRUB_ENABLE_CRYPTODISK" "y")
+ (invoke/quiet grub-install "--boot-directory" install-dir
+ "--bootloader-id=Guix"
+ "--efi-directory" target-esp)))))
(define (install-grub-efi-netboot subdir)
"Define a grub-efi-netboot bootloader installer for installation in SUBDIR,
--
2.28.0
- bug#44353: guix system disk-image -t raw fails with grub-efi-bootloader, Maxim Cournoyer, 2020/11/07
- bug#44353: guix system disk-image -t raw fails with grub-efi-bootloader, Mathieu Othacehe, 2020/11/07
- bug#44353: guix system disk-image -t raw fails with grub-efi-bootloader, Bengt Richter, 2020/11/07
- bug#44353: guix system disk-image -t raw fails with grub-efi-bootloader, Maxim Cournoyer, 2020/11/07
- bug#44353: guix system disk-image -t raw fails with grub-efi-bootloader, Mathieu Othacehe, 2020/11/08
- bug#44353: [PATCH version-1.2.0 v2 1/3] image: Remove conflicting user-provided EFI file system., Maxim Cournoyer, 2020/11/11
- bug#44353: [PATCH version-1.2.0 v2 3/3] doc: Detail which bootloader get used with disk-image or vm-image., Maxim Cournoyer, 2020/11/11
- bug#44353: [PATCH version-1.2.0 v2 3/3] doc: Detail which bootloader get used with disk-image or vm-image., Mathieu Othacehe, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2 3/3] doc: Detail which bootloader get used with disk-image or vm-image., Ludovic Courtès, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2 2/3] bootloader: grub: Skip install-grub-efi when producing a disk image.,
Maxim Cournoyer <=
- bug#44353: [PATCH version-1.2.0 v2 2/3] bootloader: grub: Skip install-grub-efi when producing a disk image., Mathieu Othacehe, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2 2/3] bootloader: grub: Skip install-grub-efi when producing a disk image., Maxim Cournoyer, 2020/11/17
- bug#44353: [PATCH version-1.2.0 v2 1/3] image: Remove conflicting user-provided EFI file system., Mathieu Othacehe, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2 1/3] image: Remove conflicting user-provided EFI file system., Maxim Cournoyer, 2020/11/17
- bug#44353: [PATCH version-1.2.0 v2] guix: system: Add a new '--non-volatile' option for disk-image., Maxim Cournoyer, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2] guix: system: Add a new '--non-volatile' option for disk-image., Mathieu Othacehe, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2] guix: system: Add a new '--non-volatile' option for disk-image., Maxim Cournoyer, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2] guix: system: Add a new '--non-volatile' option for disk-image., Mathieu Othacehe, 2020/11/12
- bug#44353: [PATCH version-1.2.0 v2] guix: system: Add a new '--non-volatile' option for disk-image., Maxim Cournoyer, 2020/11/17
- bug#44353: [PATCH version-1.2.0 v2] guix: system: Add a new '--non-volatile' option for disk-image., Ludovic Courtès, 2020/11/12