GRUB Legacy: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Kevin (talk | contribs)
m Interwiki
No edit summary
Line 213: Line 213:
*[http://grub.linuxeden.com/ GRUB for DOS]
*[http://grub.linuxeden.com/ GRUB for DOS]
*[http://www.pixelbeat.org/docs/disk/ GRUB PC Disk details]
*[http://www.pixelbeat.org/docs/disk/ GRUB PC Disk details]

==Grub for EFI==

This section will tell you how to compile, build and install Grub2 on an EFI system. This have been tested on an MacBook Pro6,1

===Compile===

First you need a x86_64 linux with gcc and binutils. I downloaded a Ubuntu 10.4 LiveCD, booted it in VirtualBox and installed it to disk.

You need to make sure gcc, bison, flex etc are installed. Do this with the apt package manager. apt-get install gcc bison flex is what i did.

You need the grub2 source code. I got that from ftp://alpha.gnu.org/gnu/grub/

Download grub-1.9-rc2.tar.gz and unpack it.

Next thing to do is "./configure --with-platform=efi --target=x86_64"

then "make"

Now you should have compiled grub2 efi if everything went ok.

===Build Grub.efi===

grub.efi is a bundle of tools including grub itself. You need to make the efi image by selecting what modules you want.

For Grub to be able to read disk partitions you need a module for that. Either you want plain-old bootsector and msdos style partition map or you want GPT (new fancy one) you need to select correct module when bundling grub.efi.

For your grub to be functional you should include as many filesystems as possible and also linux,multiboot,multiboot2 etc so that you can read any type of kernel from any type of filesystem.

So.. Lets build grub.efi

Go to "grub-core" folder.

Execute: ./grub-mkimage -d . -o grub.efi minicmd part_gpt part_msdos part_apple fat ext2 hfsplus hfs ntfs reiserfs xfs iso9660 udf ls search loopback linux multiboot multiboot2 chain reboot halt appleldr help configfile hexdump loadbios memrw fixvideo crc sh video gfxterm font png

That will build "grub.efi" in the subfolder and this can now be copied to a USB-disk, harddisk etc.

===Installing===

I partitioned my usbdisk with MacOSX diskutil, but any partition tool should/would do. I created a small 100mb partition as first partition and created a huge secondary partition for files. I formated the partition to HFS+, but i guess FAT should be more compatible since i dont think other EFI firmwares have HFS+ filesystem support like the Mac..

Anyway i created "/efi/grub/" folder and copied grub.efi to /efi/grub/grub.efi on my disk. I then created a grub.cfg file alongside with it.

To make OSX find the Grub.efi image on boot i did;

"sudo bless --verbose --folder=/Volumes/EFI --file=/Volumes/EFI/efi/grub/grub.efi --setBoot"

where /Volumes/EFI is the first partition on my usb disk..

Now i saved my work and rebooted.. Press/hold "option" key during boot will bring up boot menu. I now get an option to boot en EFI DISK. I select this and now Grub2 shows like any other Grub..

Configuration of grub and config file is like any other grub2 syntax.


[[Category:Bootloaders]]
[[Category:Bootloaders]]