Skip to content

Instantly share code, notes, and snippets.

@HikariKnight
Last active March 6, 2022 14:01
Show Gist options
  • Save HikariKnight/c2ffeef1d656dfbaf8dc610a55aa6143 to your computer and use it in GitHub Desktop.
Save HikariKnight/c2ffeef1d656dfbaf8dc610a55aa6143 to your computer and use it in GitHub Desktop.
pxeboot.mas file to include in /usr/share/zentyal/stubs/dhcp/subnet.mas for when you use fog server for pxe booting
<%doc>
This template generates a better tftp filenames based on architecture
for PXE booting.
Place this file in /usr/share/zentyal/stubs/dhcp
Include it by adding
<& pxeboot.mas, options => \%options &>
into the "if ($options{filename}) {" section of subnet.mas and comment out the
filename "<% $options{filename} %>"; line
</%doc>
<%args>
%options
</%args>
% if ($options{filename}) {
# Detect if UEFI/BIOS and use the right boot image
class "pxeclient" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if substring (option vendor-class-identifier, 15, 5) = "00000" {
# BIOS client
filename "undionly.kpxe";
}
elsif substring (option vendor-class-identifier, 15, 5) = "00002" {
# EFI client 32 bit Type1
filename "i386-efi/<% $options{filename} %>";
}
elsif substring (option vendor-class-identifier, 15, 5) = "00006" {
# EFI client 32 bit Type2
filename "i386-efi/<% $options{filename} %>";
}
elsif substring (option vendor-class-identifier, 15, 5) = "00007" {
# EFI client 64 bit Type1
filename "<% $options{filename} %>";
}
elsif substring (option vendor-class-identifier, 15, 5) = "00008" {
# EFI client 64 bit Type2
filename "<% $options{filename} %>";
}
elsif substring (option vendor-class-identifier, 15, 5) = "00009" {
# EFI client 64 bit Type3
filename "<% $options{filename} %>";
}
else {
# default to EFI 64 bit
filename "<% $options{filename} %>";
}
}
% }
@HikariKnight
Copy link
Author

my changes are in order to make both bios pxe and efi pxe working not just one of the 2 as pointed out in my last message there are 3 different files used

bios pxe, 64bit ipxe, 32bit ipxe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment