Blame SOURCES/kexec-tools-2.0.8-ppc64-add-arch-option-dt-no-old-root.patch

e35838
From 83a65e2e13af2041b2816712475e3fec6fdc9e68 Mon Sep 17 00:00:00 2001
e35838
From: "dyoung@redhat.com" <dyoung@redhat.com>
e35838
Date: Wed, 28 Oct 2015 13:41:37 +0800
e35838
Subject: [PATCH 3/3] ppc64: add arch option --dt-no-old-root
e35838
e35838
When createing fdt from /proc/device-tree, if there's local --command-line
e35838
option provided but there's no root= specified, kexec-tools will copy the root=
e35838
param from 1st kernel cmdline by default. In case one want kexec boot without
e35838
root= it will be impossible.
e35838
e35838
Thus add the new option so that one can provide --dt-no-old-root for above
e35838
mentioned case.
e35838
e35838
Reported-by: Jan Stodola <jstodola@redhat.com>
e35838
Signed-off-by: Dave Young <dyoung@redhat.com>
e35838
Signed-off-by: Simon Horman <horms@verge.net.au>
e35838
---
e35838
 kexec/arch/ppc64/include/arch/options.h | 4 +++-
e35838
 kexec/arch/ppc64/kexec-ppc64.c          | 5 +++++
e35838
 2 files changed, 8 insertions(+), 1 deletion(-)
e35838
e35838
diff --git a/kexec/arch/ppc64/include/arch/options.h b/kexec/arch/ppc64/include/arch/options.h
e35838
index 4ad9b75..71632ec 100644
e35838
--- a/kexec/arch/ppc64/include/arch/options.h
e35838
+++ b/kexec/arch/ppc64/include/arch/options.h
e35838
@@ -2,7 +2,8 @@
e35838
 #define KEXEC_ARCH_PPC64_OPTIONS_H
e35838
 
e35838
 #define OPT_ELF64_CORE		(OPT_MAX+0)
e35838
-#define OPT_ARCH_MAX		(OPT_MAX+1)
e35838
+#define OPT_DT_NO_OLD_ROOT	(OPT_MAX+1)
e35838
+#define OPT_ARCH_MAX		(OPT_MAX+2)
e35838
 
e35838
 /* All 'local' loader options: */
e35838
 #define OPT_APPEND		(OPT_ARCH_MAX+0)
e35838
@@ -14,6 +15,7 @@
e35838
 #define KEXEC_ARCH_OPTIONS \
e35838
 	KEXEC_OPTIONS \
e35838
 	{ "elf64-core-headers", 0, 0, OPT_ELF64_CORE }, \
e35838
+	{ "dt-no-old-root",	0, 0, OPT_DT_NO_OLD_ROOT }, \
e35838
 
e35838
 #define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR ""
e35838
 
e35838
diff --git a/kexec/arch/ppc64/kexec-ppc64.c b/kexec/arch/ppc64/kexec-ppc64.c
e35838
index 6e79f52..09ee025 100644
e35838
--- a/kexec/arch/ppc64/kexec-ppc64.c
e35838
+++ b/kexec/arch/ppc64/kexec-ppc64.c
e35838
@@ -869,6 +869,8 @@ int file_types = sizeof(file_type) / sizeof(file_type[0]);
e35838
 void arch_usage(void)
e35838
 {
e35838
 	fprintf(stderr, "     --elf64-core-headers Prepare core headers in ELF64 format\n");
e35838
+	fprintf(stderr, "     --dt-no-old-root Do not reuse old kernel root= param.\n" \
e35838
+	                "                      while creating flatten device tree.\n");
e35838
 }
e35838
 
e35838
 struct arch_options_t arch_options = {
e35838
@@ -895,6 +897,9 @@ int arch_process_options(int argc, char **argv)
e35838
 		case OPT_ELF64_CORE:
e35838
 			arch_options.core_header_type = CORE_TYPE_ELF64;
e35838
 			break;
e35838
+		case OPT_DT_NO_OLD_ROOT:
e35838
+			dt_no_old_root = 1;
e35838
+			break;
e35838
 		}
e35838
 	}
e35838
 	/* Reset getopt for the next pass; called in other source modules */
e35838
-- 
e35838
2.5.0
e35838