Skip to content

Commit caa0708

Browse files
committed
bootconfig: Change message if no bootconfig with CONFIG_BOOT_CONFIG_FORCE=y
Change no bootconfig data error message if user do not specify 'bootconfig' option but CONFIG_BOOT_CONFIG_FORCE=y. With CONFIG_BOOT_CONFIG_FORCE=y, the kernel proceeds bootconfig check even if user does not specify 'bootconfig' option. So the current error message is confusing. Let's show just an information message to notice skipping the bootconfig in that case. Link: https://lore.kernel.org/all/167754610254.318944.16848412476667893329.stgit@devnote2/ Fixes: b743852 ("Allow forcing unconditional bootconfig processing") Reported-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/all/CAMuHMdV9jJvE2y8gY5V_CxidUikCf5515QMZHzTA3rRGEOj6=w@mail.gmail.com/ Suggested-by: Paul E. McKenney <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]> Tested-by: Paul E. McKenney <[email protected]> Acked-by: Mukesh Ojha <[email protected]>
1 parent b692451 commit caa0708

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

init/main.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static char *extra_init_args;
156156

157157
#ifdef CONFIG_BOOT_CONFIG
158158
/* Is bootconfig on command line? */
159-
static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
159+
static bool bootconfig_found;
160160
static size_t initargs_offs;
161161
#else
162162
# define bootconfig_found false
@@ -429,15 +429,19 @@ static void __init setup_boot_config(void)
429429
err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
430430
bootconfig_params);
431431

432-
if (IS_ERR(err) || !bootconfig_found)
432+
if (IS_ERR(err) || !(bootconfig_found || IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE)))
433433
return;
434434

435435
/* parse_args() stops at the next param of '--' and returns an address */
436436
if (err)
437437
initargs_offs = err - tmp_cmdline;
438438

439439
if (!data) {
440-
pr_err("'bootconfig' found on command line, but no bootconfig found\n");
440+
/* If user intended to use bootconfig, show an error level message */
441+
if (bootconfig_found)
442+
pr_err("'bootconfig' found on command line, but no bootconfig found\n");
443+
else
444+
pr_info("No bootconfig data provided, so skipping bootconfig");
441445
return;
442446
}
443447

0 commit comments

Comments
 (0)