Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created September 20, 2023 14:57
Show Gist options
  • Save noslin005/dfafdcf3701b34bd69fa1165a02b4ae2 to your computer and use it in GitHub Desktop.
Save noslin005/dfafdcf3701b34bd69fa1165a02b4ae2 to your computer and use it in GitHub Desktop.
iPXE bootstrap script based on client platform (efi, pcbios) and architecture (arm64, x86_64, i386).
#!ipxe
# Global variables used by other iPXE scripts
chain --autofree vars.ipxe ||
# First try to load a specifix boot script based on the client MAC address
# Boot <boot-url>/<boot-path>/mac-010203040506.ipxe if script is present
chain --replace --autofree ${ipxe_boot_path}mac-${mac:hexraw}.ipxe ||
# Loads ipxe boot script based client platform and architecture
iseq ${buildarch} arm64 && goto arm64 ||
iseq ${buildarch} x86_64 && iseq ${platform} efi && goto x86_64_efi ||
iseq ${buildarch} i386 && iseq ${platform} pcbios && goto i386_pcbios ||
goto shell
:arm64
set arch arm64 ||
chain --replace --autofree arm64-menu.ipxe
:x86_64_efi
set arch x86_64 ||
chain --replace --autofree x86_64-menu.ipxe
:i386_pcbios
set arch i386 ||
chain --replace --autofree pcbios-menu.ipxe
:shell
shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment