reference:

http://www.denx.de/wiki/DULG/UBootCmdGroupExec

=> help source
source - run script from memory Usage:
source [addr]
- run script starting at addr
- A valid image header must be present
=>

With the source command you can run "shell" scripts under U-Boot: You create a U-Boot script image by simply writing the commands you want to run into a text file; then you will have to use the mkimage tool to convert this text file into a U-Boot image (using the image type script).

This image can be loaded like any other image file, and with source you can run the commands in such an image. For instance, the following text file:

echo
echo Network Configuration:
echo ----------------------
echo Target:
printenv ipaddr hostname
echo
echo Server:
printenv serverip rootpath
echo

can be converted into a U-Boot script image using the mkimage command like this:

bash$ mkimage -A ppc -O linux -T script -C none -a 0 -e 0 \
> -n "autoscr example script" \
> -d ./testsystems/dulg/testcases/example.script /tftpboot/duts/canyonlands/example.scr
Image Name: autoscr example script
Created: Mon Feb 8 16:36:04 2010
Image Type: PowerPC 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

Now you can load and execute this script image in U-Boot:

=> tftp 0x100000 /tftpboot/duts/canyonlands/example.scr
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.1; our IP address is 192.168.100.6
Filename '/tftpboot/duts/canyonlands/example.scr'.
Load address: 0x100000
Loading: #
done
Bytes transferred = 221 (dd hex)
=> imi ## Checking Image at 00100000 ...
Legacy image found
Image Name: autoscr example script
Created: 2010-02-08 15:36:04 UTC
Image Type: PowerPC Linux Script (uncompressed)
Data Size: 157 Bytes = 0.2 kB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 149 Bytes = 0.1 kB
Verifying Checksum ... OK
=> source 0x100000
## Executing script at 00100000 Network Configuration:
----------------------
Target:
ipaddr=192.168.100.6
hostname=canyonlands Server:
serverip=192.168.1.1
rootpath=/opt/eldk/ppc_4xxFP =>

learning uboot source command的更多相关文章

  1. learning uboot test command

    uboot commad test test - minimal test like /bin/sh so we can use test command to some judge for exam ...

  2. learning uboot fstype command

    => fstypefstype - Look up a filesystem type Usage:fstype <interface> <dev>:<part&g ...

  3. learning uboot part command

    => part --helppart - disk partition related commands Usage:part uuid <interface> <dev> ...

  4. 【Supervisor】使用 Supervisor source command not found 如何解决

    结论: The source command is only available in bash, and the supervisor command is run by sh. I would r ...

  5. source command not found in sh shell解决办法

    在Ubuntu系统中执行脚本的时候突然出现错误"source command not found in sh shell" 这个其实在Ubuntu 当中 执行脚本默认的使用的是da ...

  6. Ubuntu解决sudo: source: command not found错误

    Ubuntu Server上执行以下命令,可以看到默认打开的文件数限制为1024个. $ ulimit -n 1024 编辑/etc/profile配置文件,在最后添加一行: ulimit -SHn ...

  7. 编译U-Boot时command not found的解决方法

    我使用的U-Boot版本是u-boot-2012.10,编译的步骤为 cd u-boot-2012.10 make s5p_goni_config sudo make 然后,就会看到错误提示 /bin ...

  8. Ubuntu 之旅 —— 解决sudo: source: command not found错误

    $ sudo -s # source /etc/profile

  9. learning uboot switch to standby system using button

    pseudocode: If(reset_button was pressed ) { Change  uboot env bootslot^1 }

随机推荐

  1. 20145336 张子扬 《网络对抗技术》web基础

    20145336张子扬<网络对抗>Exp8 Web基础 实践内容 1.简单的web前端页面(HTML.CSS等) 2.简单的web后台数据处理(PHP) 3.Mysql数据库 4.一个简单 ...

  2. BZOJ3884: 上帝与集合的正确用法 拓展欧拉定理

    Description   根据一些书上的记载,上帝的一次失败的创世经历是这样的: 第一天, 上帝创造了一个世界的基本元素,称做“元”. 第二天, 上帝创造了一个新的元素,称作“α”.“α”被定义为“ ...

  3. 用 SwitchHosts设置hotst, 用法示例

    涉及到本地默认ip(localhost,127.0.0.1)设置关联地址时,使用XAMPP本地服务器时避免自动跳转设置的域名的一些处理方法 打开此文件,把内容修改如下 # Virtual Hosts# ...

  4. java web项目去除项目名称访问设置方法及tomcat的<Host>标签讲解

    本文为博主原创,未经允许不得转载. 在集群项目中,为了方便用户可以更快捷的访问,即只需要输入IP和端口号,就可以直接访问项目,因为 模块比较多,记住项目名称并不容易,所以在网上查看和学习了下设置的方法 ...

  5. YOLO(Darknet官方)训练分类器

    目录 1. 分类数据准备 2. Darknet配置 3. Darknet命令使用 4. cifar-10 使用示例 1. 分类数据准备 需要的文件列表: 1. train.list : 训练的图片的绝 ...

  6. K条最短路径算法(KSP, k-shortest pathes):Yen's Algorithm

    参考: K最短路径算法之Yen's Algorithm Yen's algorithm 基于网络流量的SDN最短路径转发应用 K条最短路径算法:Yen's Algorithm 算法背景 K 最短路径问 ...

  7. DFS回溯-函数递归-xiaoz triangles

    题目:小z 的三角形 ★实验任务 三角形的第1 行有n 个由"+"和"-"组成的符号,以后每行符 号比上行少1 个,2 个同号下面是"+", ...

  8. 学习mybatis-3 step by step 篇三

    动态 SQL if choose (when, otherwise) trim (where, set) foreach 动态 SQL 通常要做的事情是有条件地包含 where 子句的一部分.比如: ...

  9. [BZOJ]|[Ural] Formula 1-----插头DP入门

    1519. Formula 1 Time limit: 1.0 secondMemory limit: 64 MB Background Regardless of the fact, that Vo ...

  10. windows下的mongodb安装(真垃圾)

    一.下载 3.6下载安装会卡死.只能下3.4的.http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-v3.4-la ...