All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Schultz <d.schultz@phytec.de>
To: <trini@konsulko.com>, <holger.brunck@hitachienergy.com>,
	<hs@nabladev.com>, <sjg@chromium.org>, <jh80.chung@samsung.com>,
	<u-boot@lists.denx.de>
Cc: <upstream@lists.phytec.de>, Daniel Schultz <d.schultz@phytec.de>
Subject: [PATCH] cmd: Remove default prompt from output
Date: Fri, 15 Aug 2025 09:06:35 -0700	[thread overview]
Message-ID: <20250815160635.3575367-1-d.schultz@phytec.de> (raw)

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@phytec.de>
---
 cmd/i2c.c      |  2 +-
 cmd/mtdparts.c | 12 ++++++------
 common/hash.c  |  6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/cmd/i2c.c b/cmd/i2c.c
index e021067e68a..f7695047629 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -715,7 +715,7 @@ static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc,
 	 */
 	count = hextoul(argv[3], NULL);
 
-	printf ("CRC32 for %08lx ... %08lx ==> ", addr, addr + count - 1);
+	printf("CRC32 for %08lx ... %08lx --> ", addr, addr + count - 1);
 	/*
 	 * CRC a byte at a time.  This is going to be slooow, but hey, the
 	 * memories are small and slow too so hopefully nobody notices.
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index 571b79f091d..48d06f2e000 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -242,7 +242,7 @@ static void index_partitions(void)
 			if (dev == current_mtd_dev) {
 				mtddevnum += current_mtd_partnum;
 				env_set_ulong("mtddevnum", mtddevnum);
-				debug("=> mtddevnum %d,\n", mtddevnum);
+				debug("-> mtddevnum %d,\n", mtddevnum);
 				break;
 			}
 			mtddevnum += dev->num_parts;
@@ -252,17 +252,17 @@ static void index_partitions(void)
 		if (part) {
 			env_set("mtddevname", part->name);
 
-			debug("=> mtddevname %s\n", part->name);
+			debug("-> mtddevname %s\n", part->name);
 		} else {
 			env_set("mtddevname", NULL);
 
-			debug("=> mtddevname NULL\n");
+			debug("-> mtddevname NULL\n");
 		}
 	} else {
 		env_set("mtddevnum", NULL);
 		env_set("mtddevname", NULL);
 
-		debug("=> mtddevnum NULL\n=> mtddevname NULL\n");
+		debug("-> mtddevnum NULL\n-> mtddevname NULL\n");
 	}
 }
 
@@ -282,12 +282,12 @@ static void current_save(void)
 		env_set("partition", buf);
 		strncpy(last_partition, buf, 16);
 
-		debug("=> partition %s\n", buf);
+		debug("-> partition %s\n", buf);
 	} else {
 		env_set("partition", NULL);
 		last_partition[0] = '\0';
 
-		debug("=> partition NULL\n");
+		debug("-> partition NULL\n");
 	}
 	index_partitions();
 }
diff --git a/common/hash.c b/common/hash.c
index 0c45992d5c7..07a4df963ad 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -535,7 +535,7 @@ static void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t *ou
 {
 	int i;
 
-	printf("%s for %08lx ... %08lx ==> ", algo->name, addr, addr + len - 1);
+	printf("%s for %08lx ... %08lx --> ", algo->name, addr, addr + len - 1);
 	for (i = 0; i < algo->digest_size; i++)
 		printf("%02x", output[i]);
 }
@@ -621,8 +621,8 @@ int hash_command(const char *algo_name, int flags, struct cmd_tbl *cmdtp,
 
 		crc = crc32_wd(0, (const uchar *)addr, len, CHUNKSZ_CRC32);
 
-		printf("CRC32 for %08lx ... %08lx ==> %08lx\n",
-				addr, addr + len - 1, crc);
+		printf("CRC32 for %08lx ... %08lx --> %08lx\n",
+		       addr, addr + len - 1, crc);
 
 		if (argc >= 3) {
 			ptr = (ulong *)hextoul(argv[0], NULL);
-- 
2.25.1


             reply	other threads:[~2025-08-15 16:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 16:06 Daniel Schultz [this message]
2025-08-15 16:12 ` [PATCH] cmd: Remove default prompt from output Tom Rini
2025-08-19  9:14   ` Quentin Schulz
2025-09-01  5:12   ` Heiko Schocher

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=20250815160635.3575367-1-d.schultz@phytec.de \
    --to=d.schultz@phytec.de \
    --cc=holger.brunck@hitachienergy.com \
    --cc=hs@nabladev.com \
    --cc=jh80.chung@samsung.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=upstream@lists.phytec.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.