2

Is it possible to configure TFTP statically, without using DHCP? I am not allowed to run DHCP server in the network where my Pis will be sitting, because it may interfere with other users activity. Maybe there is an option similar to the RPi4's TFTP_IP parameter?

I don't mind having some code on the SD card, just the bootable image must be externalized.

rapucha
  • 131
  • 3

1 Answers1

3

According to the Pi 4 Bootloader Configuration documentation you can patch the boot ROM to preset various configuration values, and one of them is the TFTP server address using TFTP_IP (since EEPROM version 2020-04-16).

You can also configure a static IP address to avoid relying on DHCP just to reach the TFTP server.

If TFTP_IP and the following options are set then DHCP is skipped and the static IP configuration is applied.

The static IP options are CLIENT_IP, SUBNET (optional), GATEWAY (optional).

You'll need to follow the instructions at that link as they are a bit long to repost here, but the gist of it is:

cp /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2019-09-23.bin pieeprom.bin
rpi-eeprom-config pieeprom.bin > bootconf.txt
# Edit bootconf.txt and set TFTP_IP=1.2.3.4
rpi-eeprom-config --out pieeprom-netboot.bin --config bootconf.txt pieeprom.bin
sudo rpi-eeprom-update -d -f ./pieeprom-netboot.bin   # Flash updated boot ROM

Basically you extract the boot ROM config into a text file, edit it, then merge it back to the ROM file and reflash it.

Joel Purra
  • 109
  • 4
Malvineous
  • 2,109
  • 15
  • 25