From 7697a170bd0155bc473fb99e447430fce205d2c8 Mon Sep 17 00:00:00 2001 From: Sylvain Tremblay Date: Sun, 2 Mar 2025 09:37:11 -0500 Subject: [PATCH] feat(ipxe): setup to have MAC specific bootfiles and fallback to a default if not found --- data/watchguard/pxe-http-files/boot.ipxe | 60 ++------------------- data/watchguard/pxe-http-files/default.ipxe | 60 +++++++++++++++++++++ data/watchguard/pxe-http-files/paul | 1 - 3 files changed, 63 insertions(+), 58 deletions(-) create mode 100644 data/watchguard/pxe-http-files/default.ipxe delete mode 100644 data/watchguard/pxe-http-files/paul diff --git a/data/watchguard/pxe-http-files/boot.ipxe b/data/watchguard/pxe-http-files/boot.ipxe index f4412fb..5b00e50 100644 --- a/data/watchguard/pxe-http-files/boot.ipxe +++ b/data/watchguard/pxe-http-files/boot.ipxe @@ -1,60 +1,6 @@ #!ipxe -menu PXE Boot Menu -item local Boot from Hard Disk -item ubuntu-server Ubuntu 24.04.1 live server -item ubuntu-desktop Ubuntu 24.04.1 desktop -item systemrescue System Rescue 11.03 -item memtest memtest -#choose --default local --timeout 5000 selected -choose selected -goto ${selected} +set base-url http://192.168.33.1:8080 +set hostfile ${base-url}/byMAC/01-${mac:hexhyp}.ipxe -:local -exit - -################################# -# Ubuntu Server -################################# -:ubuntu-server -set server_ip 192.168.33.1:8080 -set base_url http://${server_ip}/ubuntu/live-server-24.04.1 - -kernel ${base_url}/vmlinuz ip=dhcp url=${base_url}/ubuntu-24.04.1-live-server-amd64.iso autoinstall ds=nocloud -initrd ${base_url}/initrd -boot - -################################# -# Ubuntu Desktop -################################# -:ubuntu-desktop -set server_ip 192.168.33.1:8080 -set base_url http://${server_ip}/ubuntu/desktop-24.04.1 - -kernel ${base_url}/vmlinuz ip=dhcp url=${base_url}/ubuntu-24.04.1-desktop-amd64.iso autoinstall ds=nocloud -initrd ${base_url}/initrd -boot - -################################# -# System Rescue -################################# -:systemrescue -set base-url http://192.168.33.1:8080/systemrescue - -kernel ${base-url}/vmlinuz initrd=sysresccd.img boot=systemrescue docache -initrd ${base-url}/sysresccd.img -boot - -################################# -# MemTest86 (BIOS/UEFI) -################################# -:memtest -iseq ${platform} efi && goto memtest_efi || goto memtest_bios - -:memtest_efi -kernel http://192.168.33.1:8080/memtest/memtest64.efi -boot - -:memtest_bios -kernel http://192.168.33.1:8080/memtest/memtest64.bin -boot +chain ${hostfile} || chain ${base-url}/default.ipxe diff --git a/data/watchguard/pxe-http-files/default.ipxe b/data/watchguard/pxe-http-files/default.ipxe new file mode 100644 index 0000000..b9babe5 --- /dev/null +++ b/data/watchguard/pxe-http-files/default.ipxe @@ -0,0 +1,60 @@ +#!ipxe +menu PXE Boot Menu - [${mac}] +item local Boot from Hard Disk +#item ubuntu-server Ubuntu 24.04.1 live server +#item ubuntu-desktop Ubuntu 24.04.1 desktop +#item systemrescue System Rescue 11.03 +item memtest memtest +#choose --default local --timeout 5000 selected +choose selected + +goto ${selected} + +:local +exit + +################################# +# Ubuntu Server +################################# +:ubuntu-server +set server_ip 192.168.33.1:8080 +set base_url http://${server_ip}/ubuntu/live-server-24.04.1 + +kernel ${base_url}/vmlinuz ip=dhcp url=${base_url}/ubuntu-24.04.1-live-server-amd64.iso autoinstall ds=nocloud +initrd ${base_url}/initrd +boot + +################################# +# Ubuntu Desktop +################################# +:ubuntu-desktop +set server_ip 192.168.33.1:8080 +set base_url http://${server_ip}/ubuntu/desktop-24.04.1 + +kernel ${base_url}/vmlinuz ip=dhcp url=${base_url}/ubuntu-24.04.1-desktop-amd64.iso autoinstall ds=nocloud +initrd ${base_url}/initrd +boot + +################################# +# System Rescue +################################# +:systemrescue +set base-url http://192.168.33.1:8080/systemrescue + +kernel ${base-url}/vmlinuz initrd=sysresccd.img boot=systemrescue docache +initrd ${base-url}/sysresccd.img +boot + +################################# +# MemTest86 (BIOS/UEFI) +################################# +:memtest +iseq ${platform} efi && goto memtest_efi || goto memtest_bios + +:memtest_efi +kernel http://192.168.33.1:8080/memtest/memtest64.efi +boot + +:memtest_bios +kernel http://192.168.33.1:8080/memtest/memtest64.bin +boot diff --git a/data/watchguard/pxe-http-files/paul b/data/watchguard/pxe-http-files/paul deleted file mode 100644 index 00cd64a..0000000 --- a/data/watchguard/pxe-http-files/paul +++ /dev/null @@ -1 +0,0 @@ -hey i am paul