Specifications

setenv bootcmd bootm \$address
setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off'
14.2.17.3. Hush shell scripts
Here are a few examples for the use of the advanced capabilities of the hush shell in U-Boot environment
variables or scripts:
Example:
=> setenv check 'if imi $addr; then echo Image OK; else echo Image corrupted!!; fi'
=> print check
check=if imi $addr; then echo Image OK; else echo Image corrupted!!; fi
=> addr=0 ; run check
## Checking Image at 00000000 ...
Bad Magic Number
Image corrupted!!
=> addr=40000 ;run check
## Checking Image at 00040000 ...
Image Name: ARM Linux-2.4.18
Created: 2003-06-02 14:10:54 UTC
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 801609 Bytes = 782.8 kB
Load Address: 0c008000
Entry Point: 0c008000
Verifying Checksum ... OK
Image OK
Instead of "echo Image OK" there could be a command (sequence) to boot or otherwise deal with
the correct image; instead of the "echo Image corrupted!!" there could be a command
(sequence) to (load and) boot an alternative image, etc.
Example:
=> addr1=0
=> addr2=10
=> bootm $addr1 || bootm $addr2 || tftpboot $loadaddr $loadfile && bootm
## Booting image at 00000000 ...
Bad Magic Number
## Booting image at 00000010 ...
Bad Magic Number
TFTP from server 192.168.3.1; our IP address is 192.168.3.68
Filename '/tftpboot/TRAB/uImage'.
Load address: 0xc400000
Loading: #################################################################
#################################################################
###########################
done
Bytes transferred = 801673 (c3b89 hex)
## Booting image at 0c400000 ...
Image Name: ARM Linux-2.4.18
This will check if the image at (flash?) address "addr1" is ok and boot it; if the image is not ok, the
alternative image at address "addr2" will be checked and booted if it is found to be OK. If both
images are missing or corrupted, a new image will be loaded over TFTP and booted.
14.2.17.2. Hush shell 170