From nobody Sun Feb 8 17:04:25 2026 Received: from mail-05.mail-europe.com (mail-05.mail-europe.com [85.9.206.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B9073AA1A8 for ; Wed, 14 Jan 2026 22:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.9.206.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768428173; cv=none; b=A1BwVBTlGDEElAAcJizq1MPf8yQBHEJfabP/w0TEVcI4O1YLkFU6lDvlujwe9f/JdBFY317DP0XnopMK3kyowYdcMY6x8AjkD6vkFBY8/OXyuX7ezvxUCDGO8UbCC51sNKit9gu0uU6vEuxHkPsDy0+olLmwnvpRIbYncvRW/lw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768428173; c=relaxed/simple; bh=4e6yc9wBWuLU/0yxkBqjW2zWyMXEoTfEHG8H7j9YffM=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=HHk4J2NeuMsXTwiWti5Qpbag+tZNI3T2tgM4Et8dTxeQH2UlfQFuof6N3pd0Yr+qFoapHVhvABW2vVTz2NLiVCsDcExe6P9jafo39R0ET7AagQ4RimXg0cz4iQytAKwr1Sqcq7r659CDdS92OcD0Y5svTy7aucUxUVGxVgkl/SA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=QGNvcIQm; arc=none smtp.client-ip=85.9.206.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="QGNvcIQm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1768428151; x=1768687351; bh=Rv07lKQqH364S+BgKQmYatge6B8D6YBm9Q/oyDlhCrE=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=QGNvcIQmQtmrCeTAMkTwtMuPTPqsCJk3HOC/Jci7GMccqm81KlXeT6E2W4C19r8oA NIukEhHvr2l/eoWBxjpRBoYbdVBLsrf7I6kRJcgdyZZ62ehlAe0rIyk9WY3E2lgbKP +TR1tVBu/V7sTNWf2hMbym1O+FKN8wiV/MdyANASJt/VljNbyMvMJDersU9ziWSzQv 0jROEG+ZU0r+AnighhbbkQaYOtXMGnnt+V2gO/VMdgfZG4lz4hVwhnSp7FxhHFWZr5 aTLolwE4lFZR7ENv8XjgdMtyAhBPTkTyjnZYcBcyO0XNrG+xhTe1Q50acACdeUNj5x hXiaSlgBNBThQ== Date: Wed, 14 Jan 2026 22:02:27 +0000 To: Andrew Morton , Huacai Chen From: Harry Austen Cc: linux-kernel@vger.kernel.org, Lillian Berry , Harry Austen Subject: [PATCH] init/main.c: prevent warning on lack of default implicit rdinit Message-ID: <20260114220139.4685-1-hpausten@protonmail.com> Feedback-ID: 53116287:user:proton X-Pm-Message-ID: 0a99ff5130510c90b7ad0650b956abf3bacd0722 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If rdinit was not explicitly provided on cmdline, and default /init does not exist, no warning should be printed. Fixes: 98aa4d5d242d ("init/main.c: add warning when file specified in rdini= t is inaccessible") Signed-off-by: Harry Austen --- init/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init/main.c b/init/main.c index b84818ad9685f..fcf99d1adbe02 100644 --- a/init/main.c +++ b/init/main.c @@ -162,6 +162,7 @@ static size_t initargs_offs; =20 static char *execute_command; static char *ramdisk_execute_command =3D "/init"; +static bool __initdata ramdisk_execute_command_provided =3D false; =20 /* * Used to generate warnings if static_key manipulation functions are used @@ -623,6 +624,7 @@ static int __init rdinit_setup(char *str) unsigned int i; =20 ramdisk_execute_command =3D str; + ramdisk_execute_command_provided =3D true; /* See "auto" comment in init_setup */ for (i =3D 1; i < MAX_INIT_ARGS; i++) argv_init[i] =3D NULL; @@ -1699,8 +1701,9 @@ static noinline void __init kernel_init_freeable(void) int ramdisk_command_access; ramdisk_command_access =3D init_eaccess(ramdisk_execute_command); if (ramdisk_command_access !=3D 0) { - pr_warn("check access for rdinit=3D%s failed: %i, ignoring\n", - ramdisk_execute_command, ramdisk_command_access); + if (ramdisk_execute_command_provided || ramdisk_command_access !=3D -ENO= ENT) + pr_warn("check access for rdinit=3D%s failed: %i, ignoring\n", + ramdisk_execute_command, ramdisk_command_access); ramdisk_execute_command =3D NULL; prepare_namespace(); } --=20 2.52.0