Skip to content

Commit

Permalink
init: Suppress wrong warning for bootconfig cmdline parameter
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mhiramat authored and rostedt committed Aug 12, 2021
1 parent 12f9951 commit d0ac5fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ static int __init bootconfig_params(char *param, char *val,
return 0;
}

static int __init warn_bootconfig(char *str)
{
/* The 'bootconfig' has been handled by bootconfig_params(). */
return 0;
}

static void __init setup_boot_config(void)
{
static char tmp_cmdline[COMMAND_LINE_SIZE] __initdata;
Expand Down Expand Up @@ -475,9 +481,8 @@ static int __init warn_bootconfig(char *str)
pr_warn("WARNING: 'bootconfig' found on the kernel command line but CONFIG_BOOT_CONFIG is not set.\n");
return 0;
}
early_param("bootconfig", warn_bootconfig);

#endif
early_param("bootconfig", warn_bootconfig);

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

0 comments on commit d0ac5fb

Please sign in to comment.