NetBoot the Raspberry Pi 4
Setup Netboot
The Raspberry Pi "Should" be able to boot from network right out of the box.... Should is an over used word in tech. In my experience "Should" does not work in this case.
The following is how I have gotten the Raspberry Pi 4 to boot from network. I also have the Raspberry Pi 3 net booting if you would like that on a similar page drop me a comment on the contact page.
Disclaimer my network equipment is Ubiquity, my tftp and NFS servers are a Synology. I already had a dhcp and nfs servers, I did not feel the need to setup another one just for netbooting Pi's.
RASPBERRY PI 4
We start with the lite version flashed to a SD card and the usual update:
sudo apt update && sudo apt upgrade
Then download the latest eeprom:
# at the time of writing this was it
wget https://github.com/raspberrypi/rpi-eeprom/raw/master/firmware/beta/pieeprom-2019-10-16.bin
Build a new boot config.txt
You will need to change the boot order and the tftp server
rpi-eeprom-config pieeprom-2019-10-16.bin > bootconf.txt
sed -i s/0x1/0x21/g bootconf.txt
Example bootconfig.txt
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=30000
TFTP_IP=<my tftp server ip address ie. 10.200.0.10>
BOOT_ORDER=0x21
SD_BOOT_MAX_RETRIES=3
NET_BOOT_MAX_RETRIES=5
[none]
FREEZE_VERSION=0
Create a new eeprom image
rpi-eeprom-config --out pieeprom-2019-10-16-netboot.bin --config bootconf.txt pieeprom-2019-10-16.bin
Upload the eeprom image
sudo rpi-eeprom-update -d -f ./pieeprom-2019-10-16-netboot.bin
Get Serial number (this is needed for the tftp server)
cat /proc/cpuinfo |grep Serial (last 8 characters is needed for tftp boot folder)
Restart the Pi to make sure everything takes
sudo reboot
Your pi should be ready to boot from network now.
sudo shutdown -h
Login to your TFTP server and verify you are getting the TFTP requests
#as root
tcpdump port 69
References
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md