[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250706205738.1312194-1-lillian@star-ark.net>
Date: Sun, 6 Jul 2025 20:57:38 +0000
From: Lillian Berry <lillian@...r-ark.net>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org,
viro@...iv.linux.org.uk,
Lillian Berry <lillian@...r-ark.net>
Subject: [PATCH v2] 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).
Signed-off-by: Lillian Berry <lillian@...r-ark.net>
---
init/main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/init/main.c b/init/main.c
index 225a58279acd..84090c2099ff 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1592,7 +1592,10 @@ 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 = init_eaccess(ramdisk_execute_command);
+ if (ramdisk_command_access != 0) {
+ pr_warn("rdinit=%s is inaccessible or does not exist (errno %i), ignoring\n",
+ ramdisk_execute_command, ramdisk_command_access);
ramdisk_execute_command = NULL;
prepare_namespace();
}
--
2.48.1
Powered by blists - more mailing lists