歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Uboot 如何運行腳本

Uboot 如何運行腳本

日期:2017/3/1 9:40:15   编辑:Linux編程

1, 在uboot記錄命令的運行時間,可以打開CONFIG_CMD_TIME。

2, autoscr已經改變成了source命令,可以打開CONFIG_SOURCE,source可以執行內存中腳本,該腳本是由mkimage生成的。

#!/bin/sh
file=$1
result=$2
if [ $# -lt 1 ]
then
echo "$0 file_name result_file_name"
fi
mkimage -A arm -O linux -T script -C none -n "uboot-nor script" -d $file $result

3,mkimage在Host端的安裝:

sudo apt-get install u-boot-tools

4, 可以生成一個txt文件記錄要執行的腳本內容,由於是txt文件所以沒有for循環,如果要這樣做的話,可以由外部的腳本幫你生成多少遍的循環內容,自己就不用麻煩做循環的考慮了。

5,對uboot添加了ext4支持的話,可以由以下命令加載mkimage生成的內容到內存中去。

ext4load mmc 0:5 0x00001000 xxx.img

6,調用source

source 0x00001000

U-Boot源代碼下載地址 http://www.linuxidc.com/Linux/2011-07/38897.htm

u-boot Makefile完全解讀 http://www.linuxidc.com/Linux/2013-04/83529.htm

U-Boot中的date命令 http://www.linuxidc.com/Linux/2013-07/87614.htm

U-Boot源代碼下載地址 http://www.linuxidc.com/Linux/2011-07/38897.htm

U-Boot下的兩個重要數據:bd_t和gd_t http://www.linuxidc.com/Linux/2013-05/83993.htm

U-Boot中的version命令 http://www.linuxidc.com/Linux/2013-05/83990.htm

U-Boot中的usb命令 http://www.linuxidc.com/Linux/2013-05/83991.htm

Copyright © Linux教程網 All Rights Reserved