EFI booting - BIOS, EFI, Ati card and hybrid graphics

There are three ways to boot ubuntu on the macbook pro: BIOS boot, EFI boot or EFI stub boot.

For some users (for instance without internal cd drive) it might be difficult or impossible to boot the live cd or usb pen on BIOS mode, because the bios will not be able to load the cd from an external drive. In these cases it is advised to boot in EFI mode. Also, the only way to use the integrated Intel graphics card is to boot in EFI mode.

Booting in EFI mode is not straightforward because the radeon card will not load properly since it needs access to the BIOS in order to retrieve some data. Booting straight of a live cd or usb pen in EFI mode will result in a black screen. There are three solutions to this:

  1. Disable the discrete graphics card and use only the integrated graphics card (see Booting from usb pen via EFI).
  2. Dump the bios into a file and load at at start so that the radeon will work when EFI booting.

  3. Boot via EFI stub method directly from rEFInd (no GRUB) and use the discrete graphics card (see Booting via EFI stub).

Booting from usb pen via EFI

To successfully boot via EFI we need to turn off the radeon card, since it won't be able to access the BIOS and will fail to load (error in dmesg: radeon 0000:01:00.0: Invalid ROM contents . To do this we need add some outb commands in GRUB and set some options:

  • Download the normal image and dd it onto your USB
  • During boot hold down the option key and select EFI boot ( USB Icon )
  • On GRUB edit the entry for ubuntu. Add the following after insmod ext2

outb 0x728 1 # Switch select
outb 0x710 2 # Switch display
outb 0x740 2 # Switch DDC
outb 0x750 0 # Power down discrete graphics
  • Add after quiet splash -

    quiet splash i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0

This will disable the radeon card and only use the integrated card. After the usb pen boots you should be able to install ubuntu. In order to then boot ubuntu from disk after installation you will need to change the GRUB entry on disk permanently to have the entries above. Probably the first time you boot you have to set make the changes in the GRUB by hand, and after you manage to login into ubuntu you can then make those changes permanent.

Booting via EFI stub

The kernel is able to get the information needed from the BIOS for starting up the radeon graphics card when booting in EFI stub mode (see https://bugs.freedesktop.org/show_bug.cgi?id=26891). In EFI stub mode the GRUB is not used and the kernel is started directly by the EFI bootloader. To boot in this way first install rEFInd from OSX (follow the instructions at http://www.rodsbooks.com/refind/) and reboot. The kernel should appear as an option in the startup boot screen.

EFI stub booting with btrfs

In case you are using the btrfs filesystem, refind will not be able to access /boot and will not see the kernel images. In that case you will need to copy the kernel images into the ESP partition that rEFInd can see. Follow instructions at

  1. Install refind via OSX onto the ESP  install.sh --esp 

  2. Copy your kernel file (vmlinuz-*) and matching initial RAM disk file (init*) from /boot /boot/efi/EFI/ubuntu
  3. Edit /boot/efi/EFI/ubuntu/refind.conf and add a menu entry for your kernel. Example:

menuentry "My Linux" {
        icon EFI/refind/icons/os_linux.icns
        loader /EFI/ubuntu/vmlinuz-3.8.0-22-lowlatency
        initrd /EFI/ubuntu/initrd.img-3.8.0-22-lowlatency
        options "root=UUID=f2e4e4h3-2f8e-4764-a818-de9176405c4b ro rootflags=subvol=@ nosplash"
        enabled
}

You should now be ablet to boot by selecting "My Linux" from the refind boot menu and the radeon graphics card will be operational.

Additional settings for discrete graphics

Once you are up and running and using the discrete radeon graphics you may notice that your system uses the integrated Intel graphics at the same time and overlays the two graphics outputs. To resolve this you can add the kernel options i915.modeset=0 radeon.modeset=1 to explicitly disable the integrated Intel graphics card.

If you are using the refind auto-detected kernel you must create a configuration file refind_linux.conf in the same directory as your kernel files (probably /boot/) follow the instructions at http://www.rodsbooks.com/refind/linux.html. Below is a sample file, this is just a sample and will not work as is, you must changed the UUID of the boot partition accordingly:

"Boot with defaults"         "root=UUID=7db14595-446d-481b-8704-d4bd5aefe70b ro quiet splash i915.modeset=0 radeon.modeset=1 vt.handoff=7"
"Boot into single-user mode" "root=UUID=7db14595-446d-481b-8704-d4bd5aefe70b ro single"
"Boot without graphics"      "root=UUID=7db14595-446d-481b-8704-d4bd5aefe70b ro"
}


CategoryMac

MacBookPro8-2/Raring (last edited 2013-09-08 03:45:12 by dewildt)