(subset) [PATCH 0/6] test: Quote variables in 'test -n' expressions across boards

Tom Rini trini at konsulko.com
Fri May 15 01:15:47 CEST 2026


On Sun, 03 May 2026 14:49:18 -0600, Simon Glass wrote:

> 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.
> 
> [...]

Applied to u-boot/next, thanks!

[2/6] ti: Quote board_init in ti_common.env
      commit: 825f8ee2fcf64ef5875a0bc0a3e2d8650acdc298
[3/6] siemens: Quote A/B flags in env tests
      commit: 6b109a1304a03b35ad489e551964737ad80f6a82
[4/6] beaglev_fire: Quote no_of_overlays in design test
      commit: 2120834c25d525b754a8473565d4e0f9c158d806
[5/6] mccmon6: Quote recovery_status in bootcmd test
      commit: 9458e39c6595e2e00a1d0a645676eaf935e783c7
[6/6] aristainetos2: Quote rescue_reason in rescueboot test
      commit: 93d7dc20e80e33ace9b871de44877548642f86cb
-- 
Tom




More information about the U-Boot mailing list