Subject: [bug#40955] [PATCH 3/5] build: bootloader: Add install-efi procedure.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 02 May 2020 14:16:13 +0200

Mathieu Othacehe <[email-masked]> skribis:

> * gnu/build/bootloader.scm (install-efi-loader): New exported procedure. This
> is based on install-efi from (gnu build vm) module.

Please mention the two new procedures.

> * gnu/build/vm.scm (initialize-hard-disk): Adapt to use install-efi-loader.

[…]

> +(define (install-efi-loader grub-efi esp)
> +  ;; Create a tiny configuration file telling the embedded grub
> +  ;; where to load the real thing.

Could you turn that into a docstring mentioning GRUB-EFI and ESP?

> +  ;; XXX This is quite fragile, and can prevent the image from booting
> +  ;; when there's more than one volume with this label present.
> +  ;; Reproducible almost-UUIDs could reduce the risk (not eliminate it).
> +  (let ((grub-config "grub.cfg"))
> +    (call-with-output-file grub-config
> +        (lambda (port)
         ^
Indentation is off.  :-)

> +          (format port
> +                  "insmod part_msdos~@
> +               search --set=root --label Guix_image~@
> +               configfile /boot/grub/grub.cfg~%")
> +          (fsync port)))

You sure we need an ‘fsync’ call here?  Perhaps add a comment explaining
why.

Otherwise LGTM!

Ludo’.