From 2fdb6eb87e7a94ec4794d50059b69e945daaa707 Mon Sep 17 00:00:00 2001 From: Fathi Boudra Date: Thu, 18 Nov 2021 14:07:19 +0100 Subject: makedumpfile: upgrade from 1.6.9 to 1.7.0 * Drop 0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch This patch has been introduced in January 2017 for makedumpfile 1.6.1. It has never reached upstream, hence the pending status is inappropriate. Since that time, the upstream code to retrieve MAX_PHYSMEM_BITS has been updated to use vmcoreinfo, with a backward compatibility for older kernels. * Remove the deprecated comment about arm/aarch64 would compile but has never been tested upstream, introduced in July 2016. Nowadays, it works just fine on those architectures. * Add PACKAGECONFIG option for zstd compression Since 1.7.0 release, Zstandard (zstd) compression support has been added. With zstd, the vmcore size and time consumption can have a better balance than zlib/lzo/snappy. http://lists.infradead.org/pipermail/kexec/2021-September/023011.html Signed-off-by: Fathi Boudra Signed-off-by: Khem Raj --- ...0001-makedumpfile-replace-hardcode-CFLAGS.patch | 21 +++-- ...-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch | 90 ---------------------- .../makedumpfile/makedumpfile_1.6.9.bb | 64 --------------- .../makedumpfile/makedumpfile_1.7.0.bb | 63 +++++++++++++++ 4 files changed, 78 insertions(+), 160 deletions(-) delete mode 100644 meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch delete mode 100644 meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.9.bb create mode 100644 meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.7.0.bb diff --git a/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch b/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch index 2b108ab6c..1dd87c8b1 100644 --- a/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch +++ b/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch @@ -13,9 +13,12 @@ Subject: [PATCH] makedumpfile: replace hardcode CFLAGS Upstream-Status: Inappropriate[oe specific] Signed-off-by: Mingli Yu + +[2021-11-18] Patch updated to use CFLAGS_COMMON for zstd +Signed-off-by: Fathi Boudra --- - Makefile | 45 +++++++++++++++++++++++---------------------- - 1 file changed, 23 insertions(+), 22 deletions(-) + Makefile | 47 ++++++++++++++++++++++++----------------------- + 1 file changed, 24 insertions(+), 23 deletions(-) --- a/Makefile +++ b/Makefile @@ -94,7 +97,7 @@ Signed-off-by: Mingli Yu endif ifeq ($(USESNAPPY), on) -@@ -65,7 +66,7 @@ LIBS := -lsnappy $(LIBS) +@@ -65,12 +66,12 @@ LIBS := -lsnappy $(LIBS) ifneq ($(LINKTYPE), dynamic) LIBS := $(LIBS) -lstdc++ endif @@ -102,8 +105,14 @@ Signed-off-by: Mingli Yu +CFLAGS_COMMON += -DUSESNAPPY endif - LIBS := $(LIBS) -lpthread -@@ -90,14 +91,14 @@ LIBS := $(LIBS) $(call try-run,\ + ifeq ($(USEZSTD), on) + LIBS := -lzstd $(LIBS) +-CFLAGS += -DUSEZSTD ++CFLAGS_COMMON += -DUSEZSTD + endif + + ifeq ($(DEBUG), on) +@@ -104,14 +105,14 @@ LIBS := $(LIBS) $(call try-run,\ all: makedumpfile $(OBJ_PART): $(SRC_PART) @@ -120,7 +129,7 @@ Signed-off-by: Mingli Yu echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8 grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8 mv temp.8 makedumpfile.8 -@@ -108,7 +109,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $( +@@ -122,7 +123,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $( gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz eppic_makedumpfile.so: extension_eppic.c diff --git a/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch b/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch deleted file mode 100644 index f46fb3117..000000000 --- a/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 9045b72bdb703bf58a6586d77461eea8f59f50f7 Mon Sep 17 00:00:00 2001 -From: Alexandru Moise -Date: Fri, 29 Apr 2016 07:40:46 +0000 -Subject: [PATCH] mem_section: Support only 46 bit for MAX_PHYSMEM_BITS on - PPC64 - -Related to change: -http://lists.infradead.org/pipermail/kexec/2013-January/007849.html - -Linux on PPC64 has supported only 46 bit MAX_PHYSMEM_BITS since commit: -048ee0993ec8360abb0b51bdf8f8721e9ed62ec4 - -Also remove set_ppc64_max_physmem_bits and set info->max_physmem_bits in -get_machdep_info_ppc64 instead. set_ppc64_max_physmem_bits is broken -for all kernels compiled with CONFIG_SPARSEMEM=n. makedumpfile is -unable to get mem_section field from powerpc kernel since commit: -fd59d231f81cb02870b9cf15f456a897f3669b4e - -Upstream-Status: Pending - -Signed-off-by: Alexandru Moise -Signed-off-by: Yi Zhao - -[hqBai: adjusted patch for context, no logical change] -Signed-off-by: Haiqing Bai -Signed-off-by: Mingli Yu ---- - arch/ppc64.c | 38 ++------------------------------------ - 1 file changed, 2 insertions(+), 36 deletions(-) - ---- a/arch/ppc64.c -+++ b/arch/ppc64.c -@@ -462,44 +462,6 @@ ppc64_vtop_level4(unsigned long vaddr) - return paddr; - } - --int --set_ppc64_max_physmem_bits(void) --{ -- long array_len = ARRAY_LENGTH(mem_section); -- -- /* Check if we can get MAX_PHYSMEM_BITS from vmcoreinfo */ -- if (NUMBER(MAX_PHYSMEM_BITS) != NOT_FOUND_NUMBER) { -- info->max_physmem_bits = NUMBER(MAX_PHYSMEM_BITS); -- return TRUE; -- } -- -- /* -- * The older ppc64 kernels uses _MAX_PHYSMEM_BITS as 42 and the -- * newer kernels 3.7 onwards uses 46 bits. -- */ -- -- info->max_physmem_bits = _MAX_PHYSMEM_BITS_ORIG ; -- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) -- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) -- return TRUE; -- -- info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7; -- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) -- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) -- return TRUE; -- -- info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_19; -- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) -- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) -- return TRUE; -- -- info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_20; -- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) -- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) -- return TRUE; -- -- return FALSE; --} - - int - get_machdep_info_ppc64(void) -@@ -507,10 +469,8 @@ get_machdep_info_ppc64(void) - unsigned long vmlist, vmap_area_list, vmalloc_start; - - info->section_size_bits = _SECTION_SIZE_BITS; -- if (!set_ppc64_max_physmem_bits()) { -- ERRMSG("Can't detect max_physmem_bits.\n"); -- return FALSE; -- } -+ info->max_physmem_bits = _MAX_PHYSMEM_BITS_3_7; -+ - info->page_offset = __PAGE_OFFSET; - - if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) { diff --git a/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.9.bb b/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.9.bb deleted file mode 100644 index 8de4a7ad6..000000000 --- a/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.9.bb +++ /dev/null @@ -1,64 +0,0 @@ -SUMMARY = "VMcore extraction tool" -DESCRIPTION = "\ - This program is used to extract a subset of the memory available either \ - via /dev/mem or /proc/vmcore (for crashdumps). It is used to get memory \ - images without extra uneeded information (zero pages, userspace programs, \ - etc). \ -" -HOMEPAGE = "https://github.com/makedumpfile/makedumpfile" - -LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -LICENSE = "GPLv2.0" - -SRCBRANCH ?= "master" -SRCREV = "a9ad811c15e769c8e6d8d915a05cebc32f2ea2f5" - -DEPENDS = "bzip2 zlib elfutils xz" -RDEPENDS:${PN}-tools = "perl ${PN}" - -# arm and aarch64 would compile but has never been tested upstream. mips would not compile. -# -COMPATIBLE_HOST = "(x86_64|i.86|powerpc|arm|aarch64).*-linux" - -PACKAGES =+ "${PN}-tools" -FILES:${PN}-tools = "${bindir}/*.pl" - -SRC_URI = "\ - git://github.com/makedumpfile/makedumpfile;branch=${SRCBRANCH};protocol=https \ - file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \ - file://0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch \ -" - -S = "${WORKDIR}/git" - -UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+(\.\d+)+)" - -SECTION = "base" - -# If we do not specify TARGET, makedumpfile will build for the host but use the -# target gcc. -# -EXTRA_OEMAKE = "\ - LINKTYPE=static \ - TARGET=${TARGET_ARCH} \ - ${PACKAGECONFIG_CONFARGS} \ -" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[lzo] = "USELZO=on,USELZO=off,lzo" -PACKAGECONFIG[snappy] = "USESNAPPY=on,USESNAPPY=off,snappy" - -do_install () { - mkdir -p ${D}/usr/bin - install -m 755 ${S}/makedumpfile ${D}/usr/bin - install -m 755 ${S}/makedumpfile-R.pl ${D}/usr/bin - - mkdir -p ${D}/usr/share/man/man8 - install -m 644 ${S}/makedumpfile.8.gz ${D}/usr/share/man/man8 - - mkdir -p ${D}/usr/share/man/man5 - install -m 644 ${S}/makedumpfile.conf.5.gz ${D}/usr/share/man/man5 - - mkdir -p ${D}/etc/ - install -m 644 ${S}/makedumpfile.conf ${D}/etc/makedumpfile.conf.sample -} diff --git a/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.7.0.bb b/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.7.0.bb new file mode 100644 index 000000000..e703ee71b --- /dev/null +++ b/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.7.0.bb @@ -0,0 +1,63 @@ +SUMMARY = "VMcore extraction tool" +DESCRIPTION = "\ + This program is used to extract a subset of the memory available either \ + via /dev/mem or /proc/vmcore (for crashdumps). It is used to get memory \ + images without extra uneeded information (zero pages, userspace programs, \ + etc). \ +" +HOMEPAGE = "https://github.com/makedumpfile/makedumpfile" + +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" +LICENSE = "GPLv2.0" + +SRCBRANCH ?= "master" +SRCREV = "06ef8e2b814feb08a668b7a3783c86674e49a7b1" + +DEPENDS = "bzip2 zlib elfutils xz" +RDEPENDS:${PN}-tools = "perl ${PN}" + +# mips would not compile. +COMPATIBLE_HOST = "(x86_64|i.86|powerpc|arm|aarch64).*-linux" + +PACKAGES =+ "${PN}-tools" +FILES:${PN}-tools = "${bindir}/*.pl" + +SRC_URI = "\ + git://github.com/makedumpfile/makedumpfile;branch=${SRCBRANCH};protocol=https \ + file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \ +" + +S = "${WORKDIR}/git" + +UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+(\.\d+)+)" + +SECTION = "base" + +# If we do not specify TARGET, makedumpfile will build for the host but use the +# target gcc. +# +EXTRA_OEMAKE = "\ + LINKTYPE=static \ + TARGET=${TARGET_ARCH} \ + ${PACKAGECONFIG_CONFARGS} \ +" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[lzo] = "USELZO=on,USELZO=off,lzo" +PACKAGECONFIG[snappy] = "USESNAPPY=on,USESNAPPY=off,snappy" +PACKAGECONFIG[zstd] = "USEZSTD=on,USEZSTD=off,zstd" + +do_install () { + mkdir -p ${D}/usr/bin + install -m 755 ${S}/makedumpfile ${D}/usr/bin + install -m 755 ${S}/makedumpfile-R.pl ${D}/usr/bin + + mkdir -p ${D}/usr/share/man/man8 + install -m 644 ${S}/makedumpfile.8.gz ${D}/usr/share/man/man8 + + mkdir -p ${D}/usr/share/man/man5 + install -m 644 ${S}/makedumpfile.conf.5.gz ${D}/usr/share/man/man5 + + mkdir -p ${D}/etc/ + install -m 644 ${S}/makedumpfile.conf ${D}/etc/makedumpfile.conf.sample +} -- cgit v1.2.3-54-g00ecf