Re: [PATCH v3] init/main.c: add warning when file specified in rdinit is inaccessible

From: Ahmad Fatoum
Date: Wed Oct 08 2025 - 01:41:30 EST


Hello Lillian,

On 08.10.25 05:30, Lillian Berry wrote:
> Hi,
>
> On Tue, Oct 7, 2025, at 10:57 AM, Ahmad Fatoum wrote:
>> 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?
>
> This isn't directly unintended. This message informs the user their
> specified rdinit= binary was not able to run, regardless of the reason.
>
> It would be good to check presence of initrd and print a more specific
> message such as "rdinit=/init specified but no initrd present".

I didn't explicitly set rdinit=/init on my kernel command line though:

loglevel=7 root=/dev/mmcblk1p1 rootwait=10 rootfstype=ext4

So ramdisk_execute_command had the default value it was initialized with.

Maybe rdinit_setup should set a flag or something to discern the default
case?

Tanks,
Ahmad



>
> Kindly,
> Lillian
>


--
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 |