]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
smegw01: Run altbootcmd in the case of failure
authorEduard Strehlau <eduard@lionizers.com>
Wed, 26 Apr 2023 16:04:52 +0000 (13:04 -0300)
committerStefano Babic <sbabic@denx.de>
Tue, 2 May 2023 08:57:32 +0000 (10:57 +0200)
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>
configs/smegw01_defconfig
include/configs/smegw01.h

index 418151a6de05ac36dcac318deb1157ad2dc7e45d..b3580d5d6e54c38624f12f1141042ec1549a6b28 100644 (file)
@@ -18,7 +18,7 @@ CONFIG_SYS_MEMTEST_END=0xa0000000
 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
index 6ee4acc70d29e6be1fc0be206da33dc6f70f3366..05edaac42f8e5744aea4ecb7f5b9bd5f6e6c6096 100644 (file)
        "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 " \