The lack of UEFI/EFI boot support has bothered me for a while, New Intel SOC with AES support are common cheap and low in power usage.
Well here is my work around:
refind is a EFI bootloader that can even boot legacy (http://www.rodsbooks.com/refind/)
You need two USB-sticks for this how to (easiest way)
One for OpenWRT and one for temporary store of rEFInd
A running linux desktop env as Ubuntu or Debian.
the steps:
1, Download and DD OpenWRT to a USB-stick (https://downloads.openwrt.org/releases/19.07.1/targets/x86/64/openwrt-19.07.1-x86-64-combined-ext4.img.gz) to your target OpenWRT USB-stick.
2, Expand the second ext4 filesystem (root) with GParted and leave more than 16MB left on the volyme (we need that later for rEFInd bootloader).
3, Download DD the refind usb image to the temporary USB-Stick
4, Use fdisk to check the size in sectors of the refind image partition (fdisk ./refind-flashdrive-0.11.4.img)
Device Start End Sectors Size Type
refind-flashdrive-0.11.4.img 1 2048 14430 12383 6M EFI System
The magic sector size is "12383" write it down!
5, "sudo fdisk /dev/sdX" and create a new partition (3) enter as default for all except the size. Type that magic number we typed down earlier but reduce it with one sector "12382". this creates a partition with the same size as the one in the image
6, Use "Disks" to mark and create a partition backup from the temporary USB-stick. Then mark the new created partition on the OpenWRT USB-stick and Restore the just created partition backup to that partition.
7, Now all partitions is done. But we need to configure booth rEFInd and kernel options to boot nice.
Start with rEFInd, mount the partition "/dev/sdX3" edit ./EFI/boot/refind.conf.
Change "timout" to "5" at line 13 (faster booting)
Change "showtools" to only "shutdown,reboot" at line 261
Change "scanfor" to only "external" (faster boot and refind only scans for OpenWRT as it will add other bootable kernels automatic)
Save refind.conf
8, Mount OpenWRT boot partition "/dev/sdX1" as root
create a file named refind_linux.conf in ./boot/ Edit the file and add
"Boot using default options" "root=PARTUUID=d7349897-03 rootfstype=ext4 rootwait console=tty0 console=ttyS0,115200n8 noinitrd"
Save
9, unmount the OpenWRT USB-stick and put in your UEFI boot only firewall, set up "BIOS" common for boot from USB and boot
// Agge