Skip to content

Commit a906f3a

Browse files
Lillian Berryakpm00
authored andcommitted
init/main.c: check if rdinit was explicitly set before printing warning
The rdinit parameter is set by default, and attempted during boot even if not specified in the command line. Only print the warning about rdinit being inaccessible if the rdinit value was found in command line; it's just noise otherwise. [[email protected]: move ramdisk_execute_command_set into __initdata] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Lillian Berry <[email protected]> Cc: Ahmad Fatoum <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Al Viro <[email protected]> Cc: Douglas Anderson <[email protected]> Cc: Francesco Valla <[email protected]> Cc: Guo Weikang <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Huan Yang <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "Mike Rapoport (Microsoft)" <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 4cc67b0 commit a906f3a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

init/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ static size_t initargs_offs;
162162

163163
static char *execute_command;
164164
static char *ramdisk_execute_command = "/init";
165+
static bool __initdata ramdisk_execute_command_set;
165166

166167
/*
167168
* Used to generate warnings if static_key manipulation functions are used
@@ -623,6 +624,7 @@ static int __init rdinit_setup(char *str)
623624
unsigned int i;
624625

625626
ramdisk_execute_command = str;
627+
ramdisk_execute_command_set = true;
626628
/* See "auto" comment in init_setup */
627629
for (i = 1; i < MAX_INIT_ARGS; i++)
628630
argv_init[i] = NULL;
@@ -1699,8 +1701,9 @@ static noinline void __init kernel_init_freeable(void)
16991701
int ramdisk_command_access;
17001702
ramdisk_command_access = init_eaccess(ramdisk_execute_command);
17011703
if (ramdisk_command_access != 0) {
1702-
pr_warn("check access for rdinit=%s failed: %i, ignoring\n",
1703-
ramdisk_execute_command, ramdisk_command_access);
1704+
if (ramdisk_execute_command_set)
1705+
pr_warn("check access for rdinit=%s failed: %i, ignoring\n",
1706+
ramdisk_execute_command, ramdisk_command_access);
17041707
ramdisk_execute_command = NULL;
17051708
prepare_namespace();
17061709
}

0 commit comments

Comments
 (0)