summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLillian Berry <lillian@star-ark.net>2025-07-07 09:14:11 +0000
committerAndrew Morton <akpm@linux-foundation.org>2025-07-19 19:08:26 -0700
commit98aa4d5d242d3a73388271e00e11ce91d8c3c3e1 (patch)
treee64cd0f2655bbd7e15707f872728c09328cadf5a
parent4efec6c0919d9081a52be50d5b5bfa32bf489c75 (diff)
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 <lillian@star-ark.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--init/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c
index 225a58279acd..e47984871775 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();
}