简要说明:
TFTP(Trivial File Transfer Protocol,简单文件传输协议)是 TCP/IP 协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂、开销不大的文件传输服务,端口号为 69。
在 U-Boot 中也支持 TFTP 协议,可以通过 tftp 命令从服务端下载文件。服务端可以是 Linux,也可以是 Windows,只要支持 TFTP 服务就可以。
本文介绍如何在 Ubuntu 24.04 中搭建 TFTP 服务,并实现在 U-Boot 中使用 tftp 命令下载 Linux 内核镜像文件到开发板 DRAM 中。
搭建 TFTP 服务:
- 执行命令安装 tftp-hpa 和 tftpd-hpa:
sudo apt-get install tftp-hpa tftpd-hpa
sudo apt-get install xinetd
- 创建 TFTP 工作目录:
mkdir -m 777 /tftpboot
- 新建文件 /etc/xinetd.d/tftp,填入以下内容:
server tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/
disable &