Building Elilo

From Mactel-Linux

elilo is the Linux boot loader for EFI systems. It was initially developed for IA64 (Itanium) systems, but also works on 32-bit EFI machines like the Intel Macs.

This page collects tips for building elilo. See Using elilo for information how to actually boot Linux with elilo.

Contents

Requisites

What you'll need to build elilo:

  • A Linux system on i386
  • elilo source, either a release tarball or a CVS checkout
  • gcc 3.x or 4.x
  • A recent version of binutils that supports the efi-app-ia32 target
  • gnu-efi 3.x

Making it work

A working gnu-efi build environment depends on two factors: the gcc version and the gnu-efi linker script. Both need to match to produce working EFI binaries. Note that there are great differences between gnu-efi versions 3.0a, 3.0b and 3.0c.

Background: gnu-efi works by first generating an ELF shared library (.so) with a special section arrangement. Then objcopy is used to generate a PE32 binary (with the EFI system identifier) from the ELF object.

Known good constellations:

  • Debian sarge, gcc 3.3.5, binutils 2.15, gnu-efi 3.0a, a linker script patch from Joshua LeVassour.
  • Gentoo 2005.1, gcc 3.3.6, binutils 2.16.1, gnu-efi 3.0a.

Ubuntu also seems to have a working environment in the current development release.

Building

elilo comes with a Makefile that works out of the box, at least on Debian systems. The end result of the build is a file named elilo.efi, which you can copy to your Mac and use it to boot Linux.

Patches

This patch adds code to elilo to switch the EFI console into text mode. With this patch, you can use elilo as the sole boot loader on an Intel Mac, i.e. without rEFIt or ebounce.efi. Just use bless to set elilo.efi as the boot loader.