Ubuntu – Boot .efi files from GRUB2

androidbootgrub2

I've bought a Sony VAIO with UEFI booting and came with Windows 8 preinstalled. I successfully installed Ubuntu 13.10 and Windows 7 (triple-boot) and fixed the UEFI boot so GRUB2 is loading.

I was just wondering if I can boot .efi files from grub?

Related problems:

  • I used Clover EFI to boot OS X 10.9 (which I installed to boot, can't boot it with GRUB2: AICPUPM KP) and because of it I couldn't boot to either Windows or Ubuntu.

  • After that I installed Android 4.4 x86 and added its boot entry and I got KP related to efivar (or something like that), so I wanted to try Gummiboot.

My question is:

Can I boot .efi files such as gummiboot.efi and cloverx64.efi from GRUB2 so I can preserve it for Windows and Ubuntu booting?

Best Answer

It's basically the same as booting bootmgfw.efi from Windows 8, but a bit simpler.

menuentry "Gummiboot" {
        insmod chain
        insmod search_fs_uuid
        search --fs-uuid --no-floppy --set=root $UUID
        chainloader /EFI/boot/bootx64.efi
}

Just replace $UUID with the UUID of the filesystem where you have put Gummiboot or the efi-binary you want to boot (use blkid or ls -l /dev/disk/by-uuid/ to get the UUID). For FAT filesystems the UUID should look something similar to this: 00000-0000

insmod chain and insmod search_fs_uuid may just be optional, I could remove them from the configuration during my quick tests and was still able to boot the binary.

Alternatively you could add insmod ntfs or insmod ext2 if you have the binary on another filesystem like NTFS or EXT[234] (may require insmod part_msdos or insmod part_gpt if the filesystem is on a disk with a different partition table format).

/EFI/boot/bootx64.efi is my Gummiboot file in this example, as I have it as the default bootloader of my ESP.

Related Question