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