[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <254c82d5-81d9-4e23-9ed8-29cfc3f3c008@pengutronix.de>
Date: Tue, 7 Oct 2025 16:57:48 +0200
From: Ahmad Fatoum <a.fatoum@...gutronix.de>
To: Lillian Berry <lillian@...r-ark.net>, linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, viro@...iv.linux.org.uk,
Leonard Goehrs <lgo@...gutronix.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: Re: [PATCH v3] init/main.c: add warning when file specified in rdinit
is inaccessible
Hello Lillian,
On 7/7/25 11:14 AM, Lillian Berry wrote:
> 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).
I have a system that works just fine without an initramfs, but now the
kernel warns me about it:
[ 2.805602] check access for rdinit=/init failed: -2, ignoring
I suppose that's unintended and the code here should actually check that
there is an initrd at all before checking for the rdinit?
Thanks,
Ahmad
>
> Signed-off-by: Lillian Berry <lillian@...r-ark.net>
> ---
> init/main.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> 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();
> }
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists