diff options
| author | Simon Glass <[email protected]> | 2026-05-03 14:49:21 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-05-14 15:39:09 -0600 |
| commit | 6b109a1304a03b35ad489e551964737ad80f6a82 (patch) | |
| tree | a37021bad306dedc31fbe01954738ced28905d9c /include | |
| parent | 825f8ee2fcf64ef5875a0bc0a3e2d8650acdc298 (diff) | |
siemens: Quote A/B flags in env tests
The Siemens am33x-common, env-common and draco-etamin headers gate
boot-partition selection logic on:
if test -n ${A}; then ...
if test -n ${B}; then ...
A and B are flags that the upgrade machinery sets to mark "the other
partition just became active". The default state is unset, in which
case the expression expands to 'test -n' with no operand and relies
on a U-Boot 'test' quirk that treats a missing operand as false to
skip the branch.
Quote each variable so an unset A or B expands to 'test -n ""' and
the emptiness check is explicit.
Fixes: 8b0619579b22 ("cmd: test: fix handling of single-argument form of test")
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/configs/draco-etamin.h | 4 | ||||
| -rw-r--r-- | include/configs/siemens-am33x-common.h | 12 | ||||
| -rw-r--r-- | include/configs/siemens-env-common.h | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/include/configs/draco-etamin.h b/include/configs/draco-etamin.h index 6ae85b575b7..b1b403980b1 100644 --- a/include/configs/draco-etamin.h +++ b/include/configs/draco-etamin.h @@ -99,10 +99,10 @@ "nand_args=run bootargs_defaults;" \ "mtdparts default;" \ "setenv ${partitionset_active} true;" \ - "if test -n ${A}; then " \ + "if test -n \"${A}\"; then " \ "setenv nand_active_ubi_vol ${rootfs_name}_a;" \ "fi;" \ - "if test -n ${B}; then " \ + "if test -n \"${B}\"; then " \ "setenv nand_active_ubi_vol ${rootfs_name}_b;" \ "fi;" \ "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h index a918dc1350c..da822556909 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h @@ -104,11 +104,11 @@ "then " \ "setenv upgrade_available 0;" \ "setenv ${partitionset_active} true;" \ - "if test -n ${A}; then " \ + "if test -n \"${A}\"; then " \ "setenv partitionset_active B; " \ "env delete A; " \ "fi;" \ - "if test -n ${B}; then " \ + "if test -n \"${B}\"; then " \ "setenv partitionset_active A; " \ "env delete B; " \ "fi;" \ @@ -205,11 +205,11 @@ "nand_args=run bootargs_defaults;" \ "mtdparts default;" \ "setenv ${partitionset_active} true;" \ - "if test -n ${A}; then " \ + "if test -n \"${A}\"; then " \ "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \ "setenv nand_src_addr ${nand_src_addr_A};" \ "fi;" \ - "if test -n ${B}; then " \ + "if test -n \"${B}\"; then " \ "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \ "setenv nand_src_addr ${nand_src_addr_B};" \ "fi;" \ @@ -279,10 +279,10 @@ "nand_args=run bootargs_defaults;" \ "mtdparts default;" \ "setenv ${partitionset_active} true;" \ - "if test -n ${A}; then " \ + "if test -n \"${A}\"; then " \ "setenv nand_active_ubi_vol ${rootfs_name}_a;" \ "fi;" \ - "if test -n ${B}; then " \ + "if test -n \"${B}\"; then " \ "setenv nand_active_ubi_vol ${rootfs_name}_b;" \ "fi;" \ "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ diff --git a/include/configs/siemens-env-common.h b/include/configs/siemens-env-common.h index c028823e1eb..8ced77cc5e2 100644 --- a/include/configs/siemens-env-common.h +++ b/include/configs/siemens-env-common.h @@ -81,12 +81,12 @@ */ #define ENV_FCT_TOGGLE_PARTITION "toggle_partition="\ "setenv ${partitionset_active} true;" \ - "if test -n ${A}; " \ + "if test -n \"${A}\"; " \ "then " \ "setenv partitionset_active B; " \ "env delete A; " \ "fi;" \ - "if test -n ${B}; "\ + "if test -n \"${B}\"; "\ "then " \ "setenv partitionset_active A; " \ "env delete B; " \ @@ -103,11 +103,11 @@ */ #define ENV_EMMC_FCT_SET_ACTIVE_PARTITION "set_partition=" \ "setenv ${partitionset_active} true;" \ - "if test -n ${A}; " \ + "if test -n \"${A}\"; " \ "then " \ "setenv mmc_part_nr 1;" \ "fi;" \ - "if test -n ${B}; " \ + "if test -n \"${B}\"; " \ "then " \ "setenv mmc_part_nr 2;" \ "fi;" \ |
