Both ARM and ARM64 are supported in upstream GRUB - both are available in the grub 2.02 betas, in addition to the release. It is now included in most Linux distributions. The ARM port supports U-Boot and UEFI (but see warning below), and the ARM64 port supports UEFI.

On all of these, GRUB supports an additional command compared to other ports; devicetree <file> is used to load a .dtb file from a local filesystem. On UEFI platforms, this command should never be needed (since UEFI will present a DT to GRUB on non-ACPI systems), but can be useful for development.

Kernel requirements

The kernel requirements are that:

  • It is built as a simple zImage (arm) or Image (arm64) - none of that uImage wizardry!
  • For arm64, that it is built with "EFI Stub Loader", turning the kernel into a valid UEFI application.
  • it is built with Flattened Device Tree (FDT) support

Up to and including the 2.02 release, the 32-bit UEFI Linux loader is in fact the same as the u-boot one (which is not ideal). This patchset changes this behaviour to instead reuse the same UEFI loader as the arm64 port, depending again on EFI Stub being enabled in the kernel (supported from Linux 4.4 onwards).

Building GRUB

Build it as you would for any architecture, but note that u-boot is the default platform for arm. In order to build the 32-bit UEFI variant, add --with-platform=efi to the configure command line.

If cross-compiling, add a --target option:

   1 $ ./configure --prefix=/usr/local --target=<target platform>

Where <target platform> is aarch64-linux-gnu for arm64 or arm-linux-gnueabihf for arm.

Running GRUB

make install installs the GRUB tools, object files and modules, but to actually run it on your platform, you need to generate a grub image using those tools.

For a native installation, $ sudo grub-install should be sufficient.

For cross compilation, the simplest option might be to create a standalone GRUB image by running

   1 $ grub-mkstandalone -o grub.img -O <target platform>

where <target platform> can be arm-uboot, arm-efi or arm64-efi.

LEG/Engineering/Kernel/GRUB (last modified 2017-06-23 15:51:44)