reference:
=> help sourcesource - run script from memoryUsage: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:
echoecho Network Configuration:echo ----------------------echo Target:printenv ipaddr hostnameechoecho Server:printenv serverip rootpathecho
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.scrImage Name: autoscr example scriptCreated: Mon Feb 8 16:36:04 2010Image Type: PowerPC Linux Script (uncompressed)Data Size: 157 Bytes = 0.15 kB = 0.00 MBLoad Address: 0x00000000Entry Point: 0x00000000Contents: 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.scrUsing ppc_4xx_eth0 deviceTFTP from server 192.168.1.1; our IP address is 192.168.100.6Filename '/tftpboot/duts/canyonlands/example.scr'.Load address: 0x100000Loading: #doneBytes 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 00100000Network Configuration:----------------------Target:ipaddr=192.168.100.6hostname=canyonlandsServer:serverip=192.168.1.1rootpath=/opt/eldk/ppc_4xxFP=>