PXE boot with UEFI

CSCI Technician tech at csci.viu.ca
Mon Dec 2 18:51:40 CET 2019


On 11/29/19 6:44 AM, Frank Morawietz wrote:
>
> In my despair I even called the vendor support. They told me that I needed a different pxelinux image for UEFI... Can this be true?
>
Short answer: yes.  As Steffen Grunewald points our in his dhcpd.conf 
snippet there is a different image file to used depending on what you 
are booting:
pxelinux.0 for legacy bios booting
syslinux32.efi for 32bit uefi booting
syslinux64.efi for 64bit uefi booting

Long answer:

One thing I found is that the syslinux files can be named the same for 
both 32 and 64 bit (syslinux.efi in my case).  In this case you can make 
separate subdirectories on your tftp server to handle each.  In my case 
I'm only concerned about bios and efi 64 bit booting so I have the 
following:

/tftp/fai/
- contains bios boot image pxelinux.0 and the associated ldlinux.c32 file
- contains initrd and vmlinuz files needed for booting fai client.
/tftp/fai/efi.x64/
- contains 64 bit uefi boot image syslinux.efi and the associated 
ldlinux.e64 file
- also contains symbolic links back to the initrd, vmlinuz files and the 
pxelinux.cfg directory in /tftp/fai/

My dhcpd.conf file looks similar to Steffen's but detecting the type of 
boot differently and using my directory hierarchy:

option arch code 93 = unsigned integer 16;
# In initial DHCP DISCOVER packet, PXE client sets option 93 to its 
architecture.
#    0000 == IA x86 PC (BIOS boot)
#    0006 == x86 EFI boot
#    0007 == x64 EFI boot
if option arch = 00:00 {
   filename "fai/pxelinux.0";
} elsif option arch = 00:07 {
   filename "fai/efi.x64/syslinux.efi";
} else {
   # For now use the default file if we don't know the architecture type
   filename "fai/pxelinux.0";
}

Note: Steffen also tests for arch type 00:09 which some vendors also 
return for 64 bit UEFI boot.  I found my Dell boxes return 00:07 as 
found in the spec so I don't test for 00:09.

If not clear from Steffen's post you get the uefi boot images from 
syslinux.  I installed the syslinux package on a test box and copied 
over the files I needed.

Steffen's idea of renaming the various syslinux.efi files to 
syslinux32.efi and syslinux64.efi is a good one as you can then have all 
the boot files in the same directory.  I may do this in the future.

Hope this helps.

Cheers,
Merlin.

-- 
Merlin Hansen
Department of Computing Science
Vancouver Island University
900 Fifth Street
Nanaimo BC  V9R 5S5
250-753-3245 x 2321
tech at csci.viu.ca



More information about the linux-fai mailing list