Proper Linux kernel boot with EFI on Macbook

Original author: Arun Raghavan
  • Transfer
I suggest a somewhat free translation of the Gentoo programmer about the correct way to boot on laptops with EFI instead of BIOC on board.
I recently bought a Macbook Pro 13.3 inch and I decided to install Gentoo Linux on it.

No sooner said than done. In general, the installation was successful, apart from small misunderstandings like a broken keyboard from under LiveCD, the kernel sees the console only with vesafb.

The only thing that bothered me a bit was the BIOS emulation. Macs use Intel EFI to boot, and for the rest of the OS, Apple added a BIOS emulation level. This is how Ubuntu loads on Macs.

It seemed to me wrong in technical terms and in principle. I got a little stressed and I managed to start the Linux kernel from under EFI without any emulations. There is not enough documentation, so I want to share my way.

  1. EFI starts at boot.
  2. It launches rEFIt , a program that extends the capabilities of the default bootloader by adding a normal boot menu, command line, etc.
  3. Scans FAT/HFSpartitions (ext * are not supported) looking for a bootable directory that would contain /efi/; and boot images.
  4. Starts an Grub2EFI image from a FATpartition.
  5. Boots the Linux kernel from /boot(+ initrd/initramfsif specified).
  6. The kernel, as usual, is loaded from the root partition, you can select any file system.

It can be used elilo, but Grub2(more precisely Grub 1.97.1) it copes better, or rather, it is the only thing that somehow works with small modifications (add a flag efivia ebuild USE --with-platform=efi). I managed to configure the /bootpartition on the FAT file system, but this installkernelcauses a script to be launched from the kernel source directory to create symbolic links to the new and previous kernel images.

Instructions for installing the EFI image Grub2here . Install the EFI image in a directory, something like /efi/grub(there must be a path /efi). You blesscan skip the commands , they are for OS X. You can create a simple config file with the commandgrub-mkconfigand then modify it. However, in order to do Over Mind ™ manually edit the files from /etc/grub.d/.

Of course, you need to set EFI support in the kernel, but that’s all. Now you are aware with some manic obsessive satisfaction that you should not connect an extra link to support another proprietary interface that is beyond your visibility and control.

Also popular now: