Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

u-boot - select the correct linux image

I want to let u-boot select between 2 linux kernel images based on a criterion. For example, I have uImage1 and uImage2 in SPI, u-boot checks the CRC of uImage1 and if ok, boots up uImage1 else boots up uImage2. Is there an option in u-boot that I can use?

Thanks, Mani

like image 445
Mani Avatar asked Apr 23 '13 19:04

Mani


1 Answers

You can just set you bootcmd variable to 'bootm 80000000; bootm 820000000'. If the first bootm fails (which it will if the CRC check fails) then the second will run. If the first succeeds then the second never gets a chance to run.

Uboot does support a scripting mechanism with constructs like 'for' and 'if' e.g.:

for part in ${partition_list}
do
    if nfs ${loadaddr} ${nfs_update_prefix}.${part}
        echo Partition ${part} loaded at ${loadaddr}.
        echo Do something with it here.
    else
        echo Partition ${part} not found.
    fi
done
like image 181
Pete Fordham Avatar answered Sep 18 '22 19:09

Pete Fordham