Blob Blame History Raw
From dd86e7cedfc0509df5dd7f824611d59cf7e9f007 Mon Sep 17 00:00:00 2001
Message-Id: <dd86e7cedfc0509df5dd7f824611d59cf7e9f007.1431592766.git.panand@redhat.com>
In-Reply-To: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
References: <1fb6841aa15407dbf371589d7abca7bc2d35815c.1431592766.git.panand@redhat.com>
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
Date: Tue, 24 Feb 2015 16:46:35 +0900
Subject: [PATCH 09/17] arm64: kdump: append kdump-specific parameter to
 command line

---
 kexec/arch/arm64/kexec-arm64.c     | 9 +++++++--
 kexec/arch/arm64/kexec-arm64.h     | 2 +-
 kexec/arch/arm64/kexec-elf-arm64.c | 3 ++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index e83e83bdd6db..173631c66951 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -586,7 +586,7 @@ static uint64_t read_sink(const char *command_line)
  */
 
 int arm64_load_other_segments(struct kexec_info *info,
-	unsigned long kernel_entry)
+	unsigned long kernel_entry, char *option)
 {
 	int result;
 	struct mem_ehdr ehdr;
@@ -599,14 +599,19 @@ int arm64_load_other_segments(struct kexec_info *info,
 	struct dtb dtb_2 = {.name = "dtb_2"};
 	char command_line[COMMAND_LINE_SIZE] = "";
 
+	dbgprintf("%s:%d: add '%s' to command line\n", __func__, __LINE__,
+		option);
+
 	if (arm64_opts.command_line) {
 		strncpy(command_line, arm64_opts.command_line,
 			sizeof(command_line));
 		command_line[sizeof(command_line) - 1] = 0;
 	}
 
-	purgatory_sink = read_sink(command_line);
+	if (option && option[0])
+		strcat(command_line, option);
 
+	purgatory_sink = read_sink(command_line);
 	dbgprintf("%s:%d: purgatory sink: 0x%" PRIx64 "\n", __func__, __LINE__,
 		purgatory_sink);
 
diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
index 7f0ca13fec11..7e4d0568bd01 100644
--- a/kexec/arch/arm64/kexec-arm64.h
+++ b/kexec/arch/arm64/kexec-arm64.h
@@ -48,6 +48,6 @@ extern struct arm64_mem arm64_mem;
 
 int arm64_process_image_header(const struct arm64_image_header *h);
 int arm64_load_other_segments(struct kexec_info *info,
-	unsigned long kernel_entry);
+	unsigned long kernel_entry, char *option);
 
 #endif
diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
index 903602985eb4..f5ecda825278 100644
--- a/kexec/arch/arm64/kexec-elf-arm64.c
+++ b/kexec/arch/arm64/kexec-elf-arm64.c
@@ -123,7 +123,8 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
 	dbgprintf("%s: e_entry:     %016llx -> %016lx\n", __func__,
 		ehdr.e_entry, virt_to_phys(ehdr.e_entry));
 
-	result = arm64_load_other_segments(info, (unsigned long)info->entry);
+	result = arm64_load_other_segments(info, (unsigned long)info->entry,
+		header_option);
 exit:
 	free_elf_info(&ehdr);
 	if (header_option)
-- 
2.1.0