[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250706153239.3be93aee4b0c8d43e025bd85@linux-foundation.org>
Date: Sun, 6 Jul 2025 15:32:39 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Lillian Berry <lillian@...r-ark.net>
Cc: linux-kernel@...r.kernel.org, viro@...iv.linux.org.uk
Subject: Re: [PATCH v2] init/main.c: add warning when file specified in
rdinit is inaccessible
On Sun, 6 Jul 2025 20:57:38 +0000 Lillian Berry <lillian@...r-ark.net> 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).
>
> ...
>
> --- 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);
hm, the C99-style definition is acceptable nowadays, but is rarely used.
> + 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);
Again, I don't think we should assume (or say) "inaccessible or does not
exist". After all, init_eaccess() could have returned -ENOMEM.
Something like "access(%s) failed: %d", maybe.
Powered by blists - more mailing lists