UEFI Bootloaders

From ArchWiki
Revision as of 10:57, 16 May 2012 by The.ridikulus.rat (Talk | contribs) (Initial page - Setting up Kernel EFISTUB)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page contains info about various UEFI Bootloaders capable of booting Linux kernel. The following bootloaders (listed in decreasing order of stability) are explained here:

  1. Linux Kernel EFISTUB
  2. GRUB2
  3. Fedora's GRUB-Legacy fork
  4. ELILO
  5. Efilinux

Linux Kernel EFISTUB

Linux Kernel >= 3.3 is capable of acting as its own UEFI bootloader, thus removing the need for a separate bootloader (a boot manager might be required though, explained in detail later). This support is called EFI BOOT STUB by upstream or EFISTUB in short. EFISTUB should enabled by setting CONFIG_EFI_STUB=y in Kernel config. The upstream documentation about EFISTUB booting is at https://lkml.org/lkml/2012/3/16/194 . More (unofficial) info at http://www.rodsbooks.com/efi-bootloaders/efistub.html .

Since the kernel is responsible for booting only itself, a single EFISTUB enabled kernel is not capable of launching other kernels. And each EFISTUB Kernel+Initramfs pair requires a separate boot menu entry. This when multiple kernels and/or initramfs files are involved, a UEFI Boot Manager is recommended.

Setting up EFISTUB

  1. Create an FAT32 UEFI System Partition - Unified_Extensible_Firmware_Interface#Create_an_UEFI_System_Partition_in_Linux
  2. Mount the UEFI System Partition at /boot/efi.
  3. Create /boot/efi/EFI/arch/ directory.
  4. Copy /boot/vmlinuz-linux to /boot/efi/EFI/arch/vmlinuz-linux.efi . The .efi extension is very important.
  5. Copy /boot/initramfs-linux.img to /boot/efi/EFI/arch/initramfs-linux.img.
  6. Create /boot/efi/EFI/arch/linux.conf with the kernel parameters to be passed to the kernel (examply file shown below). (This config file is not supported by any currently shipping kernel version and is expected to be supported in kernel 3.5).
/boot/efi/EFI/arch/linux.conf
root=/dev/sdaX rootfstype=ext4 add_efi_memmap initrd=\EFI\arch\initramfs-linux.img
Warning: In Linux Kernel EFISTUB booting, initrd= path should use UEFI-style backslashes (\) and should be relative to the UEFI System Partition's root, not relative to the current directory in the UEFI Shell. An improper initrd= option leads to a system hang without any error message from the firmware or the kernel.

Booting EFISTUB

rEFInd

http://www.rodsbooks.com/refind/linux.html rEFInd] - AUR package refind-x86_64AUR - for a menu.

  1. GRUB2 - Follow instructions in GRUB2#UEFI_systems page. For bzr development version try AUR package - grub2-efi-bzrAUR.
  2. GRUB-Legacy - Upstream sources do not support UEFI, nor does Archlinux patched versions. Only Fedora's patched GRUB (with UEFI and GPT patches from Intel) is known to support UEFI. grub-fedora git repo. AUR package - grub-legacy-fedora-efi-x86_64-gitAUR.
  3. Elilo - UEFI version of LILO Boot Loader - Still in development but at a slow pace. Config file similar to LILO. AUR package - elilo-x86_64AUR.
  4. Efilinux - Reference Implementation of a x86_64 UEFI Linux Bootloader - Still in alpha phase. AUR package - efilinux-x86_64-gitAUR. Usage instructions - http://thread.gmane.org/gmane.linux.kernel/1172645 and http://article.gmane.org/gmane.linux.kernel/1175060