I'm running Linux on a 8,3 2011 MacBook Pro. It uses EFI/rEFIt to boot.
I was able to install GRUB2 EFI support, and it shows up just fine in the rEFIt boot menu. Everything seems to be working there.
What I did was this:
apt-get source grub2
sudo apt-get build-dep grub2
cd grub2-1.99
export EFI_ARCH=x86_64
./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix ""
make
This built everything required. Then, it was time to install the compiled grub.efi image:
cd grub-core
../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot
sudo mount -t vfat -o rw /dev/sda1 /mnt
sudo mkdir -p /mnt/EFI/grub
sudo cp grub.efi *.mod *.lst /mnt/EFI/grub
sudo touch /mnt/EFI/grub/grub.cfg
It's all looking good so far. When I rebooted into rEFIt, I could see the EFI GRUB menu entry in rEFIt and I was able to start it. Since I hadn't configured anything, I wasn't able to see anything, but I could have entered GRUB commands if I wanted to.
I then tried defining my GRUB config file like this:
menuentry "Linux (BIOS)" {
search --file --no-floppy --set=root /vmlinuz
loadbios /boot/vbios.bin /boot/int10.bin
linux /vmlinuz root=/dev/sda4 video=efifb
initrd /initrd.img
}
menuentry "Linux (BIOS + Fix Video)" {
search --file --no-floppy --set=root /vmlinuz
fix_video
loadbios /boot/vbios.bin /boot/int10.bin
linux /vmlinuz root=/dev/sda4 video=efifb
initrd /initrd.img
}
menuentry "Linux (No BIOS)" {
search --file --no-floppy --set=root /vmlinuz
fakebios
linux /vmlinuz root=/dev/sda4 video=efifb
initrd /initrd.img
}
Then, when I booted into GRUB from rEFIt, I could definitely see these menu entries. The problem is that each one yielded a message like this:
error: file not found
I assume that this refers to the fact that it can't find /vmlinuz, /boot/*, and /initrd.img, since they're not present in the EFI partition.
Where do I get these files from and how can I copy them to the EFI partition to get booting working?
Additionally, how do I specify which kernel to load? Will this GRUB loader just load my main /dev/sda4 GRUB menu after EFI has booted?