Skip to content

Commit d0ac5fb

Browse files
mhiramatrostedt
authored andcommitted
init: Suppress wrong warning for bootconfig cmdline parameter
Since the 'bootconfig' command line parameter is handled before parsing the command line, it doesn't use early_param(). But in this case, kernel shows a wrong warning message about it. [ 0.013714] Kernel command line: ro console=ttyS0 bootconfig console=tty0 [ 0.013741] Unknown command line parameters: bootconfig To suppress this message, add a dummy handler for 'bootconfig'. Link: https://lkml.kernel.org/r/162812945097.77369.1849780946468010448.stgit@devnote2 Fixes: 86d1919 ("init: print out unknown kernel parameters") Reviewed-by: Andrew Halaney <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 12f9951 commit d0ac5fb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

init/main.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,12 @@ static int __init bootconfig_params(char *param, char *val,
397397
return 0;
398398
}
399399

400+
static int __init warn_bootconfig(char *str)
401+
{
402+
/* The 'bootconfig' has been handled by bootconfig_params(). */
403+
return 0;
404+
}
405+
400406
static void __init setup_boot_config(void)
401407
{
402408
static char tmp_cmdline[COMMAND_LINE_SIZE] __initdata;
@@ -475,9 +481,8 @@ static int __init warn_bootconfig(char *str)
475481
pr_warn("WARNING: 'bootconfig' found on the kernel command line but CONFIG_BOOT_CONFIG is not set.\n");
476482
return 0;
477483
}
478-
early_param("bootconfig", warn_bootconfig);
479-
480484
#endif
485+
early_param("bootconfig", warn_bootconfig);
481486

482487
/* Change NUL term back to "=", to make "param" the whole string. */
483488
static void __init repair_env_string(char *param, char *val)

0 commit comments

Comments
 (0)