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. 20145334赵文豪网络对抗Web安全基础实践

    1.SQL注入攻击原理,如何防御? SQL注入攻击就是通过把SQL命令插入到Web表单递交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意SQL命令的目的. 对于SQL注入攻击的防范,我觉 ...

  2. Java序列化流-ObjectOutputStream、ObjectInputStream

    Java对象流的基本概念: 实例代码: 实体类User: import java.io.Serializable; /** * @author zsh * @company wlgzs * @crea ...

  3. RedHat6使用CentOS yum源 换yum

    yum 简单介绍一下 yum 主要功能是更方便的添加/删除/更新RPM 包,自动解决包的倚赖性问题,便于管理大量系统的更新问题. yum 可以同时配置多个资源库(Repository),简洁的配置文件 ...

  4. [Pytorch]Pytorch中图像的基本操作(TenCrop)

    转自:https://www.jianshu.com/p/73686691cf13 下面是几种常写的方式 第一种方式 normalize = transforms.Normalize([0.485, ...

  5. 【TCP/IP详解 卷一:协议】第十二章 广播和多播

    建议参考:广播和多播 IGMP 12.1 引言 IP地址知识点回顾: IP地址分为三种:(1)单播地址 (2)广播地址 (3)多播地址 另外一种是,IP地址一般划分成五类:A-E类. 单播 考虑 类似 ...

  6. CSU 1805 Three Capitals(矩阵树定理+Best定理)

    http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1805 题意: A和B之间有a条边,A和G之间有b条边,B和G之间有c条边.现在从A点出发走遍所 ...

  7. iBatis的基本配置+CRUD操作

    首先解释一下CRUD的含义:CRUD是指在做计算处理时的增加(Create).查询(Retrieve)(重新得到数据).更新(Update)和删除(Delete) 基本的数据库操作 创建工程iBati ...

  8. MSVC_代码优化

    测试环境: Win7x64 cn_visual_studio_2010_ultimate_x86_dvd_532347.iso qt-opensource-windows-x86-msvc2010_o ...

  9. [设计模式][c++]状态切换模式

    转自:http://blog.csdn.net/yongh701/article/details/49154439 状态模式也是设计模式的一种,这种设计模式思想不复杂,就是实现起来的代码有点复杂.主要 ...

  10. Unity打包的时候保存默认的输出路径,再次使用该路径的时候读取之

    using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; us ...