Subject: [bug#27695] [PATCH 1/2] bootloader: Add grub-hybrid-bootloader.

From: Danny Milosavljevic <[email-masked]>
Date: Thu, 20 Jul 2017 20:42:07 +0200

> I hope someone else knows.  I don't have EFI hardware so I'm really the wrong person to find out that stuff.  Well I could try reading the documentation / asking and hoping that it's all correct, but ... you know... paper is patient :)

I read up on EFI some more.  Apparently EFI can load files from FAT partitions and execute them.

There's the tool "grub-mkstandalone" which will put the GRUB bootloader into an executable file that you can then put on the FAT partition - which the EFI system will later boot from.

So I guess we already do all that's required for installed-hybrid support because Marius already added the grub-mkstandalone invocation to gnu/build/vm.scm - and we install the traditional grub-pc otherwise.  So isn't it already hybrid?  Can't be far off.

Maybe I contributed to the confusion, but my meddling with grub-efi and grub-hybrid is really just to have grub-mkrescue build a hybrid ISO, nothing else.  I don't use grub-install at all there (and I don't use grub-mkstandalone either).

I think the best way forward for the ISO image to do it like that:
* Add grub-hybrid to (gnu packages bootloaders) - but don't add a (gnu bootloaders) entry.  Don't use grub-hybrid for anything except when creating the ISO image.
* Either make gnu/system/install.scm directly depend on grub-hybrid as "bootloader" package - or just have make-iso9660-image always override it by grub-hybrid. 

That's it.  I don't think we have to fiddle with the regular Guix bootloaders or even with the existing bootloader packages at all.