Specifications
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:
[marex@pollux]$ 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:
[marex@pollux]$
Now you can load and execute this script image in U-Boot:
=> tftp 0x42000000 /tftpboot/duts/m28/example.scr
Using FEC0 device
TFTP from server 192.168.1.1; our IP address is 192.168.20.33
Filename '/tftpboot/duts/m28/example.scr'.
Load address: 0x42000000
Loading: #
done
Bytes transferred = 221 (dd hex)
=> imi
## Checking Image at 42000000 ...
Legacy image found
Image Name: U-Boot example script
Created: 2012-09-05 10:24:29 UTC
Image Type: PowerPC Linux Script (uncompressed)
Data Size: 157 Bytes = 157 Bytes
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 149 Bytes = 149 Bytes
Verifying Checksum ... OK
=> source 0x42000000
## Executing script at 42000000
Network Configuration:
----------------------
Target:
ipaddr=192.168.20.33
hostname=m28
Server:
serverip=192.168.1.1
rootpath=/opt/eldk-5.2.1/armv5te/rootfs-qte-sdk
=>
5.9.4.1. source - run script from memory 59