From: Lillian Berry Date: Mon, 7 Jul 2025 09:14:11 +0000 (+0000) Subject: init/main.c: add warning when file specified in rdinit is inaccessible X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98aa4d5d242d3a73388271e00e11ce91d8c3c3e1;p=thirdparty%2Flinux.git init/main.c: add warning when file specified in rdinit is inaccessible Avoid silently ignoring the initramfs when the file specified in rdinit is not usable. This prints an error that clearly explains the issue (file was not found, vs initramfs was not found). Link: https://lkml.kernel.org/r/20250707091411.1412681-1-lillian@star-ark.net Signed-off-by: Lillian Berry Cc: Al Viro Signed-off-by: Andrew Morton --- diff --git a/init/main.c b/init/main.c index 225a58279acd7..e47984871775b 100644 --- a/init/main.c +++ b/init/main.c @@ -1592,7 +1592,11 @@ static noinline void __init kernel_init_freeable(void) * check if there is an early userspace init. If yes, let it do all * the work */ - if (init_eaccess(ramdisk_execute_command) != 0) { + int ramdisk_command_access; + ramdisk_command_access = init_eaccess(ramdisk_execute_command); + if (ramdisk_command_access != 0) { + pr_warn("check access for rdinit=%s failed: %i, ignoring\n", + ramdisk_execute_command, ramdisk_command_access); ramdisk_execute_command = NULL; prepare_namespace(); }