From: "Łukasz Majewski" <lukma@nabladev.com>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, "Rasmus Villemoes" <ravi@prevas.dk>,
"Tom Rini" <trini@konsulko.com>,
"Łukasz Majewski" <lukma@nabladev.com>
Subject: Re: [PATCH 5/6] mccmon6: Quote recovery_status in bootcmd test
Date: Mon, 4 May 2026 08:34:28 +0200 [thread overview]
Message-ID: <20260504083428.14b3bc8d@wsk> (raw)
In-Reply-To: <20260503204936.3151124-6-sjg@chromium.org>
On Sun, 3 May 2026 14:49:23 -0600
Simon Glass <sjg@chromium.org> wrote:
> The mccmon6 bootcmd starts with:
>
> if test -n ${recovery_status}; then run boot_recovery; ...
>
> The default state is "no recovery requested", i.e. recovery_status
> 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 recovery.
>
> Quote the variable so an unset recovery_status 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/configs/mccmon6.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/configs/mccmon6.h b/include/configs/mccmon6.h
> index 9f401718bfb..0cf62d6bda8 100644
> --- a/include/configs/mccmon6.h
> +++ b/include/configs/mccmon6.h
> @@ -88,7 +88,7 @@
> "bootm $loadaddr};reset;" \
> "fi\0" \
> "bootcmd=" \
> - "if test -n ${recovery_status}; then " \
> + "if test -n \"${recovery_status}\"; then " \
> "run boot_recovery;" \
> "else " \
> "if test ! -n ${boot_medium}; then " \
Reviewed-by: Łukasz Majewski <lukma@nabladev.com>
--
Best regards,
Lukasz Majewski
--
Nabla Software Engineering GmbH
HRB 40522 Augsburg
Phone: +49 821 45592596
E-Mail: office@nabladev.com
Managing Director : Stefano Babic
next prev parent reply other threads:[~2026-05-04 6:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-03 20:49 [PATCH 0/6] test: Quote variables in 'test -n' expressions across boards Simon Glass
2026-05-03 20:49 ` [PATCH 1/6] toradex: Quote fdtfile in preboot test Simon Glass
2026-05-04 4:54 ` Francesco Dolcini
2026-05-04 12:15 ` Simon Glass
2026-05-03 20:49 ` [PATCH 2/6] ti: Quote board_init in ti_common.env Simon Glass
2026-05-03 20:49 ` [PATCH 3/6] siemens: Quote A/B flags in env tests Simon Glass
2026-05-03 20:49 ` [PATCH 4/6] beaglev_fire: Quote no_of_overlays in design test Simon Glass
2026-05-03 20:49 ` [PATCH 5/6] mccmon6: Quote recovery_status in bootcmd test Simon Glass
2026-05-04 6:34 ` Łukasz Majewski [this message]
2026-05-03 20:49 ` [PATCH 6/6] aristainetos2: Quote rescue_reason in rescueboot test Simon Glass
2026-05-04 12:54 ` Heiko Schocher
2026-05-14 23:15 ` (subset) [PATCH 0/6] test: Quote variables in 'test -n' expressions across boards Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260504083428.14b3bc8d@wsk \
--to=lukma@nabladev.com \
--cc=ravi@prevas.dk \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox