* [PATCH] MIPS: Add '--reuse-cmdline' optional parameter support
@ 2021-02-24 5:29 Youling Tang
2021-04-02 9:51 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Youling Tang @ 2021-02-24 5:29 UTC (permalink / raw)
To: Simon Horman; +Cc: tangyouling, kexec
This patch adds an option "--reuse-cmdline" for people that are lazy
in typing --append="$(cat /proc/cmdline)", which will directly use the
command line of the currently running system.
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
kexec/arch/mips/include/arch/options.h | 12 +++++++-----
kexec/arch/mips/kexec-mips.c | 4 ++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/kexec/arch/mips/include/arch/options.h b/kexec/arch/mips/include/arch/options.h
index 416e224..ba2f346 100644
--- a/kexec/arch/mips/include/arch/options.h
+++ b/kexec/arch/mips/include/arch/options.h
@@ -1,10 +1,11 @@
#ifndef KEXEC_ARCH_MIPS_OPTIONS_H
#define KEXEC_ARCH_MIPS_OPTIONS_H
-#define OPT_ARCH_MAX (OPT_MAX+0)
-#define OPT_APPEND (OPT_ARCH_MAX+0)
-#define OPT_DTB (OPT_ARCH_MAX+1)
-#define OPT_RAMDISK (OPT_ARCH_MAX+2)
+#define OPT_ARCH_MAX (OPT_MAX+0)
+#define OPT_APPEND (OPT_ARCH_MAX+0)
+#define OPT_DTB (OPT_ARCH_MAX+1)
+#define OPT_RAMDISK (OPT_ARCH_MAX+2)
+#define OPT_REUSE_CMDLINE (OPT_ARCH_MAX+3)
/* Options relevant to the architecture (excluding loader-specific ones),
* in this case none:
@@ -14,7 +15,8 @@
{"command-line", 1, 0, OPT_APPEND}, \
{"append", 1, 0, OPT_APPEND}, \
{"dtb", 1, 0, OPT_DTB }, \
- {"initrd", 1, 0, OPT_RAMDISK },
+ {"initrd", 1, 0, OPT_RAMDISK }, \
+ { "reuse-cmdline", 0, NULL, OPT_REUSE_CMDLINE },
#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR ""
diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
index 415c2ed..a9c6a09 100644
--- a/kexec/arch/mips/kexec-mips.c
+++ b/kexec/arch/mips/kexec-mips.c
@@ -89,6 +89,7 @@ void arch_usage(void)
" --append=STRING Set the kernel command line to STRING.\n"
" --dtb=FILE Use FILE as the device tree blob.\n"
" --initrd=FILE Use FILE as initial ramdisk.\n"
+ " --reuse-cmdline Use kernel command line from running system.\n"
);
}
@@ -115,6 +116,9 @@ int arch_process_options(int argc, char **argv)
case OPT_APPEND:
arch_options.command_line = optarg;
break;
+ case OPT_REUSE_CMDLINE:
+ arch_options.command_line = get_command_line();
+ break;
case OPT_DTB:
arch_options.dtb_file = optarg;
break;
--
2.1.0
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: Add '--reuse-cmdline' optional parameter support
2021-02-24 5:29 [PATCH] MIPS: Add '--reuse-cmdline' optional parameter support Youling Tang
@ 2021-04-02 9:51 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2021-04-02 9:51 UTC (permalink / raw)
To: Youling Tang; +Cc: kexec
On Wed, Feb 24, 2021 at 01:29:41PM +0800, Youling Tang wrote:
> This patch adds an option "--reuse-cmdline" for people that are lazy
> in typing --append="$(cat /proc/cmdline)", which will directly use the
> command line of the currently running system.
>
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
> kexec/arch/mips/include/arch/options.h | 12 +++++++-----
> kexec/arch/mips/kexec-mips.c | 4 ++++
Thanks, applied.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-02 9:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 5:29 [PATCH] MIPS: Add '--reuse-cmdline' optional parameter support Youling Tang
2021-04-02 9:51 ` Simon Horman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.