|
|
a6d77e |
From 0730d377b6a6f6cdac25f26016a95db8a9333802 Mon Sep 17 00:00:00 2001
|
|
|
a6d77e |
Message-Id: <0730d377b6a6f6cdac25f26016a95db8a9333802.1431592766.git.panand@redhat.com>
|
|
|
a6d77e |
In-Reply-To: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
|
|
|
a6d77e |
References: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
|
|
|
a6d77e |
From: Pratyush Anand <panand@redhat.com>
|
|
|
a6d77e |
Date: Fri, 17 Apr 2015 10:54:55 -0700
|
|
|
a6d77e |
Subject: [PATCH 03/17] arm64: Add support for --reuse-cmdline option
|
|
|
a6d77e |
|
|
|
a6d77e |
Signed-off-by: Pratyush Anand <panand@redhat.com>
|
|
|
a6d77e |
Signed-off-by: Geoff Levand <geoff@infradead.org>
|
|
|
a6d77e |
---
|
|
|
a6d77e |
kexec/arch/arm64/include/arch/options.h | 7 +++++--
|
|
|
a6d77e |
kexec/arch/arm64/kexec-arm64.c | 8 +++++++-
|
|
|
a6d77e |
2 files changed, 12 insertions(+), 3 deletions(-)
|
|
|
a6d77e |
|
|
|
a6d77e |
diff --git a/kexec/arch/arm64/include/arch/options.h b/kexec/arch/arm64/include/arch/options.h
|
|
|
a6d77e |
index 51afc5f1f6f2..903b4a1fbd7f 100644
|
|
|
a6d77e |
--- a/kexec/arch/arm64/include/arch/options.h
|
|
|
a6d77e |
+++ b/kexec/arch/arm64/include/arch/options.h
|
|
|
a6d77e |
@@ -6,7 +6,8 @@
|
|
|
a6d77e |
#define OPT_INITRD ((OPT_MAX)+2)
|
|
|
a6d77e |
#define OPT_LITE ((OPT_MAX)+3)
|
|
|
a6d77e |
#define OPT_PORT ((OPT_MAX)+4)
|
|
|
a6d77e |
-#define OPT_ARCH_MAX ((OPT_MAX)+5)
|
|
|
a6d77e |
+#define OPT_REUSE_CMDLINE ((OPT_MAX+5))
|
|
|
a6d77e |
+#define OPT_ARCH_MAX ((OPT_MAX)+6)
|
|
|
a6d77e |
|
|
|
a6d77e |
#define KEXEC_ARCH_OPTIONS \
|
|
|
a6d77e |
KEXEC_OPTIONS \
|
|
|
a6d77e |
@@ -17,6 +18,7 @@
|
|
|
a6d77e |
{ "lite", 0, NULL, OPT_LITE }, \
|
|
|
a6d77e |
{ "port", 1, NULL, OPT_PORT }, \
|
|
|
a6d77e |
{ "ramdisk", 1, NULL, OPT_INITRD }, \
|
|
|
a6d77e |
+ { "reuse-cmdline", 0, NULL, OPT_REUSE_CMDLINE }, \
|
|
|
a6d77e |
|
|
|
a6d77e |
#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR /* Only accept long arch options. */
|
|
|
a6d77e |
#define KEXEC_ALL_OPTIONS KEXEC_ARCH_OPTIONS
|
|
|
a6d77e |
@@ -29,7 +31,8 @@ static const char arm64_opts_usage[] __attribute__ ((unused)) =
|
|
|
a6d77e |
" --initrd=FILE Use FILE as the kernel initial ramdisk.\n"
|
|
|
a6d77e |
" --lite Fast reboot, no memory integrity checks - currently NOT SUPPORTED.\n");
|
|
|
a6d77e |
" --port=ADDRESS Purgatory output to port ADDRESS.\n"
|
|
|
a6d77e |
-" --ramdisk=FILE Use FILE as the kernel initial ramdisk.\n";
|
|
|
a6d77e |
+" --ramdisk=FILE Use FILE as the kernel initial ramdisk.\n"
|
|
|
a6d77e |
+" --reuse-cmdline Use command line arg of primary kernel.\n";
|
|
|
a6d77e |
|
|
|
a6d77e |
struct arm64_opts {
|
|
|
a6d77e |
const char *command_line;
|
|
|
a6d77e |
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
|
|
|
a6d77e |
index 0860810b6e86..22d70244f8db 100644
|
|
|
a6d77e |
--- a/kexec/arch/arm64/kexec-arm64.c
|
|
|
a6d77e |
+++ b/kexec/arch/arm64/kexec-arm64.c
|
|
|
a6d77e |
@@ -75,13 +75,18 @@ int arch_process_options(int argc, char **argv)
|
|
|
a6d77e |
{ 0 }
|
|
|
a6d77e |
};
|
|
|
a6d77e |
int opt;
|
|
|
a6d77e |
+ const char *append = NULL;
|
|
|
a6d77e |
+ char *tmp_cmdline = NULL;
|
|
|
a6d77e |
|
|
|
a6d77e |
for (opt = 0; opt != -1; ) {
|
|
|
a6d77e |
opt = getopt_long(argc, argv, short_options, options, 0);
|
|
|
a6d77e |
|
|
|
a6d77e |
switch (opt) {
|
|
|
a6d77e |
case OPT_APPEND:
|
|
|
a6d77e |
- arm64_opts.command_line = optarg;
|
|
|
a6d77e |
+ append = optarg;
|
|
|
a6d77e |
+ break;
|
|
|
a6d77e |
+ case OPT_REUSE_CMDLINE:
|
|
|
a6d77e |
+ tmp_cmdline = get_command_line();
|
|
|
a6d77e |
break;
|
|
|
a6d77e |
case OPT_DTB:
|
|
|
a6d77e |
arm64_opts.dtb = optarg;
|
|
|
a6d77e |
@@ -101,6 +106,7 @@ int arch_process_options(int argc, char **argv)
|
|
|
a6d77e |
}
|
|
|
a6d77e |
}
|
|
|
a6d77e |
|
|
|
a6d77e |
+ arm64_opts.command_line = concat_cmdline(tmp_cmdline, append);
|
|
|
a6d77e |
kexec_debug = 1; // FIXME: for debugging only.
|
|
|
a6d77e |
|
|
|
a6d77e |
dbgprintf("%s:%d: command_line: %s\n", __func__, __LINE__,
|
|
|
a6d77e |
--
|
|
|
a6d77e |
2.1.0
|
|
|
a6d77e |
|