Jake: PM me with all of this. EFI does not have a place in the forum. James On 7/25/11 5:50 PM, SpawnHappyJake wrote:
One quick note: I've just about mastered EFI booting. That has to do with this thread if one wants to run WINE in a Live Linux Installer with a persistence file on a thumb drive inserted into a Mac. The trick is to get the prefix and the root set correctly, and to build the grub efi image correctly. The prefix is where grub looks for grub modules and grub.cfg, the configuration file, used to specify menu entries and just about everything else. The root is which partition of which hard drive grub is looking in. By default, grub looks in /boot/grub for the grub modules and grub.cfg, and on the drive it was booted off of. As far as which partition, that is specified by the grub image when it is put on the drive, or in the case of a grub image file for EFI, if the image does not specify a partition or drive, the root is the usually the drive and partition the file is located on. Typing "set" at the grub commandline will show you the current root and prefix. "set root=[fill in blank]" sets the root, and likewise, "set prefix=[fill in blank]" sets the prefix. "ls" lists the drives and partitions of drives. "ls (hd0,1)/" lists the contents of that partition if the modules are in place to do so (need the part_msdos module inserted if the drive is MBR structured, the part_gpt module inserted if the drive is GPT structured, and you need the module necessary for interpreting the partition's filesystem inserted), don't forget the slash at the end. Not only does grub need to be compiled for your architecture (architecture means BIOS or EFI as well as 32-bit or 64-bit, thus there are 4 common architectures of grub), the grub modules need to as well. So if you intend on using your thumb drive on both BIOS machines and EFI machines, you will need BIOS grub and EFI grub on the thumb drive, and the modules compiled for BIOS will have to be in one folder, and the modules compiled for EFI will need to be in another folder. In fact, you should have three: BIOS, 32-bit EFI (i386-efi), and 64-bit EFI (x86_64-efi). That way you can boot on a BIOS machine, a 32-bit Mac, or a 64-bit Mac. Each such folder will contain its own grub.cfg, and they will need to be different grub.cfg files because different situations call for different settings in the configuration files. Remember, by defualt, grub looks in (drive it boots off of, and the partition of the drive specified by the image, or partition the image file is on)/boot/grub. But if you install BIOS grub to your thumb drive as well, unless you specified a custom BIOS grub image that looks somewhere other than /boot/grub, /boot/grub will already be taken and used by BIOS grub, so you need to store your modules for EFI grub elsewhere. That means you need to specify the non-default location of the EFI modules and grub.cfg file when you build the grub EFI image, or else EFI grub will look in the defualt location of '/boot/grub' and find the BIOS grub modules, and complain that they are the wrong architecture with this error "invaild arch dependent ELF magic [arch is short for architecture]". The "-p" when building the grub image specifies the prefix. When you build the efi image with grub-mkimage, don't say: Code: -p "" . Say Code: -p /boot/grub/x86_efi [or wherever you put modules and grub.cfg file for this grub image] , or else grub will be lost and come to a commandline if you put the modules and config file anywhere other than the default place of looking, which is /boot/grub, which I reserve for the BIOS grub modules (and that's how it works out by defualt). The grub efi image that comes with Linux Mint 11 64-bit was not made correctly. It gets lost and comes to a commandline because it thinks the prefix is in the memdisk, which I don't think even contains anything. I wouldn't imbed a memdisk. You want it to set the root to the drive containing grub, which it should if there is no memdisk, and you don't specify the drive. I have a feeling that memdisk has a higher priority than hd0 (the drive grub is booted off of) when it comes to setting the root. You could specify hd0 when you build the image, but if you do, you also have to specify the partition, which makes it lose its portability. This is what I mean: "-p (hd0,msdos1)/boot/grub/x86-efi", now that grub image will always look there, and cannot be moved to another partition. Cheers, Jake