Skip to content

Commit

Permalink
u-boot: env_resin: fix use of skip bootcount
Browse files Browse the repository at this point in the history
When `os_bc_skip` is set, the bootcount variable is not set and the
altboot check incorrectly assumes the boot limit has exceeded.

Make sure the bootcount comparison only takes place if bootcount has
been set.

Change-type: patch
Signed-off-by: Alex Gonzalez <[email protected]>
  • Loading branch information
alexgg committed Nov 21, 2024
1 parent 26fe995 commit 7f918f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion meta-balena-common/recipes-bsp/u-boot/patches/env_resin.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"setexpr resin_roota ${resin_boot_part} + 1; " \
"setexpr resin_rootb ${resin_boot_part} + 2; " \
"run os_inc_bc_save;" \
"if test -n ${os_bc_lim}; then " \
"if test -n ${os_bc_lim} && test -n ${bootcount}; then " \
"if test ${bootcount} -gt ${os_bc_lim}; then " \
"echo WARNING! BOOTLIMIT EXCEEDED. SWITCHING TO PREVIOUS ROOT;" \
"echo WARNING! was: resin_root_part=${resin_root_part};" \
Expand Down

0 comments on commit 7f918f1

Please sign in to comment.