tFTP服务
2025-07-23
49
0
uboot可以使用tftp服务从linux主机下载文件到嵌入式板卡内存中,然后使用相关的命令进行固化。
tftp服务器安装
sudo apt-get install xinetd
确保 /etc/xinetd.conf
zzmt@zzmt:~/Desktop/nfs$ cat /etc/xinetd.conf
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/
defaults
{
# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info
}
includedir /etc/xinetd.d
安装tftp
sudo apt-get install tftp-hpa tftpd-hpa
sudo apt-get install xinetd
chmod 777 /home/zzmt/Desktop/nfs
修改/etc/default/tftpd-hpa
zzmt@zzmt:~/Desktop/nfs$ cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/zzmt/Desktop/nfs"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
配置
新建/etc/xinetd.d/tftp
zzmt@zzmt:~/Desktop/nfs$ cat /etc/xinetd.d/tftp
servicetftp
{
socket_type = dgram
wait = yes
disable = no
user = root
protocol = udp
server = /usr/sbin/in.tftpd
server_args = -s /home/zzmt/Desktop/nfs -c
#log_on_success += PID HOST DURATION
#log_on_failure += HOST
per_source = 11
cps =100 2
flags =IPv4
}
重启服务
sudo service tftpd-hpa restart
linux开发板下测试:
root@ATK-IMX6U:~# tftp -g -r helloworld.c 192.168.0.3
root@ATK-IMX6U:~# ls
driver get helloworld.c shell
192.168.0.3:主机服务器
ARM&Linux环境搭建





