安装步骤:
1.
(1) yum install tftp --> 安装tftp client
(2) yum install tftp-server -->安装tftp server
(3) yum install xinetd -->安装tftp的超级服务守护进程
2. 安装完成,查看一下
[root@localhost CentOS]# rpm -qa|grep tftp
tftp-server-0.42-3.1.el5.centos
tftp-0.42-3.1.el5.centos
3. 修改配置文件,修改如下:
[root@localhost CentOS]# vim /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer
# protocol. The tftp protocol is often used to boot diskless
# workstations, download configuration files to network-aware printers,
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot //修改的地方
disable = no //修改的地方
per_source = 11
cps = 100 2
flags = IPv4
}
说明:
设置Tftp共享目录:进入/etc/xinetd.d/Tftp文件,修改server_args项中的目录,,disable =no ,
说明:修改项server_args= -s -c,其中处可以改为你的Tftp-server的根目录,参数-s指定chroot,-c指定了可以创建文件。
注意:共享目录一定不要选择/root这样的特权目录,否则传输文件会失败accwss denied
4.
6. 重启xinetd,并配置tftp开机启动
[root@localhost CentOS]# service xinetd restart
[root@localhost CentOS]# setup //这里主要是关闭防火墙
修改权限:
[root@localhost /]# chmod 777 /tftpboot/ //这里主要是在./目录下建立了一个tftpboot的目录,更改其目录的权限
重启:
[root@localhost ~]# service xinetd restart
使用TFTP烧写开发板,基于CentOS6.4——ok6410
3)链接好开发板与电脑的网线,打开minicom,将内核镜像烤到设置好的tftp目录。开发上电。(开发板与主机必须在 同一网段)
4)发现不能烧写,查资料后原来要安装客户端:
rpm -vih /mnt/cdrom/Packages/tftp-0.49-7.el6.i686.rpm
然后:
[arm@acer Desktop]$ sudo service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[arm@acer Desktop]$ netstat -a|grep tftp
udp 0 0 *:tftp *:*
#tftp 板子的IP
tftp> mode binary
tftp> put filename
或者tftp -m binary hostip -c put filename,也可以,这个命令在FC6下可行~~
宿主机使用tftp客户端,板子为serve。Linux下tftp默认是采用ASCII方式传送文件的,而映象为二进制,所以要设定为binary模式。
如果烧写不成功,关闭防火墙试试
另外一种方式就是通过norflash模式下载,通过minicom链接开发板上电后选择:
[n] Enter TFTP download mode menu
进入tftp模式,通过[p] Test network (TQ2440 Ping PC's IP)
测试网络联通性。
- Enter your selection: p
- TQ2440 ping PC IP:ping 192.168.1.103
- dm9000 i/o: 0x20000300, id: 0x90000a46
- MAC: 0a:1b:2c:3d:4e:5f
- checksum bad
- host 192.168.1.103 is alive
Enter your selection: p
TQ2440 ping PC IP:ping 192.168.1.103
dm9000 i/o: 0x20000300, id: 0x90000a46
MAC: 0a:1b:2c:3d:4e:5f
checksum bad
host 192.168.1.103 is alive
则说明通了。
下载内核:
- Enter your selection: 3
- dm9000 i/o: 0x20000300, id: 0x90000a46
- MAC: 0a:1b:2c:3d:4e:5f
- TFTP from server 192.168.1.103; our IP address is 192.168.1.6
- Filename 'zImage.bin'.
- Load address: 0x30000000
- Loading: checksum bad
- T checksum bad
- T T T T T T T T T
Enter your selection: 3
dm9000 i/o: 0x20000300, id: 0x90000a46
MAC: 0a:1b:2c:3d:4e:5f
TFTP from server 192.168.1.103; our IP address is 192.168.1.6
Filename 'zImage.bin'.
Load address: 0x30000000
Loading: checksum bad
T checksum bad
T T T T T T T T T
防火墙设置:root下执行setup->Firewall configuration--> Customize->TFTP,空格选中。保存推出。
重新下载:
- Enter your selection: 3
- dm9000 i/o: 0x20000300, id: 0x90000a46
- MAC: 0a:1b:2c:3d:4e:5f
- TFTP from server 192.168.1.103; our IP address is 192.168.1.6
- Filename 'zImage.bin'.
- Load address: 0x30000000
- Loading: checksum bad
- T #################################################################
- #################################################################
- ####################################
- done
- Bytes transferred = 2415772 (24dc9c hex)
- NAND erase: device 0 offset 0x200000, size 0x300000
- Erasing at 0x4e0000 -- 100% complete.
- OK
- NAND write: device 0 offset 0x200000, size 0x24dc9c
- Writing data at 0x44d800 -- 100% complete.
- 2415772 bytes written: OK
Enter your selection: 3
dm9000 i/o: 0x20000300, id: 0x90000a46
MAC: 0a:1b:2c:3d:4e:5f
TFTP from server 192.168.1.103; our IP address is 192.168.1.6
Filename 'zImage.bin'.
Load address: 0x30000000
Loading: checksum bad
T #################################################################
#################################################################
####################################
done
Bytes transferred = 2415772 (24dc9c hex)
NAND erase: device 0 offset 0x200000, size 0x300000
Erasing at 0x4e0000 -- 100% complete.
OK
NAND write: device 0 offset 0x200000, size 0x24dc9c
Writing data at 0x44d800 -- 100% complete.
2415772 bytes written: OK
下载成功!