Skip to content

Reset network interfaces at the end of the PXE boot to allow DHCP to run (FS#36749)

Francois Dupoux requested to merge fdupoux/archiso:fix-pxe-dhcp into master

This merge request fixes the following issue: https://bugs.archlinux.org/task/36749

After a PXE boot the system boots fine and has an IP address, but /etc/resolv.conf is not configured and it cannot resolve names.

The issue is that the interface is not properly de-configured during the boot process when BOOTIF=xxxx is not defined in the boot command line because of the condition in run_latehook:

if [[ -n "${bootif_dev}" ]]; then
    ip addr flush dev "${bootif_dev}"
    ip link set "${bootif_dev}" down
fi

If BOOTIF (and hence bootif_dev) is not defined it does not de-configure the network at the end of the PXE boot process. And this causes the DHCP client not to run in the final root file system at the end of the boot process. So the network interfaces still has its address but the /etc/resolv.conf file in the final root file system is not populated.

Adding SYSAPPEND 3 makes the problem disappear because it makes pxelinux set BOOTIF (and ip=xxx) automatically. The value is important as 3=1+2 and flag 2 is the one which sets BOOTIF (flag 1 sets ip=xxx)

Cf https://gitlab.com/systemrescue/systemrescue-sources/-/issues/19 for more details about this issue.

Edited by Francois Dupoux

Merge request reports