uboot中使用tftp命令下载


uboot 提供了tftp命令,可以连接到tftp服务器以下载文件
虚拟机Fedora9下,安装tftp服务
yum install xinetd
yum install tftp tftp-sever
下面是我的tftp配置
  1. [root@localhost /]# cat /etc/xinetd.d/tftp  
  2. # default: off   
  3. # description: The tftp server serves files using the trivial file transfer \   
  4. #    protocol.  The tftp protocol is often used to boot diskless \   
  5. #    workstations, download configuration files to network-aware printers, \   
  6. #    and to start the installation process for some operating systems.   
  7. service tftp  
  8. {  
  9.     socket_type        = dgram  
  10.     protocol        = udp  
  11.     wait            = yes  
  12.     user            = root  
  13.     server            = /usr/sbin/in.tftpd  
  14.     server_args        = -s /tftpboot -c  
  15.     disable            = no  
  16.     per_source        = 11  
  17.     cps            = 100 2  
  18.     flags            = IPv4  
  19. }  
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
另外,板子的一些环境变量如下
  1. EmbedSky> printenv  
  2. bootcmd=nboot 0x32000000 kernel; bootm 0x32000000  
  3. bootdelay=0  
  4. baudrate=115200  
  5. ethaddr=0a:1b:2c:3d:4e:5f  
  6. ipaddr=192.168.1.6  
  7. netmask=255.255.255.0  
  8. mtdids=nand0=nandflash0  
  9. mtdparts=mtdparts=nandflash0:256k@0(bios),128k(params),128k(toc),512k(eboot),1024k(logo),2m(kernel),-(root)  
  10. filesize=0  
  11. filesize+1=0  
  12. fileaddr=30000000  
  13. bootargs=noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0  
  14. serverip=192.168.1.116  
  15. stdin=serial  
  16. stdout=serial  
  17. stderr=serial  
  18. partition=nand0,0  
  19. mtddevnum=0  
  20. mtddevname=bios  
  21.   
  22. Environment size: 497/131068 bytes  
此时使用tftp便可从虚拟机上下载文件了
比如
tftp 32000000 zImage

相关内容