From nobody Tue Feb 10 19:00:38 2026 Received: from lichtman.org (lichtman.org [149.28.33.109]) (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 1232A25A62C for ; Sun, 26 Jan 2025 09:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=149.28.33.109 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737885575; cv=none; b=dhhgqY8dorVLJWxgrEWY00g76phIHlXNQ/C0uVJXOjqWARXZrPboMVywR2iUSoV/EHuAuH9dxwx726GVc9L41NBCVsKwXdJofE5aLlhBr/EUqGq9RzjJWIQeFdvVWYh0PjUcNwIUGm+pyDWYjub6HN9ycwBcXbO7OtALMQs2gpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737885575; c=relaxed/simple; bh=WYZ0CIlziitol8k/PUQmIDeBVSWKuBtAzo+CmGVIW84=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=k1xB5cTQCTtc3mcMZmdfqZtxE8jmmBix43M1dU8cvfjRcg+YVvTOoMCGF1Z4NkYC1szRK+TAIQn5I/jN/xBRrBQVqE4fzsI3+eFotQsIIJP5d/EVp5NP9cqZJZaH2j7Id8HbbrlUaKPWY29CXpVi5eHNYU1+V6+f80MZeFG5IDY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lichtman.org; spf=pass smtp.mailfrom=lichtman.org; dkim=pass (2048-bit key) header.d=lichtman.org header.i=@lichtman.org header.b=kAg+YNU5; arc=none smtp.client-ip=149.28.33.109 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lichtman.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lichtman.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lichtman.org header.i=@lichtman.org header.b="kAg+YNU5" Received: from nirslaptop (unknown [85.130.135.138]) by lichtman.org (Postfix) with ESMTPSA id CB7A41771BE; Sun, 26 Jan 2025 09:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lichtman.org; s=mail; t=1737885154; bh=WYZ0CIlziitol8k/PUQmIDeBVSWKuBtAzo+CmGVIW84=; h=From:To:Subject:Date:From; b=kAg+YNU5ZUp+uLvE3b5SEJ0RtN4HowZatuLA0GEvkzMxO/hjn4CvgpeaP7OBK9C4t Ek/9HYM9LDXUaQazsjvCib44p4ZOrYHTblhS1TBMd1t288BYriGtQQ7Y6Y/F7fVY0E pzc21BMg5bmFK9FwrgaWUEXgnADMsKRBBScutivsen/BLDarifPPrKn1W+Gwza1poo qBtDsGAAW1C0GblB7AKei2piAGkk6/v3X3Sqk5R3K8PbPZSDaDTfHCTDn4wdtEwHHn rWKxlhn2o+ELlmN78SC1PEe9hbwzJ1NfTQhlpk3fqtRG1/fuelyqm1FxAkztqOj0kH w05UgzJDRyMJQ== From: "Nir Lichtman" To: , , , , , , , Subject: [PATCH] init: remove legacy lilo auto cmdline hack Date: Sun, 26 Jan 2025 11:52:30 +0200 Message-ID: <003601db6fd8$05655e30$10301a90$@lichtman.org> 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 X-Mailer: Microsoft Outlook 16.0 Thread-Index: Adtv1tsHtAXTtCDYSVSueO+/DzyO5Q== Content-Language: en-us Content-Type: text/plain; charset="utf-8" Problem: The code handling the "init" and "initrd" command line options has a LILO specific hack which cleans up arguments that are meant to be passed to init. As the comment claims, LILO indeed passes "auto" to the init to signify that the boot was automatic without user manual intervention, but I think this logic is weird and unexpected since it just cleans up everything that came before the "init=3D" or "initrd=3D" which could be confusing for the end users expecting the unknown params to be passed on to the init process, but they just get swallowed because of this. On top of that, LILO is pretty much an abandoned project, so I don't think there is much value of having this handling code in the kernel. Example: This behavior can be demonstrated by running qemu-system-x86_64 -kernel arch/x86/boot/bzImage -append "arg1 init=3D/myin= it" The LILO logic will clean up the arg1, such that no arguments are passed to myinit Solution: Remove this logic from the "init=3D" and "initrd=3D" handling log= ic Signed-off-by: Nir Lichtman --- init/main.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/init/main.c b/init/main.c index 893cb77aef22..864b60a07b90 100644 --- a/init/main.c +++ b/init/main.c @@ -589,29 +589,14 @@ static int __init unknown_bootoption(char *param, char *val, =20 static int __init init_setup(char *str) { - unsigned int i; - execute_command =3D str; - /* - * In case LILO is going to boot us with default command line, - * it prepends "auto" before the whole cmdline which makes - * the shell think it should execute a script with such name. - * So we ignore all arguments entered _before_ init=3D... [MJ] - */ - for (i =3D 1; i < MAX_INIT_ARGS; i++) - argv_init[i] =3D NULL; return 1; } __setup("init=3D", init_setup); =20 static int __init rdinit_setup(char *str) { - unsigned int i; - ramdisk_execute_command =3D str; - /* See "auto" comment in init_setup */ - for (i =3D 1; i < MAX_INIT_ARGS; i++) - argv_init[i] =3D NULL; return 1; } __setup("rdinit=3D", rdinit_setup); --=20 2.39.5