Backport the following commit from kexec-tools upstream:
commit 45b33eb
Author: Laurent Dufour <ldufour(a)linux.vnet.ibm.com>
Date: Fri Jul 25 17:07:49 2014 +0200
ppc64/kdump: Fix ELF header endianess
The ELF header created among the loading of the kdump kernel should be
flagged using the current endianess and not always as big endian.
Without this patch the data exposed in /proc/vmcore are not readable when
running in LE mode.
Signed-off-by: Laurent Dufour <ldufour(a)linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
This is part of the work to enable ppc64le.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
....0.7-ppc64-kdump-Fix-ELF-header-endianess.patch | 36 ++++++++++++++++++++++
kexec-tools.spec | 2 ++
2 files changed, 38 insertions(+)
create mode 100644 kexec-tools-2.0.7-ppc64-kdump-Fix-ELF-header-endianess.patch
diff --git a/kexec-tools-2.0.7-ppc64-kdump-Fix-ELF-header-endianess.patch
b/kexec-tools-2.0.7-ppc64-kdump-Fix-ELF-header-endianess.patch
new file mode 100644
index 0000000..eb6bbd7
--- /dev/null
+++ b/kexec-tools-2.0.7-ppc64-kdump-Fix-ELF-header-endianess.patch
@@ -0,0 +1,36 @@
+From 45b33eb2e70cd44f41abf1058a92659cb4315011 Mon Sep 17 00:00:00 2001
+From: Laurent Dufour <ldufour(a)linux.vnet.ibm.com>
+Date: Fri, 25 Jul 2014 17:07:49 +0200
+Subject: [PATCH] ppc64/kdump: Fix ELF header endianess
+
+The ELF header created among the loading of the kdump kernel should be
+flagged using the current endianess and not always as big endian.
+
+Without this patch the data exposed in /proc/vmcore are not readable when
+running in LE mode.
+
+Signed-off-by: Laurent Dufour <ldufour(a)linux.vnet.ibm.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ kexec/arch/ppc64/crashdump-ppc64.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
+index 00a0e63..6214b83 100644
+--- a/kexec/arch/ppc64/crashdump-ppc64.c
++++ b/kexec/arch/ppc64/crashdump-ppc64.c
+@@ -38,7 +38,11 @@
+ static struct crash_elf_info elf_info64 =
+ {
+ class: ELFCLASS64,
++#if BYTE_ORDER == LITTLE_ENDIAN
++ data: ELFDATA2LSB,
++#else
+ data: ELFDATA2MSB,
++#endif
+ machine: EM_PPC64,
+ page_offset: PAGE_OFFSET,
+ lowmem_limit: MAXMEM,
+--
+1.9.3
+
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 3339043..af0c69b 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -69,6 +69,7 @@ Patch101:
kexec-tools-2.0.7-Provide-an-option-to-use-new-kexec-system-call.patch
#
Patch301: kexec-tools-2.0.7-kexec-ppc64-move-to-device-tree-version-17.patch
Patch302: kexec-tools-2.0.7-kexec-ppc64-disabling-exception-handling-when-buildi.patch
+Patch303: kexec-tools-2.0.7-ppc64-kdump-Fix-ELF-header-endianess.patch
#
# Patches 401 through 500 are meant for s390 kexec-tools enablement
@@ -132,6 +133,7 @@ tar -z -x -v -f %{SOURCE23}
%patch607 -p1
%patch301 -p1
%patch302 -p1
+%patch303 -p1
%ifarch ppc
%define archdef ARCH=ppc
--
1.9.3