[<prev] [next>] [day] [month] [year] [list]
Message-ID: <003601db6fd8$05655e30$10301a90$@lichtman.org>
Date: Sun, 26 Jan 2025 11:52:30 +0200
From: "Nir Lichtman" <nir@...htman.org>
To: <pmladek@...e.com>,
<vbabka@...e.cz>,
<paul@...l-moore.com>,
<rrangel@...omium.org>,
<hyeonggon.yoo@...com>,
<kpsingh@...nel.org>,
<urezki@...il.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] init: remove legacy lilo auto cmdline hack
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=" or "initrd="
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=/myinit"
The LILO logic will clean up the arg1, such that no arguments are passed to
myinit
Solution: Remove this logic from the "init=" and "initrd=" handling logic
Signed-off-by: Nir Lichtman <nir@...htman.org>
---
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,
static int __init init_setup(char *str)
{
- unsigned int i;
-
execute_command = 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=... [MJ]
- */
- for (i = 1; i < MAX_INIT_ARGS; i++)
- argv_init[i] = NULL;
return 1;
}
__setup("init=", init_setup);
static int __init rdinit_setup(char *str)
{
- unsigned int i;
-
ramdisk_execute_command = str;
- /* See "auto" comment in init_setup */
- for (i = 1; i < MAX_INIT_ARGS; i++)
- argv_init[i] = NULL;
return 1;
}
__setup("rdinit=", rdinit_setup);
--
2.39.5
Powered by blists - more mailing lists