[PATCH] cmd: Remove default prompt from output

Tom Rini trini at konsulko.com
Fri Aug 15 18:12:37 CEST 2025


On Fri, Aug 15, 2025 at 09:06:35AM -0700, Daniel Schultz wrote:

> Some commands include the U-Boot prompt (=>) in their output,
> which can interfere with tools like labgrid that rely on prompt
> detection to determine when a command has completed. This may cause
> such tools to misinterpret partial output.
> 
> To avoid this issue, it's better to update the command output itself
> rather than modifying the actual U-Boot prompt. Changing the prompt
> is not acceptable in many cases, as some boards have used the default
> prompt (=>) for years, and altering it - especially just for testing -
> could lead to inconsistencies or unintended side effects.
> Instead, replace instances of the prompt that appear within command
> output (not the real prompt) with an alternative like -> to ensure
> correct parsing by tools that rely on prompt recognition.
> 
> Signed-off-by: Daniel Schultz <d.schultz at phytec.de>
> ---
>  cmd/i2c.c      |  2 +-
>  cmd/mtdparts.c | 12 ++++++------
>  common/hash.c  |  6 +++---
>  3 files changed, 10 insertions(+), 10 deletions(-)

This is two cases, and I'm not sure I like the proposal here, sorry. For
cmd/mtdparts.c, it's debug statements. We can change them, but are they
also enabled by default in anything? The other cases, we're changing
output along the lines of:

> -	printf ("CRC32 for %08lx ... %08lx ==> ", addr, addr + count - 1);
> +	printf("CRC32 for %08lx ... %08lx --> ", addr, addr + count - 1);

In each case, and I'm surprised there's not testing that globs on that
today. I see the wget case that uses "==>" and we do have a test that
checks it, today. Is your testing framework not able to handle "=>" in
the middle of a line? Thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250815/99e30607/attachment.sig>


More information about the U-Boot mailing list