LITE5200B User’s Manual, Rev. 0
Freescale Semiconductor
7-1
Chapter 7
U-Boot Commands
7.1
AUTOSCR – Run Script from Memory
autoscr [addr]
– Run script starting at addr. A valid
autoscr
header must be present.
The
autoscr
command allows “shell” scripts to run under U-Boot. To create a U-Boot script image,
commands are written to a text file. Then the mkimage tool [of a suitable compiler] is used 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.
autoscr
runs the commands in this image.
For example, consider the following text file:
echo
echo Network Configuration:
echo ----------------------
echo Target:
printenv ipaddr hostname
echo
echo Server:
printenv serverip rootpath
echo
Convert the text file into a U-Boot script image using the mkimage command as follows:
bash$ mkimage -A ppc -O linux -T script -C none -a 0 -e 0 \
> -n "autoscr example script" \
> -d /tftpboot/TQM860L/example.script /tftpboot/TQM860L/example.img
Image Name: autoscr example script
Created: Mon Apr 8 01:15:02 2002
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
Load and execute this script image in U-Boot:
=> tftp 100000 /tftpboot/TQM860L/example.img
ARP broadcast 1