Install FreeBSD13 via UEFI PXE

The FreeBSD handbook (Chapter 34.10. Diskless Operation with PXE) on installing FreeBSD via PXE is a good and efficient resource. For my work on the iwlwifi project, I need to install FreeBSD 13.2 via PXE on some of the Beelink SER5 AMD Mini PCs, which have a Realtek PCIe GB Ethernet port and can do UEFI PXE boot in default. Here are some problems that I encountered during the installation and the solutions that I found.

problems shown in /var/log/xferlog

* tftpd: Got ERROR packet: User aborted the transfer: the default boot/pxeboot file from the base system is used for the legacy PXE, not used for UEFI PXE. So my mini PC can’t be PXE booted by this file. The solution is to replace the boot/pxeboot file with the boot/loader.efi file. Like this:

# chroot ${NFSROOTDIR}
# mv boot/pxeboot boot/pxeboot.orig
# cp boot/loader.efi boot/pxeboot

* tftpd: Got ERROR packet: User provided memory block is too small: the default tftp blocksize 512 is too small, change the tftp setup in /etc/inetd.conf to use a larger block size:

tftp    dgram   udp     wait    root    /usr/libexec/tftpd      tftpd blocksize 1468 -l -s /b/tftpboot

Problems shown in the target node console

* /etc/rc.initdiskless: /rescue/tar: not found: I didn’t found this file in the base system extracted from the official archives such as FreeBSD-13.2-RELEASE-amd64-bootonly.iso or FreeBSD-13.2-RELEASE-amd64-disc1.iso. Instead, I edited the etc/rc.initdiskless file where the tar is:

        if [ -f $j ]; then
            create_md $subdir
            echo "Loading /$subdir from cpio archive $j"
-           (cd / ; /rescue/tar -xpf $j)
+           (cd / ; /usr/bin/tar -xpf $j)
        fi

update on Dec 15, 2023

The above found problems have been fixed in FreeBSD/doc commit ba54c352daba and in stable/14 commit 404b91dac415

chengcui/Install FreeBSD13 via UEFI PXE (last edited 2024-02-22T14:55:03+0000 by chengcui)