summary refs log tree commit diff
path: root/gnu/bootloader/grub.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@igalia.com>2017-08-20 10:48:19 +0200
committerAndy Wingo <wingo@igalia.com>2017-08-20 11:16:42 +0200
commit2941b347b664a3d3114de0ac95e28db78db66144 (patch)
tree7615f881b2d26ec94692c975f4b0d7c28da8214b /gnu/bootloader/grub.scm
parent97291c0c7c6bc50aa503f9bf7f9abd97cffae9c9 (diff)
downloadguix-2941b347b664a3d3114de0ac95e28db78db66144.tar.gz
gnu: grub-efi-bootloader: Specialize grub-install invocation.
* gnu/bootloader/grub.scm (install-grub-efi): Fix grub-install invocation for
  EFI systems.
* gnu/system/examples/bare-bones.tmpl: Use the newer
"bootloader-configuration" syntax.
* gnu/system/examples/desktop.tmpl: Use bootloader-configuration sytax.  Also,
use the same label for the LUKS-mapped device and the root partition.  Remove
unneeded "title" field for the file-system based on LUKS; as noted in the
manual, the "title" field is ignored for mapped devices.
* gnu/system/examples/lightweight-desktop.tmpl: Use bootloader-configuration,
and use grub-efi-bootloader.
Diffstat (limited to 'gnu/bootloader/grub.scm')
-rw-r--r--gnu/bootloader/grub.scm16
1 files changed, 15 insertions, 1 deletions
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index ef62fe059b..a9f0875f36 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -389,7 +389,20 @@ submenu \"GNU system, old configurations...\" {~%")
         (unless (zero? (system* grub "--no-floppy"
                                 "--boot-directory" install-dir
                                 device))
-          (error "failed to install GRUB")))))
+          (error "failed to install GRUB (BIOS)")))))
+
+(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")))
+        ;; 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
+                                "--efi-directory" efi-dir))
+          (error "failed to install GRUB (EFI)")))))
 
 
 
@@ -408,6 +421,7 @@ submenu \"GNU system, old configurations...\" {~%")
 (define* grub-efi-bootloader
   (bootloader
    (inherit grub-bootloader)
+   (installer install-grub-efi)
    (name 'grub-efi)
    (package grub-efi)))