Using TFTP to load the kernel
Now that we know how to mount the root filesystem over a network using NFS, you may be wondering if there is a way to load the kernel, device tree, and initramfs
over the network as well. If we can do this, the only component that needs to be written to storage on the target is the bootloader. Everything else could be loaded from the host machine. It would save time since you would not need to keep reflashing the target, and you could even get work done while the flash storage drivers are still being developed (it happens).
The Trivial File Transfer Protocol (TFTP) is the answer to the problem. TFTP is a very simple file transfer protocol, designed to be easy to implement in bootloaders such as U-Boot.
To begin with, you need to install a TFTP daemon on your host. On Ubuntu, the package to install is named tftpd-hpa
:
$ sudo apt install tftpd-hpa
By default, tftpd-hpa
grants read-only access to files in the /var/lib/tftpboot
directory. With...