The only reliable way to bootstrap grub2 is to use a memdisk and an
embedded, minimal grub.cfg that does the live media path search and
then chainloads the real grub.cfg.
This change seems to work under VirtualBox and through isohybrid.
This hopefully fixes bug 4004.
This is not /boot/grub for a very good reason:
Our Live media uses /boot/sabayon instead of /boot/grub
and this has also the side effect that we can put
/boot/sabayon into the EFI Boot Partition avoiding
name clashing. Our /boot/sabayon inside that partition
will contain a simple grub.cfg doing two things:
1. set the correct prefix to the real grub boot partition
(via set prefix=(hdX,X)/boot/grub
2. load the real grub.cfg file (via configfile (hdX,X)/...)
In this way, we can ship a SecureBoot signed grubx64.efi
file and have it working with all the partition layouts.
The "bootstrap" grub.cfg file is created by our scripts
that are sourced by grub-mkconfig.