[Cassini 22.12] archiso_pxe_common hook fails to configure network

this config assumes that the PXE server and DHCP server are the same. as long as the PXE client is in the same subnet/vlan as the DHCP/PXE server (also without anything else serving DHCP) then it will “just work”. let me know if I missed any details or if you need clarification on anything. also apologies for it being a wall of text.

nginx config

$ cat /etc/nginx/sites-enabled/default

server {
  listen *:8055;
  server_name ipxe.local.lan;

  root /distros;
  autoindex on;
}

server {
  listen *:8000;
  server_name ipxe.local.lan;

  root /tftpboot;
  autoindex on;
}

ISO files

$ ls -la /distros/eos226/
total 1032
drwxr-xr-x  6 root root    4096 Feb  9 02:31 .
drwxr-xr-x 12 root root    4096 Feb  9 02:30 ..
dr-xr-xr-x  4 root root    4096 Feb  9 02:31 arch
dr-xr-xr-x  3 root root    4096 Feb  9 02:31 EFI
dr-xr-xr-x  3 root root    4096 Feb  9 02:31 loader
-r--r--r--  1 root root 1031872 Feb  9 02:31 shellx64.efi
dr-xr-xr-x  3 root root    4096 Feb  9 02:31 syslinux

isc-dhcp-server config

$ cat /etc/dhcp/dhcpd.conf

option domain-name "local.lan";
option domain-name-servers 192.168.168.1;

default-lease-time 7200;
max-lease-time 7200;

next-server 192.168.168.55;
if exists user-class and option user-class = "iPXE" {
filename "http://192.168.168.55:8000/menu.ipxe";
} else {filename "ipxe.efi";}

subnet 192.168.168.0 netmask 255.255.255.0 {
  range 192.168.168.100 192.168.168.120;
  option subnet-mask 255.255.255.0;
  option routers 192.168.168.1;
  option broadcast-address 192.168.168.255;
  default-lease-time 7200;
  max-lease-time 7200;
}

tftp config

$ cat /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"

ipxe boot file

https://boot.ipxe.org/ipxe.pxe

tftpboot files

$ ls /tftpboot/
ipxe.efi  menu.ipxe

ipxe menu

$ cat /tftpboot/menu.ipxe
#!ipxe

:start
menu iPXE Boot Menu
item

item eos226     Endeavour OS 22.6
item eos2212    Endeavour OS 22.12
item
item shell              iPXE shell
item reboot             Reboot
item exit               Exit
item
choose --default eos226 --timeout 0 target && goto ${target}

:eos226
set server_path eos226
set http ${next-server}:8055
set dist-root http://${http}/${server_path}
kernel ${dist-root}/arch/boot/x86_64/vmlinuz-linux
initrd ${dist-root}/arch/boot/intel-ucode.img
initrd ${dist-root}/arch/boot/amd-ucode.img
initrd ${dist-root}/arch/boot/x86_64/initramfs-linux.img
imgargs vmlinuz-linux initrd=intel-ucode.img initrd=amd-ucode.img initrd=initramfs-linux.img archisobasedir=arch archiso_http_srv=${dist-root}/ ip=dhcp nvme_load=yes
boot

:eos2212
set server_path eos2212
set http ${next-server}:8055
set dist-root http://${http}/${server_path}
kernel ${dist-root}/arch/boot/x86_64/vmlinuz-linux
initrd ${dist-root}/arch/boot/intel-ucode.img
initrd ${dist-root}/arch/boot/amd-ucode.img
initrd ${dist-root}/arch/boot/x86_64/initramfs-linux.img
imgargs vmlinuz-linux initrd=intel-ucode.img initrd=amd-ucode.img initrd=initramfs-linux.img archisobasedir=arch archiso_http_srv=${dist-root}/ ip=dhcp nvme_load=yes
boot

## Utility menu items:
:shell
echo Type exit to get the back to the menu
shell
set menu-timeout 0
goto start

:failed
echo Booting failed, dropping to shell
goto shell

:reboot
reboot

:exit
exit