Skip to contentSkip to conversation

Condition in bootcmd to run bootz else bootm

U-Boot DaveKucharczyk 1 participant 2 messages Sep 11, 2015

lore
Share & tools
lore
#0 lore raw

Hi, I'd like to set a condition in bootcmd to run uImage from flash if it can't find zImage on the filesystem.

Here is our zImage bootcmd...
mmc dev 0; ext2load mmc 0:1 ${loadaddr} /opt/common/var/zImage; ext2load mmc 0:1 0x71000000 /opt/common/var/dtb; bootz ${loadaddr} - 0x71000000

Here is our uImage bootcmd...
mmc read ${loadaddr} 0x800 0x1600; bootm

So I tried adding || like so, but it doesn't work...
mmc dev 0; ext2load mmc 0:1 ${loadaddr} /opt/common/var/zImage; ext2load mmc 0:1 0x71000000 /opt/common/var/dtb; bootz ${loadaddr} - 0x71000000 || mmc read ${loadaddr} 0x800 0x1600; bootm

They work individually from command line, but when I add the || to boot uImage it just errors out like so...

** File not found /opt/common/var/zImage.tls4xx ** 30463 bytes read in 200 ms (148.4 KiB/s)
Bad Linux ARM zImage magic! <--- this is correct since
it can't find zImage
Wrong Image Format for bootm command <---- it tried bootm here so maybe
my || needs to be more strategically placed?
ERROR: can't get kernel image!
SYS42>

--
View this message in context: http://u-boot.10912.n7.nabble.com/Condition-in-bootcmd-to-run-bootz-else-bootm-tp228003.html
Sent from the U-Boot mailing list archive at Nabble.com.