[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/35: bootloader: grub: Do not run grub-install when creating a disk-im
From: |
guix-commits |
Subject: |
10/35: bootloader: grub: Do not run grub-install when creating a disk-image. |
Date: |
Thu, 28 May 2020 13:03:30 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 1231aec738b4fc235ad67f362c9e6fb5564ad8ea
Author: Mathieu Othacehe <othacehe@gnu.org>
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 74dc004..29bec92 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -423,18 +423,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)
- 09/35: bootloader: Add 'disk-image-installer'., (continued)
- 09/35: bootloader: Add 'disk-image-installer'., guix-commits, 2020/05/28
- 16/35: image: Do not use VM to create disk-images., guix-commits, 2020/05/28
- 21/35: system: Add 'hurd' field to <operating-system>., guix-commits, 2020/05/28
- 23/35: system: Add 'multiboot-modules' field to <boot-parameters>., guix-commits, 2020/05/28
- 25/35: system: Use 'hurd' package in label., guix-commits, 2020/05/28
- 26/35: system: examples: Add bare-hurd.tmpl., guix-commits, 2020/05/28
- 29/35: services: hurd: Use activation-service, hurd-etc-service., guix-commits, 2020/05/28
- 31/35: services: Add `hurd-console-service-type'., guix-commits, 2020/05/28
- 32/35: services: Add `hurd-getty-service-type'., guix-commits, 2020/05/28
- 04/35: vm: 'qemu-image' preserves the cross-compilation target of the OS., guix-commits, 2020/05/28
- 10/35: bootloader: grub: Do not run grub-install when creating a disk-image.,
guix-commits <=
- 12/35: image: Add bootloader installation support., guix-commits, 2020/05/28
- 19/35: image: Support extra-directives, add hurd-directives., guix-commits, 2020/05/28
- 20/35: system: hurd: Add hurd-default-essential-services., guix-commits, 2020/05/28
- 22/35: bootloader: Extend `<menu-entry>' for multiboot., guix-commits, 2020/05/28
- 27/35: services: hurd: Add `hurd-etc-service'., guix-commits, 2020/05/28
- 11/35: bootloader: grub: Use inheritance to define grub-minimal-bootloader., guix-commits, 2020/05/28
- 24/35: bootloader: grub: Add support for multiboot., guix-commits, 2020/05/28
- 28/35: system: Add `hurd-activation'., guix-commits, 2020/05/28
- 30/35: gnu: hurd: Create minimal "runsystem" script to invoke "rc"., guix-commits, 2020/05/28
- 33/35: system: hurd: Populate services., guix-commits, 2020/05/28