[Cassini 22.12] archiso_pxe_common hook fails to configure network

This happens on a baremetal system and in a VM.

No issues with the Artemis 22.6 and previous ISOs. Code block that I have been using with my iPXE setup without issue until 22.12.

: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

it was adapted from the archiso_pxe-linux.cfg included in the ISO

LABEL eos64_http
TEXT HELP
Boot the EndeavourOS live medium using HTTP.
It allows you to install EndeavourOS or perform system maintenance.
ENDTEXT
MENU LABEL EndeavourOS install medium (x86_64, HTTP)
LINUX /arch/boot/x86_64/vmlinuz-linux
INITRD /arch/boot/intel-ucode.img,/arch/boot/amd-ucode.img,/arch/boot/x86_64/initramfs-linux.img
APPEND archisobasedir=arch archiso_http_srv=http://${pxeserver}/ checksum verify
SYSAPPEND 3

the first time i see someone using pxe at all here :vulcan_salute:
So welcome to the forum and let’s see what we can do :enos:

Last time I try PXE is years ago and I have to confess we do not do much to check if it is still working as no one in the team is using it.

To start helping I will need to get some hints on how to try this out again.

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

Isn’t network boot disabled? Is OP on systemd?

Edit: I just recall @dalto talking about this in another thread? :thinking:

@ricklinux I have this setup for performing new installs. does systemd boot even come into play?

I’m not sure i just recall some talk about network boot? Not being enabled possibly? Don’t take my word for it. It’s just a thought at the moment. I don’t have the answer.

Edit: Not many users would need this capability.

Are you talking about the discussion we were having around dracut @ricklinux? If we are talking about the ISO, that wouldn’t apply here since the ISO is still using mkinitcpio.

1 Like

Oh okay that’s why i wasn’t sure.

Edit: Also not sure what the OP means with this setup?

I have a collection of ISOs setup for network booting in the dev environment of my homelab or for installing on baremetal machines.

I use vmware but i don’t know how you set all this up. Never tried and not sure exactly what you are doing? Sorta of have an idea.

issue happens with any hypervisor and baremetal, I happen to use esxi.

what I am attempting to do is network boot the ISO on a machine with no OS installed.

I did some research for you here. It looks like the issue is that we removed mkinitcpio-nfs-utils from the ISO. Even though that is an optional dependency for mkinitcpio-archiso that relates to NFS, it seems like it contains the ipconfig script used in the pxe-common hook.

I think the only way for you to fix that is to build your own ISO.

this looks pretty straight forward…

I’ll take a run at adding mkinitcpio-nfs-utils to a custom ISO.

Thanks for pointing me in the right direction!

1 Like

Hmm so i was right in a round about way. :grin:

was as simple as adding mkinitcpio-nfs-utils to packages.x86_64 and following the instructions for building the ISO.

Thanks again all!

3 Likes

thats great … i need still to try it here :wink:

$ pacman -Qo ifconfig /usr/bin/ifconfig is owned by net-tools 2.10-2

Sorry, wrong app.