]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ti: Quote board_init in ti_common.env
authorSimon Glass <sjg@chromium.org>
Sun, 3 May 2026 20:49:20 +0000 (14:49 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 14 May 2026 21:39:09 +0000 (15:39 -0600)
bootcmd_ti_mmc skips a per-board init hook with:

    if test -n ${board_init}; then run board_init; fi;

The default case is "no board override", i.e. board_init unset. The
expression then 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
run.

Quote the variable so an unset board_init 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 <sjg@chromium.org>
include/env/ti/ti_common.env

index 62b93eb25c4541d0887e095c77d4e06bbfc6bd37..e6ceaa17adc4666c6b16482d5841a6a795777bcd 100644 (file)
@@ -24,7 +24,7 @@ get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile}
 run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring}
 bootcmd_ti_mmc=
        run init_${boot};
-       if test -n ${board_init}; then
+       if test -n "${board_init}"; then
                echo Running board_init ...;
                run board_init;
        fi;