GRUB on ARM
Both ARM and ARM64 are now supported in upstream GRUB - both are available in the grub 2.02 betas, and included in several Linux distributions. The ARM port supports U-Boot (but should shortly support also UEFI), 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.
The only real requirements on the kernel are that:
- It is built as a simple zImage (arm) or Image (arm64) - none of that uImage wizardry!
- it is built with Flattened Device Tree (FDT) support (arm) and
- that it does not simply append that device tree to the kernel image.
Since, for the moment, the kernel source tree is also the repository for the device tree descriptor sources, .dtb files are generated in linux/arch/arm/boot/ for the platform(s) enabled in your configuration.
The normal use-case for GRUB is building it natively in the system where it is going to run, but GRUB also supports being cross-compiled in case you are building for a software model or suchlike. Either way, grab the source code from the upstream repository:
1 $ git clone git://git.savannah.gnu.org/grub.git
There are various build dependencies - for Debian/Ubuntu, do:
Then (since this is a source checkout, not a release version):
And then, to build natively:
1 $ ./configure --prefix=/usr/local && make && make install
Or to cross-compile:
1 $ ./configure --prefix=/usr/local --target=<target platform> && make && make install
Where <target platform> is aarch64-linux-gnu for arm64 or arm-linux-gnueabihf for arm.
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 2014-10-08 21:36:57)