aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-03-20 18:48:01 +1300
committerTom Rini <trini@konsulko.com>2023-03-23 15:09:37 -0400
commit70817b42a150804035f3209e98525ac76a33ddb1 (patch)
tree9cb8befc35a42191fb04b03bb7d6c27f77d05242
parentd2f3f22e9e332549be4f9b44a8faae48c3216980 (diff)
downloadu-boot-WIP/2023-03-23-rockchip-bootstd-fixes.zip
u-boot-WIP/2023-03-23-rockchip-bootstd-fixes.tar.gz
u-boot-WIP/2023-03-23-rockchip-bootstd-fixes.tar.bz2
bootstd: Relax the argument requirements for bootflow scanWIP/2023-03-23-rockchip-bootstd-fixes
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>
-rw-r--r--boot/Kconfig3
-rw-r--r--cmd/bootflow.c14
2 files changed, 13 insertions, 4 deletions
diff --git a/boot/Kconfig b/boot/Kconfig
index 6876a5b..c298585 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -1543,8 +1543,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 3548bbb..6455f40 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;
}