制作uboot 能执行的脚本

利用U-BOOT中的autoscr命令,可以在U-BOOT中运行“脚本”。
首先在文本文件中输入需要执行的命令,
然后用tools/mkimage封装,
然后下载到开发板上,用autoscr执行就可以了。
=======示例=======
(1)编辑如下的脚本example.script。
echo
echo Network Configuration:
echo ----------------------
echo Target:
printenv ipaddr hostname
echo
echo Server:
printenv serverip rootpath
echo
(2)用tools/mkimage对脚本进行封装。
# mkimage -A ARM -O linux -T script -C none -a 0 -e 0 -n "autoscr example script" -d example.script /tftpboot/example.img
Image Name: autoscr example script
Created: Wes Sep 8 01:15:02 2004
Image Type: ARM Linux Script (uncompressed)
Data Size: 157 Bytes = 0.15 kB = 0.00 MB
Load Address: 0x00000000
Entry Point: 0x00000000
Contents:
Image 0: 149 Bytes = 0 kB = 0 MB


(3)在U-BOOT中加载并执行这个脚本。
WT-ARM9# tftp 100000 /tftpboot/example.img
ARP broadcast 1
TFTP from server 10.0.0.2; our IP address is 10.0.0.99
Filename '/tftpboot/TQM860L/example.img'.
Load address: 0x100000
Loading: #
done
Bytes transferred = 221 (dd hex)


WT-ARM9# autoscr 100000
## Executing script at 00100000
Network Configuration:
----------------------
Target:
ipaddr=10.0.0.99
hostname=arm
Server:
serverip=10.0.0.2
rootpath=/nfsroot
WT-ARM9#

sitemap