The following
pxe-boot-prepare.sh script automates the manual steps to setup an OpenBSD box as
tftpd(8) server for PXE network installs.
These steps are outlined in the OpenBSD FAQ entry
6.10 - How do I boot using PXE? (i386, amd64)
The FAQ does not mention (yet) that besides an optional
/etc/boot.conf the latest incarnations of the OpenBSD installer also try to retrieve an
/etc/random.seed. This script generates such a file so the installer can use it.
Features:
- Check whether it is run with root privileges
- Makes sure that either 'amd64' or 'i386' architecture is been specified
- Uses /pxe as directory instead of the dyslexic nightmare /tftpdboot
- If no trace of tftpd in /etc/rc.conf.local is found, it creates an entry to enable it. You can use then
# /etc/rc.d/tftpd start
to start the Trivial File Transfer Protocol daemon.
- It assumes the same box also has a running web server, that serves the installation files from a local directory. This directory is used as source to copy the pxeboot and bsd.rd files into the PXE/TFTP directory.
Although not being used by the installer, the INSTALL.amd64 or INSTALL.i386 is also copied as reminder for which architecture the files are meant.
- Creates an /etc/random.seed in the PXE directory.
- Generates an /etc/boot.conf that enables a serial console.
- Creates a symbolic link auto_install to pxeboot so you can use autoinstall(8) for automatic installs.
- Shows how to check if tftpd is running
- The comment section gives some ideas what type of pf.conf(5) rules you need to pass tftpd traffic and how dhcpd can be configured,