[PATCH v2 10/10] LoongArch: Remove 'kexec_file' cmdline parameters when using --reuse-cmdline option

Youling Tang youling.tang at linux.dev
Mon Sep 15 18:46:55 PDT 2025


From: Youling Tang <tangyouling at kylinos.cn>

On the LoongArch architecture, when loading the kernel via kexec_file,
the 'kexec_file'prefix is automatically appended to the command line.
Consequently, if the '--reuse-cmdline' option is used to inherit the
current command line, this prefix must be detected and removed.

Signed-off-by: Youling Tang <tangyouling at kylinos.cn>
---
 kexec/arch/loongarch/kexec-loongarch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kexec/arch/loongarch/kexec-loongarch.c b/kexec/arch/loongarch/kexec-loongarch.c
index eb60ef0..240202f 100644
--- a/kexec/arch/loongarch/kexec-loongarch.c
+++ b/kexec/arch/loongarch/kexec-loongarch.c
@@ -260,6 +260,7 @@ int arch_process_options(int argc, char **argv)
 		case OPT_REUSE_CMDLINE:
 			cmdline = get_command_line();
 			remove_parameter(cmdline, "kexec");
+			remove_parameter(cmdline, "kexec_file");
 			remove_parameter(cmdline, "initrd");
 			break;
 		case OPT_INITRD:
-- 
2.34.1




More information about the kexec mailing list