NOBODD-TFTPD(1) | nobodd | NOBODD-TFTPD(1) |
nobodd-tftpd - nobodd-tftpd - serve boot partition files over TFTP
A read-only TFTP server capable of reading FAT boot partitions from within image files or devices. Intended to be paired with a block-device service (e.g. NBD) for netbooting Raspberry Pis.
usage: nobodd-tftpd [-h] [--version] [--listen ADDR] [--port PORT] [--board SERIAL,FILENAME[,PART[,IP]]]
nobodd-tftpd can be configured via the command line, or from several configuration files. These are structured as INI-style files with bracketed [sections] containing key=value lines, and optionally #-prefixed comments. The configuration files which are read, and the order they are consulted is as follows:
Later files override settings from files earlier in this order.
The configuration file may contain a [tftp] section which may contain the following values:
For example:
[tftp] listen = 192.168.0.0/16 port = tftp includedir = /etc/nobodd/conf.d
For each image the TFTP server is expected to serve to a Raspberry Pi, a [board:SERIAL] section should be defined. Here, "SERIAL" should be replaced by the serial number of the Raspberry Pi. The serial number can be found in the output of cat /proc/cpuinfo at runtime. For example:
$ grep ^Serial /proc/cpuinfo Serial : 100000001234abcd
If the serial number starts with 10000000 (as in the example above), exclude the initial one and all leading zeros. So the above Pi has a serial number of 1234abcd (in hexadecimal). Within the section the following values are valid:
For example:
[board:1234abcd] image = /srv/images/ubuntu-24.04-server.img partition = 1 ip = 192.168.0.5
In practice, what this means is that requests from a client with the IP address "192.168.0.5", for files under the path "1234abcd/", will be served from the FAT file-system on partition 1 of the image stored at /srv/images/ubuntu-24.04-server.img.
Such definitions can be produced by nobodd-prep when it is provided with the nobodd-prep --serial option.
Boards may also be defined on the command-line with the --board option. These definitions will augment (and override, where the serial number is identical) those definitions provided by the configuration files.
The server may inherit its listening socket from a managing process. In the case of inetd(8) where the listening socket is traditionally passed as stdin (fd 0), pass "stdin" as the value of --listen (or the listen option within the [tftp] section of the configuration file).
In the case of systemd(1), where the listening socket(s) are passed via the environment, specify "systemd" as the value of --listen (or the listen option within the [tftp] section of the configuration file) and the service will expect to find a single socket passed in LISTEN_FDS. This will happen implicitly if the service is declared as socket-activated. However, the service must not use Accept=yes as the TFTP protocol is connection-less. The example units provided in the source code demonstrate using socket-activation with the server.
In both cases, the service manager sets the port that the service will listen on, so the --port option (and the port option in the [tftp] section of the configuration file) is silently ignored.
nobodd-prep(1), nbd-server(1)
Please report bugs at: https://github.com/waveform80/nobodd/issues
Dave Jones
2023-2024 Dave Jones
March 1, 2024 | 0.4 |