This is an old revision of the document!
OpenWrt on UEFI based x86 systems
Introduction
UEFI based systems are becoming more common and it's expected at some time that newer UEFI based system doesn't contain CSM to support legacy bios mode at all.
To accommodate this, it's necessary for OpenWrt build system to generate UEFI bootable images.
Status
There are pending commits related to add UEFI bootable OpenWrt under Jow staging repository.
Beware that the generated uefi gpt image causes kernel panic when booted on bios based system. A fix for this issue is in progress.
Building UEFI bootable OpenWrt image
The commits necessary to build uefi bootable OpenWrt image are as follows.
ba837608fb3676ceaf2f463e2efc013e5d232895 tools: add libopt host build 3775232366ab903a631379ab7916514286c96e2d tools: add sgdisk host build 8752bdcbda84361e91548b2314fbf3c6e3b4d233 Generate EFI grub images for x86 platforms b3bd0031cd8bc59c38b1c4cbb4454a415d464d15 grub: use different build directories per variant
To build the image, cherry pick those commits, i.e.
$ git remote add jow-staging https://git.openwrt.org/openwrt/staging/jow.git $ git fetch jow-staging $ git checkout -b uefi-capable --track origin/master # so that you can rebase easily $ for commit in \ ba837608fb3676ceaf2f463e2efc013e5d232895 \ 3775232366ab903a631379ab7916514286c96e2d \ 8752bdcbda84361e91548b2314fbf3c6e3b4d233 \ b3bd0031cd8bc59c38b1c4cbb4454a415d464d15 \ ; do \ git cherry-pick $commmit ; done
After cherry-picking those commits, run make menuconfig.
Go to Target Images and make sure that Build EFI grub images option is checked.
Select additional packages as necessary and finally save changes and exit menuconfig.
Run make as usual to build the image.
The resulting image will be available as bin/targets/x86/64/openwrt-x86-64-uefi-gpt-ext4.img.gz, which can be written to disk after decompression.
UEFI Secure Boot
To generate signed image for use with secure boot, there is a development repository with corresponding packages feed under feature-uefi-secure-boot branch.
The repository contains changes based on Jow-staging branch to generate secure boot capable image
The related packages feed repository contains stuffs needed to sign efi binaries, i.e. gnu-efi and sbsigntool and stuffs to manipulate efi variables, i.e. efivar, efibootmgr, and efitools.