OpenWrt Forum Archive

Topic: UEFI PXE Boot

The content of this topic has been archived on 6 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

So, I followed the wiki (https://wiki.openwrt.org/doc/howto/tftp.pxe-server) and now have a working PXE-Server for bios, using Ubuntu Gnome.

But, I also need compatibility with UEFI PC's. There's no info on the wiki and information on the web doesn't seem to really apply to OpenWRT, so, what files and what do I need to do for UEFI PXE-boot?

Thanks in advance!

Bumping this one. It's the only thing I still haven't managed to do in OpenWRT.

https://wiki.kubuntu.org/UEFI/SecureBoo … dnsmasq.29

dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-boot=tag:efi-x86_64,bootx64.efi

You need to get these lines to dnsmasq config and put bootx64.efi and other required files to tftproot. (I try to look to it and test in next few days.)

Add to /etc/dnsmasq.conf:

dhcp-match=set:bios,option:client-arch,0
dhcp-match=set:efi32,option:client-arch,6
dhcp-match=set:efi64,option:client-arch,7
dhcp-boot=tag:bios,lpxelinux.0
dhcp-boot=tag:efi32,syslinux32.efi
dhcp-boot=tag:efi64,syslinux64.efi

Or with external TFTP server:

dhcp-boot=tag:bios,lpxelinux.0,external-tftp-server.lan,10.10.10.10
dhcp-boot=tag:efi32,syslinux32.efi,external-tftp-server.lan,10.10.10.10
dhcp-boot=tag:efi64,syslinux64.efi,external-tftp-server.lan,10.10.10.10

https://www.kernel.org/pub/linux/utils/ … .03.tar.gz

These files for BIOS PXE boot with boot menu:
bios/com32/elflink/ldlinux/ldlinux.c32
bios/com32/lib/libcom32.c32
bios/com32/libutil/libutil.c32
bios/com32/menu/menu.c32
bios/com32/menu/vesamenu.c32
bios/core/lpxelinux.0
bios/memdisk/memdisk

UEFI PXE IA32 files:
efi32/com32/elflink/ldlinux/ldlinux.e32
efi32/efi/syslinux.efi

UEFI PXE x64 files:
efi64/com32/elflink/ldlinux/ldlinux.e64
efi64/efi/syslinux.efi

Boot menu config file in TFTP root:
pxelinux.cfg/default

UI vesamenu.c32
TIMEOUT 80
TOTALTIMEOUT 9000

MENU WIDTH 64
MENU MARGIN 2
MENU ROWS 15
MENU TITLE PXE Boot MENU
#MENU BACKGROUND background.png
MENU AUTOBOOT Starting Local System in # seconds
MENU COLOR border 0 #ffffffff #ee000000 std
MENU COLOR title 0 #ffffffff #ee000000 std
MENU COLOR sel 5 #f0f0f00f #8500f000 std
MENU COLOR unsel 0 #ffffffff #ee000000 std
MENU COLOR pwdheader 0 #ff000000 #99ffffff rev
MENU COLOR pwdborder 0 #ff000000 #99ffffff rev
MENU COLOR pwdentry 0 #ff000000 #99ffffff rev
MENU COLOR hotkey 0 #ff00ff00 #ee000000 std
MENU COLOR hotsel 0 #f0f0f00f #85000000 std

LABEL local
MENU DEFAULT
MENU LABEL ^Boot from Local Hard Disk
LOCALBOOT 0

LABEL installdebian
MENU LABEL ^Install Debian amd64
KERNEL http://d-i.debian.org/daily-images/amd64/daily/netboot/debian-installer/amd64/linux
APPEND vga=788 url=http://10.10.10.10/debian-preseed.cfg locale=en_US keymap=fi hostname=debian domain=lan --
INITRD http://d-i.debian.org/daily-images/amd64/daily/netboot/debian-installer/amd64/initrd.gz

LABEL ubuntu
MENU LABEL Boot ^Ubuntu Server from NFS
KERNEL http://10.10.10.10/boot/ubuntu/vmlinuz
APPEND root=/dev/nfs nfsroot=10.10.10.10:/volume3/nfsroot/ubuntu ip=dhcp rw --
INITRD http://10.10.10.10/boot/ubuntu/initrd.img 

LABEL systemrescuecd
MENU LABEL ^SystemRescueCd
KERNEL http://10.10.10.10/boot/systemrescue/rescue32
APPEND setkmap=fi rootpass=notsecure netboot=http://10.10.10.10/boot/systemrescue/sysrcd.dat ethx=10.10.10.99/24 dns=10.10.10.10 gateway=10.10.10.10
INITRD http://10.10.10.10/boot/systemrescue/initram.igz

LABEL dos
MENU LABEL Free^DOS
KERNEL memdisk
APPEND initrd=bootdisks/freedos.img # from default TFTP server

Couldn't test EFI boot successfully yet, but at least it loads syslinux64.efi file with Parallers virtual EFI boot.

Thanks a lot! It's working, just not with syslinux64. Had no ideia I should use dnsmasq.conf!

Syslinux64.efi isn't working. It loads fine, but I get stuck on a "Getting cached packets" screen, so I used grubx64.efi instead, from http://archive.ubuntu.com/ubuntu/dists/ … efi.signed. My motherboard is newer than the no longer maintained syslinux package, so I guess it's a bug.

To work with grub, you also need to create a /grub/grub.cfg file. Here's an example:

menuentry "GNOME > x64" {
linux /ubuntu-gnome64-live/casper/vmlinuz.efi netboot=nfs nfsroot=192.168.2.1:/mnt/sdb1/PXEboot/ubuntu-gnome64-live boot=casper quiet splash --
initrd /ubuntu-gnome64-live/casper/initrd.lz 
}

And the dnsmasq.confg is also working on bios, you just had a little typo on (l)pxelinux.0. I have no "Legacy UEFI" syslinux32 machines, so no ideia if that's working. Config is:

dhcp-match=set:bios,option:client-arch,0
dhcp-match=set:efi32,option:client-arch,6
dhcp-match=set:efi64,option:client-arch,7
dhcp-boot=tag:bios,pxelinux.0
dhcp-boot=tag:efi32,syslinux32.efi
dhcp-boot=tag:efi64,grubnetx64.efi.signed

Thanks a lot! Guess you should add it to the wiki wink

(Last edited by Seketh on 14 May 2016, 20:46)

If i remember correctly bios/core/lpxelinux.0 Lpxelinux.0 can load stuff over http, plain pxelinux.0 can not. If all needed is on TFTP server it doesn't matter, but http might be faster on big files.

Grub should be able to load kernel and initrd over http also when right modules are loaded.

(Last edited by PJK on 15 May 2016, 10:05)

The discussion might have continued from here.