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: huang lin <hl@rock-chips.com>,
	Jeffy Chen <jeffy.chen@rock-chips.com>,
	Simon Glass <sjg@chromium.org>,
	Kever Yang <kever.yang@rock-chips.com>,
	Philipp Tomsich <philipp.tomsich@theobroma-systems.com>,
	Vagrant Cascadian <vagrant@debian.org>,
	Tom Rini <trini@konsulko.com>,
	Philippe Reynes <philippe.reynes@softathome.com>
Subject: [PATCH v4 3/4] bootstd: Relax the argument requirements for bootflow scan
Date: Wed, 29 Mar 2023 20:16:38 +1300	[thread overview]
Message-ID: <20230329071655.1959513-2-sjg@chromium.org> (raw)
In-Reply-To: <20230329201631.v4.1.I41a5e66644a895a311889b009116245245c741a5@changeid>

Currently this does not allow the -lb flags unless CMD_BOOTFLOW_FULL is
enabled, which means that we need two separate boot commands. Relax this
to make things easier. It is only a small amount of extra code.

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

(no changes since v1)

 boot/Kconfig   |  3 +--
 cmd/bootflow.c | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/boot/Kconfig b/boot/Kconfig
index 61ebc2750154..ae0e7b738c0c 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -1554,8 +1554,7 @@ config USE_BOOTCOMMAND
 config BOOTCOMMAND
 	string "bootcmd value"
 	depends on USE_BOOTCOMMAND && !USE_DEFAULT_ENV_FILE
-	default "bootflow scan -lb" if BOOTSTD_BOOTCOMMAND && CMD_BOOTFLOW_FULL
-	default "bootflow scan" if BOOTSTD_BOOTCOMMAND && !CMD_BOOTFLOW_FULL
+	default "bootflow scan -lb" if BOOTSTD_BOOTCOMMAND
 	default "run distro_bootcmd" if !BOOTSTD_BOOTCOMMAND && DISTRO_DEFAULTS
 	help
 	  This is the string of commands that will be used as bootcmd and if
diff --git a/cmd/bootflow.c b/cmd/bootflow.c
index 42f6e14a4370..c345b020070f 100644
--- a/cmd/bootflow.c
+++ b/cmd/bootflow.c
@@ -124,9 +124,19 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc,
 		if (!label)
 			dev = std->cur_bootdev;
 	} else {
+		/*
+		 * allow -b and -l (which is ignored) but complain about
+		 * anything else
+		 */
 		if (has_args) {
-			printf("Flags not supported: enable CONFIG_BOOTFLOW_FULL\n");
-			return CMD_RET_USAGE;
+			char *p;
+
+			for (p = argv[1] + 1; *p; p++) {
+				if (*p != 'b' && *p != 'l') {
+					printf("Flags not supported: enable CONFIG_BOOTFLOW_FULL\n");
+					return CMD_RET_USAGE;
+				}
+			}
 		}
 		boot = true;
 	}
-- 
2.40.0.348.gf938b09366-goog


  parent reply	other threads:[~2023-03-29  7:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  7:16 [PATCH v4 1/4] bootstd: Enable BOOTSTD_DEFAULTS by default Simon Glass
2023-03-29  7:16 ` [PATCH v4 2/4] rockchip: Move to standard boot Simon Glass
2023-03-29  7:16 ` Simon Glass [this message]
2023-03-29 14:17   ` [PATCH v4 3/4] bootstd: Relax the argument requirements for bootflow scan Tom Rini
2023-03-29  7:16 ` [PATCH v4 4/4] rockchip: Use the same boot_targets for all boards Simon Glass
2023-03-29 14:19   ` Tom Rini
2023-03-29  7:41 ` [PATCH v4 1/4] bootstd: Enable BOOTSTD_DEFAULTS by default Michal Simek
2023-03-29  7:55 ` Nicolas Ferre
2023-03-30  9:17   ` Simon Glass
2023-03-30 14:09     ` Tom Rini
2023-03-29 14:15 ` 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=20230329071655.1959513-2-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=hl@rock-chips.com \
    --cc=jeffy.chen@rock-chips.com \
    --cc=kever.yang@rock-chips.com \
    --cc=philipp.tomsich@theobroma-systems.com \
    --cc=philippe.reynes@softathome.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vagrant@debian.org \
    /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.