Browse Source

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.
python-updates
Andy Wingo 5 years ago
parent
commit
2941b347b6
No known key found for this signature in database GPG Key ID: A8803732E4436885
  1. 16
      gnu/bootloader/grub.scm
  2. 4
      gnu/system/examples/bare-bones.tmpl
  3. 7
      gnu/system/examples/desktop.tmpl
  4. 7
      gnu/system/examples/lightweight-desktop.tmpl

16
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)))

4
gnu/system/examples/bare-bones.tmpl

@ -12,7 +12,9 @@
;; Assuming /dev/sdX is the target hard disk, and "my-root" is
;; the label of the target root file system.
(bootloader (grub-configuration (device "/dev/sdX")))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(device "/dev/sdX")))
(file-systems (cons (file-system
(device "my-root")
(title 'label)

7
gnu/system/examples/desktop.tmpl

@ -13,19 +13,20 @@
;; Assuming /dev/sdX is the target hard disk, and "my-root"
;; is the label of the target root file system.
(bootloader (grub-configuration (device "/dev/sdX")))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(device "/dev/sdX")))
;; Specify a mapped device for the encrypted root partition.
;; The UUID is that returned by 'cryptsetup luksUUID'.
(mapped-devices
(list (mapped-device
(source (uuid "12345678-1234-1234-1234-123456789abc"))
(target "the-root-device")
(target "my-root")
(type luks-device-mapping))))
(file-systems (cons (file-system
(device "my-root")
(title 'label)
(mount-point "/")
(type "ext4")
(dependencies mapped-devices))

7
gnu/system/examples/lightweight-desktop.tmpl

@ -12,9 +12,10 @@
(locale "en_US.utf8")
;; Use the UEFI variant of GRUB with the EFI System
;; Partition on /dev/sda1.
(bootloader (grub-configuration (grub grub-efi)
(device "/dev/sda1")))
;; Partition mounted on /boot/efi.
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(device "/boot/efi")))
;; Assume the target root file system is labelled "my-root".
(file-systems (cons* (file-system

Loading…
Cancel
Save