]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
aristainetos2: Quote rescue_reason in rescueboot test
authorSimon Glass <sjg@chromium.org>
Sun, 3 May 2026 20:49:24 +0000 (14:49 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 14 May 2026 21:39:09 +0000 (15:39 -0600)
The rescueboot script optionally runs a per-board rescue_reason hook
with:

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

The default state is "no rescue reason script", i.e. rescue_reason
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 rescue_reason 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>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
include/configs/aristainetos2.h

index 8a66b1275dfee0495798a42e50d022ee14640805..2078ebc5282f62ebf23299be65d195446cc20b7e 100644 (file)
                "${pubkey}\0" \
        "rescueboot=echo Booting rescue system ...; " \
                "run addmtd addmisc;" \
-               "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
+               "if test -n \"${rescue_reason}\"; then run rescue_reason;fi;" \
                "run boot_board_type;" \
                "if bootm ${fit_addr_r}; then ; " \
                "else " \