Skip to content

Commit 98aa4d5

Browse files
Lillian Berryakpm00
authored andcommitted
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>
1 parent 4efec6c commit 98aa4d5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

init/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,11 @@ static noinline void __init kernel_init_freeable(void)
15921592
* check if there is an early userspace init. If yes, let it do all
15931593
* the work
15941594
*/
1595-
if (init_eaccess(ramdisk_execute_command) != 0) {
1595+
int ramdisk_command_access;
1596+
ramdisk_command_access = init_eaccess(ramdisk_execute_command);
1597+
if (ramdisk_command_access != 0) {
1598+
pr_warn("check access for rdinit=%s failed: %i, ignoring\n",
1599+
ramdisk_execute_command, ramdisk_command_access);
15961600
ramdisk_execute_command = NULL;
15971601
prepare_namespace();
15981602
}

0 commit comments

Comments
 (0)