Run the altbootcmd script if any step of bootcmd fails.
This ensures that always a valid image can be run.
Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="if test \"${ustate}\" = 1; then setenv upgrade_available 1; saveenv; fi; if run loadimage; then run mmcboot; fi; "
+CONFIG_BOOTCOMMAND="if test \"${ustate}\" = 1; then setenv upgrade_available 1; saveenv; fi; if run loadimage; then run mmcboot; else run altbootcmd; fi; "
CONFIG_HUSH_PARSER=y
CONFIG_SYS_MAXARGS=32
CONFIG_SYS_PBSIZE=532
"mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
"if run loadfdt; then " \
- "bootz ${loadaddr} - ${fdt_addr}; " \
+ "if bootz ${loadaddr} - ${fdt_addr}; then " \
+ "; " \
+ "else " \
+ "run altbootcmd; " \
+ "fi;" \
+ "else " \
+ "run altbootcmd; " \
"fi;\0" \
"altbootcmd=echo Performing rollback...; " \
"if test \"${mmcpart}\" = 1; then " \