All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>,
	Francis Laniel <francis.laniel@amarulasolutions.com>,
	Guillaume La Roque <glaroque@baylibre.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Julien Masson <jmasson@baylibre.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Martyn Welch <martyn.welch@collabora.com>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Richard Weinberger <richard@nod.at>,
	Tom Rini <trini@konsulko.com>
Subject: [PATCH 5/5] pxe_utils: Support the SAY command
Date: Thu, 19 Dec 2024 21:01:20 -0700	[thread overview]
Message-ID: <20241220040120.3245610-6-sjg@chromium.org> (raw)
In-Reply-To: <20241220040120.3245610-1-sjg@chromium.org>

This shows a message for the user. Implement it to keep the user
informed.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 boot/pxe_utils.c         | 13 +++++++++++++
 test/boot/bootflow.c     |  1 +
 test/py/tests/test_ut.py |  1 +
 3 files changed, 15 insertions(+)

diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c
index 5d52a5965d6..5a8fbbe57ad 100644
--- a/boot/pxe_utils.c
+++ b/boot/pxe_utils.c
@@ -890,6 +890,7 @@ enum token_type {
 	T_BACKGROUND,
 	T_KASLRSEED,
 	T_FALLBACK,
+	T_SAY,
 	T_INVALID
 };
 
@@ -924,6 +925,7 @@ static const struct token keywords[] = {
 	{"background", T_BACKGROUND,},
 	{"kaslrseed", T_KASLRSEED,},
 	{"fallback", T_FALLBACK,},
+	{"say", T_SAY,},
 	{NULL, T_INVALID}
 };
 
@@ -1388,6 +1390,17 @@ static int parse_label(char **c, struct pxe_menu *cfg)
 		case T_EOL:
 			break;
 
+		case T_SAY: {
+			char *p = strchr(s, '\n');
+
+			if (p) {
+				printf("%.*s\n", (int)(p - *c) - 1, *c + 1);
+
+				*c = p;
+			}
+			break;
+		}
+
 		default:
 			/*
 			 * put the token back! we don't want it - it's the end
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index db1af0e5729..7675d632884 100644
--- a/test/boot/bootflow.c
+++ b/test/boot/bootflow.c
@@ -1536,6 +1536,7 @@ static int bootflow_extlinux_localboot(struct unit_test_state *uts)
 
 	/* read all the images, but don't actually boot */
 	ut_assertok(bootflow_read_all(bflow));
+	ut_assert_nextline("Doing local boot...");
 	ut_assert_nextline("1:\tlocal");
 	ut_assert_nextline("missing environment variable: localcmd");
 	ut_assert_nextline("Retrieving file: /vmlinuz");
diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py
index b6b4717c834..89c765c0e6e 100644
--- a/test/py/tests/test_ut.py
+++ b/test/py/tests/test_ut.py
@@ -584,6 +584,7 @@ def setup_localboot_image(cons):
     script = '''DEFAULT local
 
 LABEL local
+  SAY Doing local boot...
   LOCALBOOT 0
 '''
     vmlinux = 'vmlinuz'
-- 
2.34.1


  parent reply	other threads:[~2024-12-20  4:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20  4:01 [PATCH 0/5] pxe: Support an automatic localboot Simon Glass
2024-12-20  4:01 ` [PATCH 1/5] test/py: Refactor extlinux-image creation into a function Simon Glass
2024-12-20  4:01 ` [PATCH 2/5] test: bootflow: Avoid a confusing error condition Simon Glass
2024-12-20  4:01 ` [PATCH 3/5] pxe_utils: Allow the FDT to be missing Simon Glass
2024-12-20 14:45   ` Tom Rini
2025-01-14 15:13   ` Quentin Schulz
2025-01-15  1:16     ` Simon Glass
2025-01-15 11:59       ` Quentin Schulz
2025-01-15 13:19         ` Simon Glass
2024-12-20  4:01 ` [PATCH 4/5] pxe_utils: Support a backup for localboot Simon Glass
2024-12-20 14:56   ` Tom Rini
2024-12-20 17:18     ` Simon Glass
2024-12-20 17:23       ` Tom Rini
2024-12-20 17:37         ` Simon Glass
2024-12-20 20:48           ` Tom Rini
2025-01-08 17:04             ` Simon Glass
2025-01-08 17:31               ` Tom Rini
2025-01-09 12:31                 ` Simon Glass
2024-12-20  4:01 ` Simon Glass [this message]
2024-12-20 14:44   ` [PATCH 5/5] pxe_utils: Support the SAY command Tom Rini
2024-12-20 17:36     ` Simon Glass
2024-12-20 18:30       ` Tom Rini
2024-12-20 19:34         ` Simon Glass

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=20241220040120.3245610-6-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=francis.laniel@amarulasolutions.com \
    --cc=glaroque@baylibre.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jmasson@baylibre.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=martyn.welch@collabora.com \
    --cc=michael@amarulasolutions.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=quentin.schulz@cherry.de \
    --cc=richard@nod.at \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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.