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. 硬盘分区表知识—详解硬盘MBR

    硬盘是现在计算机上最常用的存储器之一.我们都知道,计算机之所以神奇,是因为它具有高速分析处理数据的能力.而这些数据都以文件的形式存储在硬盘 里.不过,计算机可不像人那么聪明.在读取相应的文件时,你必须 ...

  2. 基于bootstrap的后台管理系统

    ace metro'nic 基于bootstrap的后台admin system ace [eis], 扑克牌中的A 表示 非常棒, 杰出, 顶好的... gallery: 画廊, 走廊; 在网页中常 ...

  3. Linux 安装、启动和卸载SSH

    卸载SSH: 先停掉SSH服务:sudo stop ssh 检查SSH是否停止:ssh localhost 检查SSH是否启动: ps -e|grep ssh 卸载SSH:apt-get --purg ...

  4. datagridview控件的使用

    http://home.cnblogs.com/group/topic/40730.html datagridview定位到最后一行的方法 this.dataGridView2.CurrentCell ...

  5. 【译】第2节--- 什么是Code First?

    原文链接:http://www.entityframeworktutorial.net/code-first/what-is-code-first.aspx EF从EF4.1中引入了Code-Firs ...

  6. 02_Kafka单节点实践

    1.实践场景 开始前的准备条件: 1) 确认各个节点的jdk版本,将jdk升级到和kafka配套的版本(解压既完成安装,修改/etc/profile下的JAVA_HOME,source /etc/pr ...

  7. 微信小程序之可滚动视图 scroll-view 的使用注意

    微信小程序之可滚动视图 scroll-view 使用注意: 1.scroll-view 中的需要滑动的元素不可以用 float 浮动: 2.scroll-view 中的包裹需要滑动的元素的大盒子用 d ...

  8. ros 使用命令测试topic

    发布话题 $ rostopic pub -r /chatter std_msgs/String "test" 输出数据: $ rostopic echo /chatter data ...

  9. pyqt 调用颜色选择器

    # -*- coding: utf- -*- from PyQt5.QtWidgets import QApplication, QPushButton, QColorDialog , QWidget ...

  10. 对不队——Alpha冲刺

    第五天  日期:2018/6/20 一. 今日完成任务:专家审稿逻辑的开发 冯晓.马思远:会议网站栏目管理开发,软件功能测试 王爽.彭辉:审稿管理员分稿和稿件查找功能开发,博客撰写 吴琼.郝延婷:更换 ...