diff mbox series

[v5,13/14] smegw01: Fix fallback to altbootcmd

Message ID 20230426160501.1199085-13-festevam@gmail.com
State Accepted
Commit fd20052662b53fa75b4ed3f7832b4dfe35ec75c5
Delegated to: Stefano Babic
Headers show
Series [v5,01/14] smegw01: Enable setting additional boot params | expand

Commit Message

Fabio Estevam April 26, 2023, 4:05 p.m. UTC
From: Eduard Strehlau <eduard@lionizers.com>

The bootcmd/altbootcmd mechanism is not invoked for bootmenus.
Manually compare bootcount and bootlimit to implement fallback on all
codepaths.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v4:
- None

 configs/smegw01_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic May 2, 2023, 12:46 p.m. UTC | #1
> From: Eduard Strehlau <eduard@lionizers.com>
> The bootcmd/altbootcmd mechanism is not invoked for bootmenus.
> Manually compare bootcount and bootlimit to implement fallback on all
> codepaths.
> Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/configs/smegw01_defconfig b/configs/smegw01_defconfig
index fe8152f33e6e..3d2713f52807 100644
--- a/configs/smegw01_defconfig
+++ b/configs/smegw01_defconfig
@@ -23,7 +23,7 @@  CONFIG_AUTOBOOT_MENU_SHOW=y
 # CONFIG_CMD_BOOTEFI_BOOTMGR is not set
 CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE=y
 CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="if test \"${ustate}\" = 1; then setenv upgrade_available 1; saveenv; fi; run mmcboot; "
+CONFIG_BOOTCOMMAND="if test \"${bootcount}\" -gt \"${bootlimit}\"; then run altbootcmd; else if test \"${ustate}\" = 1; then setenv upgrade_available 1; saveenv; fi; run mmcboot; fi;"
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run setup_boot_menu;"
 CONFIG_HUSH_PARSER=y