[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/10: bootloader: grub: Do not run grub-install when creating a disk-im
From: |
guix-commits |
Subject: |
02/10: bootloader: grub: Do not run grub-install when creating a disk-image. |
Date: |
Sat, 23 May 2020 13:37:21 -0400 (EDT) |
mothacehe pushed a commit to branch wip-hurd-vm
in repository guix.
commit 9b0486de9d7b4f7653bc0e6820e05b36ae6e1a8c
Author: Mathieu Othacehe <address@hidden>
AuthorDate: Sat May 23 19:09:38 2020 +0200
bootloader: grub: Do not run grub-install when creating a disk-image.
* gnu/bootloader/grub.scm (install-grub): When creating a disk-image,
grub-install will fail because it lacks root permissions. In that case, do
not
run grub-install and only copy Grub modules to the /boot directory.
---
gnu/bootloader/grub.scm | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 83ab9e8..033a84f 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -469,18 +469,24 @@ fi~%"))))
(define install-grub
#~(lambda (bootloader device mount-point)
- ;; Install GRUB on DEVICE which is mounted at MOUNT-POINT.
(let ((grub (string-append bootloader "/sbin/grub-install"))
(install-dir (string-append mount-point "/boot")))
- ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
- ;; root partition.
- (setenv "GRUB_ENABLE_CRYPTODISK" "y")
-
- ;; 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))))
+ ;; Install GRUB on DEVICE which is mounted at MOUNT-POINT. If device
+ ;; is #f we are creating a disk-image.
+ (if device
+ (begin
+ ;; Tell 'grub-install' that there might be a LUKS-encrypted
+ ;; /boot or root partition.
+ (setenv "GRUB_ENABLE_CRYPTODISK" "y")
+
+ ;; 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))
+ ;; When creating a disk-image, only install Grub modules.
+ (copy-recursively (string-append bootloader "/lib/")
+ install-dir)))))
(define install-grub-disk-image
#~(lambda (bootloader root-index image)
- branch wip-hurd-vm updated (cd57c13 -> 7c919d1), guix-commits, 2020/05/23
- 04/10: image: Add bootloader installation support., guix-commits, 2020/05/23
- 01/10: bootloader: Add 'disk-image-installer'., guix-commits, 2020/05/23
- 02/10: bootloader: grub: Do not run grub-install when creating a disk-image.,
guix-commits <=
- 03/10: bootloader: grub: Use inheritance to define grub-minimal-bootloader., guix-commits, 2020/05/23
- 05/10: system: image: Correct genimage configuration file indentation., guix-commits, 2020/05/23
- 09/10: !squash system: Fix initrd field., guix-commits, 2020/05/23
- 06/10: image: Use grub-efi to install the EFI bootloader., guix-commits, 2020/05/23
- 07/10: system: image: Fix image-with-os., guix-commits, 2020/05/23
- 10/10: image: Add Hurd support., guix-commits, 2020/05/23
- 08/10: image: Do not use VM to create disk-images., guix-commits, 2020/05/23