Skip to contentSkip to conversation

kexec-tools: Update to 2.0.15

PATCH In review Megha Dey 2 participants 2 messages Sep 15, 2017 – Oct 11, 2017

lore
Share & tools
lore

Megha Dey

author
#0 lore raw

PATCH 1/1 kexec-tools: Update to 2.0.15

Starting with 4.12 kernels, kexec-tools cannot load a crash kernel because ELF core parsing fails with errors like:

Unknown type (Reserved) while parsing /sys/firmware/memmap/5/type. Please report this as bug. Using RANGE_RESERVED now.
...
ELF core (kcore) parse failed
Cannot load <path to>/vmlinuz

The issue is fixed upstream in kexec-tools 2.0.15.

This patch updates to the latest version of the kexec-tools and removes patches which are already merged upstream.

---
 .../kexec-tools/0001-Disable-PIE-during-link.patch |  31 ----
 .../kexec/kexec-tools/0001-arm64-Disable-PIC.patch |  31 ----
 ...nd-the-semantics-of-kexec_iomem_for_each_.patch |  78 --------
 .../0001-vmcore-dmesg-Define-_GNU_SOURCE.patch     |  31 ----
 ...01-x86-x86_64-Fix-format-warning-with-die.patch |  78 --------
 ...eneralize-and-rename-get_kernel_stext_sym.patch | 194 --------------------
 .../0002-ppc-Fix-format-warning-with-die.patch     |  43 -----
 ...0003-arm64-identify-PHYS_OFFSET-correctly.patch |  76 --------
 .../0004-arm64-kdump-identify-memory-regions.patch | 202 ---------------------
 ...5-arm64-kdump-add-elf-core-header-segment.patch | 191 -------------------
 ...6-arm64-kdump-set-up-kernel-image-segment.patch | 137 --------------
 .../0007-arm64-kdump-set-up-other-segments.patch   |  35 ----
 ...-add-DT-properties-to-crash-dump-kernel-s.patch | 150 ---------------
 ...-kdump-Add-support-for-binary-image-files.patch |  52 ------
 meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb    |  52 ------
 meta/recipes-kernel/kexec/kexec-tools_2.0.15.bb    |  38 ++++
 16 files changed, 38 insertions(+), 1381 deletions(-)
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-arm64-Disable-PIC.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-vmcore-dmesg-Define-_GNU_SOURCE.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-x86-x86_64-Fix-format-warning-with-die.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0002-ppc-Fix-format-warning-with-die.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch
 delete mode 100644 meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools_2.0.15.bb
meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch deleted +0 -31
deleted file mode 100644
index 3f2f85e..0000000
@@ -1,31 +0,0 @@
-From ea7be6d71b85880e8e8a2c8a4f49a696c5f31ae4 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 10 Jun 2017 11:18:49 -0700
-Subject: [PATCH] Disable PIE during link
-
-We have explcitly disabled PIE during compile so we
-just need to match it with linker flags
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <[email protected]>
----
- purgatory/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/purgatory/Makefile b/purgatory/Makefile
-index 564bdb7..a08e41f 100644
---- a/purgatory/Makefile
-+++ b/purgatory/Makefile
-@@ -59,7 +59,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
- 			-Iinclude \
- 			-I$(shell $(CC) -print-file-name=include)
- $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
--			-Wl,--no-undefined -nostartfiles -nostdlib \
-+			-Wl,--no-undefined -no-pie -nostartfiles -nostdlib \
- 			-nodefaultlibs -e purgatory_start -Wl,-r \
- 			-Wl,-Map=$(PURGATORY_MAP)
- 
--- 
-2.13.1
-
meta/recipes-kernel/kexec/kexec-tools/0001-arm64-Disable-PIC.patch deleted +0 -31
deleted file mode 100644
index 84e94d7..0000000
@@ -1,31 +0,0 @@
-From 3bb73e5e5649b455e15d5ca3a7ad1a90c4960972 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 10 Jun 2017 11:54:36 -0700
-Subject: [PATCH] arm64: Disable PIC
-
-Fix
-| cc1: sorry, unimplemented: code model 'large' with -fPIC
-| make: *** [Makefile:118: purgatory/arch/arm64/entry.o] Error 1
-
-Signed-off-by: Khem Raj <[email protected]>
----
-Upstream-Status: Pending
-
- purgatory/arch/arm64/Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/purgatory/arch/arm64/Makefile b/purgatory/arch/arm64/Makefile
-index 636abea..80068ca 100644
---- a/purgatory/arch/arm64/Makefile
-+++ b/purgatory/arch/arm64/Makefile
-@@ -1,6 +1,7 @@
- 
- arm64_PURGATORY_EXTRA_CFLAGS = \
- 	-mcmodel=large \
-+	-fno-PIC \
- 	-fno-stack-protector \
- 	-fno-asynchronous-unwind-tables \
- 	-Wundef \
--- 
-2.13.1
-
meta/recipes-kernel/kexec/kexec-tools/0001-kexec-exntend-the-semantics-of-kexec_iomem_for_each_.patch deleted +0 -78

78 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0001-vmcore-dmesg-Define-_GNU_SOURCE.patch deleted +0 -31
deleted file mode 100644
index 90c2f6e..0000000
@@ -1,31 +0,0 @@
-From d811875a41b4628040abaada3da29b7b9592e757 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 9 Jan 2016 17:16:16 -0800
-Subject: [PATCH] vmcore-dmesg: Define _GNU_SOURCE
-
-loff_t is guarded with _GNU_SOURCE on some C library implementations
-e.g. musl since this type is not defined by POSIX. Define _GNU_SOURCE to
-include this define, it should help compiling on musl while nothing
-changes for glibc based systems since there _GNU_SOURCE is already
-defined
-
-Signed-off-by: Khem Raj <[email protected]>
----
-Upstream-Status: Submitted
-
- vmcore-dmesg/vmcore-dmesg.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c
-index 0364636..a8f56df 100644
---- a/vmcore-dmesg/vmcore-dmesg.c
-+++ b/vmcore-dmesg/vmcore-dmesg.c
-@@ -1,4 +1,5 @@
- #define _XOPEN_SOURCE 600
-+#define _GNU_SOURCE
- #define _LARGEFILE_SOURCE 1
- #define _FILE_OFFSET_BITS 64
- #include <endian.h>
--- 
-2.7.0
-
meta/recipes-kernel/kexec/kexec-tools/0001-x86-x86_64-Fix-format-warning-with-die.patch deleted +0 -78

78 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0002-kexec-generalize-and-rename-get_kernel_stext_sym.patch deleted +0 -194

194 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0002-ppc-Fix-format-warning-with-die.patch deleted +0 -43

43 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0003-arm64-identify-PHYS_OFFSET-correctly.patch deleted +0 -76

76 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0004-arm64-kdump-identify-memory-regions.patch deleted +0 -202

202 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0005-arm64-kdump-add-elf-core-header-segment.patch deleted +0 -191

191 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0006-arm64-kdump-set-up-kernel-image-segment.patch deleted +0 -137

137 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0007-arm64-kdump-set-up-other-segments.patch deleted +0 -35
deleted file mode 100644
index 2745466..0000000
@@ -1,35 +0,0 @@
-From 07ad14e12665221d754fde8e47c32ac18c24586a Mon Sep 17 00:00:00 2001
-From: AKASHI Takahiro <[email protected]>
-Date: Fri, 31 Jul 2015 20:01:39 +0900
-Subject: [PATCH 7/9] arm64: kdump: set up other segments
-
-We make sure that all the other segments, initrd and device-tree blob,
-also be loaded into the reserved memory of crash dump kernel.
-
-Upstream-Status: Backport [https://git.linaro.org/people/takahiro.akashi/kexec-tools.git]
-
-Signed-off-by: AKASHI Takahiro <[email protected]>
-Signed-off-by: He Zhe <[email protected]>
----
- kexec/arch/arm64/kexec-arm64.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
-index cec4e41..78a0035 100644
---- a/kexec/arch/arm64/kexec-arm64.c
-+++ b/kexec/arch/arm64/kexec-arm64.c
-@@ -374,7 +374,10 @@ int arm64_load_other_segments(struct kexec_info *info,
- 	/* Put the other segments after the image. */
- 
- 	hole_min = image_base + arm64_mem.image_size;
--	hole_max = ULONG_MAX;
-+	if (info->kexec_flags & KEXEC_ON_CRASH)
-+		hole_max = crash_reserved_mem.end;
-+	else
-+		hole_max = ULONG_MAX;
- 
- 	if (arm64_opts.initrd) {
- 		initrd_buf = slurp_file(arm64_opts.initrd, &initrd_size);
--- 
-1.9.1
-
meta/recipes-kernel/kexec/kexec-tools/0008-arm64-kdump-add-DT-properties-to-crash-dump-kernel-s.patch deleted +0 -150

150 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools/0009-arm64-kdump-Add-support-for-binary-image-files.patch deleted +0 -52

52 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb deleted +0 -52

52 lines not on this page · raw message

meta/recipes-kernel/kexec/kexec-tools_2.0.15.bb new file +38 -0
new file mode 100644
index 0000000..e687e81
@@ -0,0 +1,38 @@
+require kexec-tools.inc
+export LDFLAGS = "-L${STAGING_LIBDIR}"
+EXTRA_OECONF = " --with-zlib=yes"
+
+SRC_URI += "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
+            file://0002-powerpc-change-the-memory-size-limit.patch \
+            file://0001-purgatory-Pass-r-directly-to-linker.patch \
+            file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
+            file://kexec-x32.patch \
+         "
+
+SRC_URI[md5sum] = "78906fdc255656fa2b9996c8acb3ef62"
+SRC_URI[sha256sum] = "42dbd0dab9964cd1ed89fa4571c8d13191eb7132b361ade5ac44517c91ecb97e"
+
+SECURITY_PIE_CFLAGS_remove = "-fPIE -pie"
+
+PACKAGES =+ "kexec kdump vmcore-dmesg"
+
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
+
+FILES_kexec = "${sbindir}/kexec"
+FILES_kdump = "${sbindir}/kdump ${sysconfdir}/init.d/kdump \
+               ${sysconfdir}/sysconfig/kdump.conf"
+FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
+
+inherit update-rc.d
+
+INITSCRIPT_PACKAGES = "kdump"
+INITSCRIPT_NAME_kdump = "kdump"
+INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
+
+do_install_append () {
+        install -d ${D}${sysconfdir}/init.d
+        install -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
+        install -d ${D}${sysconfdir}/sysconfig
+        install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
+}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 33 lines · Megha Dey

This patch updates to the latest version of the kexec-tools and removes patches which are already merged upstream.

meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch deleted +0 -20
-From ea7be6d71b85880e8e8a2c8a4f49a696c5f31ae4 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 10 Jun 2017 11:18:49 -0700
-Subject: [PATCH] Disable PIE during link
-
-We have explcitly disabled PIE during compile so we
-just need to match it with linker flags
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <[email protected]>
----
- purgatory/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/purgatory/Makefile b/purgatory/Makefile
-index 564bdb7..a08e41f 100644
---- a/purgatory/Makefile
-+++ b/purgatory/Makefile
-@@ -59,7 +59,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)

\

meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch deleted +0 -5
-                       -Iinclude \
-                       -I$(shell $(CC) -print-file-name=include)
- $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
--                      -Wl,--no-undefined -nostartfiles -nostdlib \
-+                      -Wl,--no-undefined -no-pie -nostartfiles -nostdlib

\

meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch line 27

Quoted 2 lines
meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch deleted +0 -2
-                       -nodefaultlibs -e purgatory_start -Wl,-r \
-                       -Wl,-Map=$(PURGATORY_MAP)

Was this actually merged upstream, or it caused a conflict?

I ask because I can't build this:

| i586-poky-linux-ar rs libutil.a util_lib/compute_ip_checksum.o
util_lib/sha256.o
| i586-poky-linux-ar: creating libutil.a
| /data/poky-tmp/master/build/work/i586-poky-linux/kexec-tools/2.0.15-r1/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/7.2.0/ld:
-r and -pie may not be used together
| collect2: error: ld returned 1 exit status
| ../kexec-tools-2.0.15/purgatory/Makefile:67: recipe for target 'purgatory/
purgatory.ro' failed

Ross