5、debian搭建tftp服务器

1、安装tftp服务器:

sudo apt-get install tftpd-hpa xinetd

2、配置:

首先更改tftpd-hpa服务器的根目录,修改/etc/default/tftpd-hpa,文件内容如下

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/data/tftpboot"    #更改这里,在这里指定根目录,我这里指定为/data/tftpboot目录
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

其次在/etc/xinetd.d目录下创建一个名叫tftp的文件,并在该文件中加入如下内容:

service tftp
{
     socket_type     = dgram
     protocol        = udp
     wait            = yes
     user            = root
     server          = /usr/sbin/in.tftpd
     server_args     = -s /xx/xxx/xxxx    #TFTP的根目录,自己根据需要修改,这里需要注意目录权限
     disable         = no
     per_source      = 11
     cps             = 1002
     flags           = IPv4
}

3、重启tftp服务器

扫描二维码关注公众号,回复: 3552191 查看本文章
sudo /etc/init.d/xinetd   restart
sudo service tftpd-hpa restart


4、测试:

启动开发板,通过tftp下载uImage,完整启动信息如下:

U-Boot 2009.08 (Aug 11 2016 - 23:10:26)

modified by jiangxianxv ([email protected])
DRAM:  64 MB
Flash: 512 kB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   dm9000
[uboot@mini2440]# tftp 0x30008000 uImage
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 10.0.0.2; our IP address is 10.0.0.3
Filename 'uImage'.
Load address: 0x30008000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ################
done
Bytes transferred = 3074400 (2ee960 hex)
[uboot@mini2440]#



猜你喜欢

转载自blog.csdn.net/u013451404/article/details/77103759