Linux EFI stub

The Linux EFI stub makes the kernel image also be an EFI PE/COFF executable that is directly executable by UEFI. The stub takes care of loading and starting the Linux kernel, including loading the initrd and device tree. The EFI stub obsoletes the non-standard "built-in Linux loader" currently included in ARM UEFI platforms. The ARM EFI stub is based on, and shares code with, the x86 EFI stub that are already in mainline Linux. Further code is shared by the arm and arm64 stubs.

Using the EFI stub

To enable the EFI stub, the CONFIG_EFI option (Boot Options->UEFI runtime support) must be set. Kernels built with the EFI stub are still usable as a normal kernel Image, and don't add much code, so enabling this config is a reasonable default setting.

Common to 32- and 64-bit

The stub itself processes two options - the dtb= and initrd= options. These can be used to instruct the stub to load a device tree blob, and an initrd from a file system readable by UEFI.

dtb= should be considered a development feature. For production use of FDT with UEFI, see the ARM UEFI Boot Architecture documentation. Since this option could be considered a security hole, it is not available if UEFI Secure Boot mode is active.

initrd= can be used when booting directly from UEFI, or with a lightweight boot loader. If booting via GRUB, initrd options are passed through an FDT, not on the kernel command line.

32-bit kernels

Upstream kernel support for ARM UEFI is not yet available. Up-to-date patches can be found at
https://git.linaro.org/people/leif.lindholm/linux.git/shortlog/refs/heads/topic-leg-uefi
Also, developer releases of a kernel including these patches is created periodically from
https://git.linaro.org/leg/acpi/leg-kernel.git

zImage initrd=<full initrd path> dtb=<full dtb path> ... [normal kernel command line]

64-bit kernels

As of 3.16-rc1, UEFI support is available in upstream Linux.

Image initrd=<full initrd path> dtb=<full dtb path> ... [normal kernel command line]

Known limitations

  • The stub passes the UEFI command line provided to it as the kernel command line. Before linaro-edk2-2014.06 the ARM UEFI boot manager did not provide a way to specify command line arguments for UEFI applications. As a result, on older UEFI firmware the UEFI stub kernels are only bootable from the shell.

  • When using the dtb= option to load a device tree from a file system, this currently works only if the specified file resides on the same file system as the kernel image.

LEG/ServerArchitecture/UEFI/EFIstub (last modified 2017-08-17 12:12:47)