Setup router to redirect TFTP to main server
$ cat /jffs/configs/dnsmasq.conf.add
dhcp-boot=pxelinux,[IP Address],[IP Address]
This should be the following, but it doesn't work right with the Pi
$ cat /jffs/configs/dnsmasq.conf.add
dhcp-boot=pxelinux,[Hostname],[IP Address]
$ cat tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
$ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
/srv/nfs/raspi3 *(rw,sync,no_subtree_check,no_root_squash)
Download from http://downloads.raspberrypi.org/
unxz 2024-07-04-raspios-bookworm-armhf.img.xz
sudo kpartx -a -v 2024-07-04-raspios-bookworm-armhf.img
mkdir rootmnt
mkdir bootmnt
sudo mount /dev/mapper/loop0p2 rootmnt/
sudo mount /dev/mapper/loop0p1 bootmnt/
sudo mkdir -p /srv/nfs/raspi3
sudo cp -a rootmnt/* /srv/nfs/raspi3/
sudo cp -a bootmnt/* /srv/nfs/raspi3/boot/firmware/
sudo umount bootmnt rootmnt
sudo kpartx -d `pwd`/2024-07-04-raspios-bookworm-armhf.img
sudo sed -i /UUID/d /srv/nfs/raspi3/etc/fstab
echo "console=serial0,115200 console=tty root=/dev/nfs nfsroot=[IP Address]:/srv/nfs/raspi3,vers=3 rw ip=dhcp rootwait elevator=deadline modprobe.blacklist=bcm2835_v4l2" | sudo tee /srv/nfs/raspi3/boot/firmware/cmdline.txt
Used to be last 4 bytes of MAC (45:67:89:ab:cd:ef -> 89abcdef), may have to boot from SD card and extract with vcgencmd
sudo mkdir -p /srv/tftp/89abcdef
Also required after update that installs new kernel. Maybe 'rsync -av --delete'?
sudo cp /srv/nfs/raspi3/boot/firmware/bootcode.bin /srv/tftp/
sudo cp /srv/nfs/raspi3/boot/firmware/* /srv/tftp/89abcdef/
It takes approximately 30 seconds before the bootp protocol begins and an additional 15 seconds for the splash screen to appear.
Based on https://ian.bebbs.co.uk/posts/NetworkBootingManyRaspberryPis