# single boot Gentoo mac mini

## kramdolf

Hello forum,

I want to place a fresh drive in a mac mini (2011 model) and install Gentoo (not dual boot).

I have read comments like "macs doesn't have a bios" and was just wondering if there is something I have to do besides

following the handbook and finding the right kernel modules to build and what about grub/lilo?

I am most interested in the lilo or grub installation method on this mac. It is not hardware locked to "OSX Lion" is it?

Thank you for advice.

----------

## gentoo_ram

You would need some kind of EFI bootloader since Macs use EFI.  I think Grub2 does EFI, but I'm really not sure.  Standard Grub and LILO certainly don't do EFI.  

Looks like what you want is rEFIt.  http://refit.sourceforge.net/

----------

## gemarcano

You could also look into rEFInd, which is based off rEFIt. The programmer for it seems to take Macs into consideration when releasing updates (there are a few fixes for Macs) so this might work as well. On  the same website, here, it also talks about something that might work in your case, if you plan to have a single OS on the Mac. The Linux kernel's EFI stub loader is probably the most stable way to go, from experience at least on a PC. Hope that helps!

----------

## khayyam

kramdolf ...

yes, single booting is quite possible, and there are other choice of efi bootloader/bootmanager besides grub and elilo, infact you can boot the kernel directly (using efi stub) if you so wish and not have a bootloader/bootmanager at all. The only bootloader I would avoid is rEFIt (not to be confused with rEFInd ... which is excelent, and I can hightly recommend).

The only issue that stands in your way is that in order to configure efi you need to boot efi, and as many install disks (gentoo's included) don't support this (currently) you will need to find one that does (or roll your own USB bootdisk). There is a work arround for this (ie: installing, setting a default /efi/boot/bootx64.efi, rebooting using apple 'Boot EFI' by holding the 'alt' key, and then configuring the efi firmware to load whatever bootloader you want) but its far better to have a bootdisk that supports efi booting/efivars so you don't have to do such convoluted things.

So, the disks I know to boot efi are the recent sysrescuecd beta, and probably Ubuntu, and RH/Fedora, these can then be used as your install disk as it don't matter what disk you boot from the install process for gentoo is the same.

Here is probably not the best place for a 'how to' but the basic outline is this:

Boot the bookdisk

Format the disk as GPT (using 'gdisk') create a 200mb 'EFI System Partiton' (you will already have one if the disk was formated for OSX, so this can be skipped, but perhaps not if this is a new disk). The 'EFI System Partition' should be formated as vfat.

Create the rest of the partitioning scheme as is outlined in the handbook, omiting /boot as the 'EFI System Partition' will be used for this

Do the install, again as outlined in the Handbook.

When it comes to building you kernel include support for 'EFI Stub' so, CONFIG_EFI_PARTITION=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_VARS=m (and CONFIG_FB_EFI=y if you want to use fbdev rather than the specific graphics driver for the card).

Mount your 'EFI System Partition' to /boot and copy your efi stub enabled kernel there as vmlinuz-<version>-gentoo.efi

emerge efibootmgr

Use efibootmgr to set the efivars to boot the kerenel

```
efibootmgr --create --part 1 --label "Gentoo" --loader "\boot\vmlinuz-<version>-gentoo.efi"
```

So, you should be able to boot directly into this kernel ... but you'll no doubt want to install a bootloader/bootmanager subsequently. This is farily easy, but it depends on which one you want to go with, and so I'll leave that for another time.

best ... khay

----------

