[PATCH 0/6] test: Quote variables in 'test -n' expressions across boards
Simon Glass
sjg at chromium.org
Sun May 3 22:49:18 CEST 2026
Several boards use 'test -n ${var}' (unquoted) in env scripts to
detect an empty variable and trigger a fallback or skip a hook. That
works only because of a U-Boot 'test' quirk where calls with argc <
3 returned false; an empty variable made the expression 'test -n'
(one operand) and hit that path.
8b0619579b22 ("cmd: test: fix handling of single-argument form of
test") aligned 'test' with POSIX so those expressions flipped to
true. f7e7c55e53e8 ("cmd: test: add bug-compatibility special case
for 'test -n'") restored the old behaviour for the exact 'test -n'
(one arg) case, so the boards are not broken at runtime today, but
the reliance on a bug-compat path isn't great.
This series updates various boards to quote each affected variable so
the emptiness check is explicit and does not depend on the
special-case path.
Each commit carries a Fixes: tag pointing at 8b0619579b22
Simon Glass (6):
toradex: Quote fdtfile in preboot test
ti: Quote board_init in ti_common.env
siemens: Quote A/B flags in env tests
beaglev_fire: Quote no_of_overlays in design test
mccmon6: Quote recovery_status in bootcmd test
aristainetos2: Quote rescue_reason in rescueboot test
configs/apalis-imx8_defconfig | 2 +-
configs/apalis_imx6_defconfig | 2 +-
configs/colibri-imx6ull-emmc_defconfig | 2 +-
configs/colibri-imx6ull_defconfig | 2 +-
configs/colibri-imx8x_defconfig | 2 +-
configs/colibri_imx6_defconfig | 2 +-
configs/colibri_imx7_defconfig | 2 +-
configs/colibri_imx7_emmc_defconfig | 2 +-
configs/colibri_vf_defconfig | 2 +-
configs/toradex-smarc-imx8mp_defconfig | 2 +-
configs/toradex-smarc-imx95_defconfig | 2 +-
configs/verdin-am62_a53_defconfig | 2 +-
configs/verdin-am62p_a53_defconfig | 2 +-
configs/verdin-imx8mm_defconfig | 2 +-
configs/verdin-imx8mp_defconfig | 2 +-
include/configs/aristainetos2.h | 2 +-
include/configs/beaglev_fire.h | 2 +-
include/configs/draco-etamin.h | 4 ++--
include/configs/mccmon6.h | 2 +-
include/configs/siemens-am33x-common.h | 12 ++++++------
include/configs/siemens-env-common.h | 8 ++++----
include/env/ti/ti_common.env | 2 +-
22 files changed, 31 insertions(+), 31 deletions(-)
---
base-commit: bb0f3eebb3c196d9b6efbbd1e5aa9b16abbb9ad6
branch: env-test-us
--
2.43.0
More information about the U-Boot
mailing list