uboot 提供了tftp命令,可以连接到tftp服务器以下载文件
虚拟机Fedora9下,安装tftp服务
yum install xinetd
yum install tftp tftp-sever
下面是我的tftp配置
[root@localhost /]# cat /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 -c disable = no per_source = 11 cps = 100 2 flags = IPv4 }
server_args指定tftp的目录,我这里是一个链接,指向源码的boot目录ln -s /opt/FriendlyARM/mini2440/linux-2.6.32.2/arch/arm/boot/ /tftpboot
然后将目录权限增大一点,以防万一
chmod 777 /tftpboot
chmod 777 /opt/FriendlyARM/mini2440/linux-2.6.32.2/arch/arm/boot/
还需将selinux关闭。在桌面菜单,系统--》管理--》selinux management ,将 Enforcing Mode 设置为 Disabled .
用命令serviceconf确认一下tftp服务有没开启,需将其打开
在开发板uboot下如果serverip不是主机ip需要
setenv serverip 192.168.1.116(我的fedora ip)
再
saveenv
另外,板子的一些环境变量如下
EmbedSky> printenv bootcmd=nboot 0x32000000 kernel; bootm 0x32000000 bootdelay=0 baudrate=115200 ethaddr=0a:1b:2c:3d:4e:5f ipaddr=192.168.1.6 netmask=255.255.255.0 mtdids=nand0=nandflash0 mtdparts=mtdparts=nandflash0:256k@0(bios),128k(params),128k(toc),512k(eboot),1024k(logo),2m(kernel),-(root) filesize=0 filesize+1=0 fileaddr=30000000 bootargs=noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0 serverip=192.168.1.116 stdin=serial stdout=serial stderr=serial partition=nand0,0 mtddevnum=0 mtddevname=bios Environment size: 497/131068 bytes
此时使用tftp便可从虚拟机上下载文件了比如
tftp 32000000 zImage