I need to create a 3-step macro in U-Boot:
- Use dhcp to download an image to memory. This sets filesize
- Test if $filesize > $SOMELIMIT, print a message, and stop
- Would write the downloaded image to flash.
I know how to do steps 1 and 3, but not 2.
I know that I can use the U-Boot command itest to test integer values, but I don't know how to create a compound statement in the if/else/endif clause.
And I don't know how to have an "abort macro" step in one of those clauses.
How can I stop a U-Boot command sequence abruptly?
For testing if the result of itest is true you can use the
ifcommand. To leave a macro use theexitcommand:Man-pages for 'if' and 'itest' have been added to https://docs.u-boot.org/en/latest/usage/.