Skip to contentSkip to conversation

makedumpfile: import 1.7.5 from meta-openembedded

PATCH In review [email protected] 4 participants 7 messages Oct 14, 2024 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 makedumpfile: import 1.7.5 from meta-openembedded

From: Etienne Cordonnier <[email protected]>

The kdump script from kexec-tools does not work without makedumpfile (see https://git.yoctoproject.org/poky/tree/meta/recipes-kernel/kexec/kexec-tools/kdump#n14 ). Thus, let's import makedumpfile from meta-openembedded/meta-oe/recipes-kernel/makedumpfile and make kexec-tools RDEPENDS on makedumpfile.

makedumpfile is the utility which reads /proc/vmcore after a kernel panic and creates a kdump file under /var/crash/.

---
 meta/conf/distro/include/maintainers.inc      |   1 +
 .../kexec/kexec-tools_2.0.29.bb               |   1 +
 ...makedumpfile-replace-hardcode-CFLAGS.patch | 139 ++++++++++++++++++
 .../makedumpfile/makedumpfile_1.7.5.bb        |  62 ++++++++
 4 files changed, 203 insertions(+)
 create mode 100644 meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch
 create mode 100644 meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb
meta/conf/distro/include/maintainers.inc +1 -0
index b529786214..ad2544741f 100644
@@ -490,6 +490,7 @@ RECIPE_MAINTAINER:pn-m4-native = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-make = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-makedepend = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-makedevs = "Chen Qi <[email protected]>"
+RECIPE_MAINTAINER:pn-makedumpfile = "Etienne Cordonnier <[email protected]>"
 RECIPE_MAINTAINER:pn-make-mod-scripts = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-man-db = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER:pn-man-pages = "Hongxu Jia <[email protected]>"
meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +1 -0
index 2c2901f19e..be24d064bb 100644
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09 \
                     "
 DEPENDS = "zlib xz"
+RDEPENDS:${PN} = "makedumpfile"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
            file://kdump \
meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch new file +139 -0

139 lines not on this page · raw message

meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw

Patchtest results for [PATCH] makedumpfile: import 1.7.5 from meta-openembedded

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/makedumpfile-import-1.7.5-from-meta-openembedded.patch

FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test lic files chksum presence (test_metadata.TestMetadata.test_lic_files_chksum_presence)
PASS: test license presence (test_metadata.TestMetadata.test_license_presence)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)
PASS: test summary presence (test_metadata.TestMetadata.test_summary_presence)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#2 lore raw
In reply to [email protected]

How was this added in the first place without bringing in this required dependency?

Alex

Quoted 306 lines · Etienne Cordonnier via lists.openembedded.org

From: Etienne Cordonnier <[email protected]>

The kdump script from kexec-tools does not work without makedumpfile (see
https://git.yoctoproject.org/poky/tree/meta/recipes-kernel/kexec/kexec-tools/kdump#n14
).
Thus, let's import makedumpfile from meta-openembedded/meta-oe/recipes-kernel/makedumpfile and make kexec-tools RDEPENDS on makedumpfile.

makedumpfile is the utility which reads /proc/vmcore after a kernel panic and creates a kdump file under /var/crash/.

---
 meta/conf/distro/include/maintainers.inc      |   1 +
 .../kexec/kexec-tools_2.0.29.bb               |   1 +
 ...makedumpfile-replace-hardcode-CFLAGS.patch | 139 ++++++++++++++++++
 .../makedumpfile/makedumpfile_1.7.5.bb        |  62 ++++++++
 4 files changed, 203 insertions(+)
 create mode 100644
meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch
 create mode 100644 meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb
meta/conf/distro/include/maintainers.inc +0 -0
index b529786214..ad2544741f 100644
@@ -490,6 +490,7 @@ RECIPE_MAINTAINER:pn-m4-native = "Robert Yang <

[email protected]>"
RECIPE_MAINTAINER:pn-make = "Robert Yang <[email protected]>" RECIPE_MAINTAINER:pn-makedepend = "Robert Yang <[email protected]

Quoted 1 line

"

RECIPE_MAINTAINER:pn-makedevs = "Chen Qi <[email protected]>"
+RECIPE_MAINTAINER:pn-makedumpfile = "Etienne Cordonnier < [email protected]>"
RECIPE_MAINTAINER:pn-make-mod-scripts = "Bruce Ashfield <
[email protected]>"
RECIPE_MAINTAINER:pn-man-db = "Hongxu Jia <[email protected]>" RECIPE_MAINTAINER:pn-man-pages = "Hongxu Jia <[email protected]>"

meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +1 -0
index 2c2901f19e..be24d064bb 100644
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM =
 "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
 
 file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09
 \
                     "
 DEPENDS = "zlib xz"
+RDEPENDS:${PN} = "makedumpfile"

SRC_URI =

"${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
            file://kdump \

diff --git a/meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch b/meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch new file mode 100644
index 0000000000..96a996f616
--- /dev/null
+++
b/meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch

meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +44 -1
@@ -0,0 +1,139 @@
+From 6d16911316cb576db0239f607e60918a222e4436 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Sun, 24 Apr 2022 17:25:33 +0800
+Subject: [PATCH] makedumpfile: replace hardcode CFLAGS
+
+* Create alias for target such as powerpc as powerpc32
+* Remove hardcode CFLAGS
+* Add CFLAGS_COMMON to instead of CFLAGS so can flexibly
+  customize CFLAGS and not hardcode the CFLAGS as previously
+* Forcibly to link dynamic library as the poky build
+  system doesn't build static library by default
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+
+[2021-11-18] Patch updated to use CFLAGS_COMMON for zstd
+Signed-off-by: Fathi Boudra <[email protected]>
+
+Rebase to 1.7.1
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ Makefile | 40 +++++++++++++++++++++-------------------
+ 1 file changed, 21 insertions(+), 19 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 71d8548..22acdd5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,12 +8,6 @@ ifeq ($(strip $CC),)
+ CC    = gcc
+ endif
+
+-CFLAGS_BASE := $(CFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
+-              -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+-CFLAGS      := $(CFLAGS_BASE) -DVERSION='"$(VERSION)"'
-DRELEASE_DATE='"$(DATE)"'
+-CFLAGS_ARCH := $(CFLAGS_BASE)
+-# LDFLAGS = -L/usr/local/lib -I/usr/local/include
+-
+ HOST_ARCH := $(shell uname -m)
+ # Use TARGET as the target architecture if specified.
+ # Defaults to uname -m
+@@ -24,26 +18,34 @@ endif
+ ARCH := $(shell echo ${TARGET}  | sed -e s/i.86/x86/ -e s/sun4u/sparc64/

\

meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +37 -0
+                              -e s/arm.*/arm/ -e s/sa110/arm/ \
+                              -e s/s390x/s390/ -e s/parisc64/parisc/ \
+-                             -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/)
++                             -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/ \
++                             -e s/_powerpc_/_powerpc32_/)
+
+ CROSS :=
+ ifneq ($(TARGET), $(HOST_ARCH))
+ CROSS := -U__$(HOST_ARCH)__
+ endif
+
+-CFLAGS += -D__$(ARCH)__ $(CROSS)
+ CFLAGS_ARCH += -D__$(ARCH)__ $(CROSS)
+
+-ifeq ($(ARCH), powerpc64)
+-CFLAGS += -m64
++ifeq ($(ARCH), __powerpc64__)
+ CFLAGS_ARCH += -m64
+ endif
+
+-ifeq ($(ARCH), powerpc32)
+-CFLAGS += -m32
++ifeq ($(ARCH), __powerpc32__)
+ CFLAGS_ARCH += -m32
+ endif
+
++CFLAGS_ARCH += $(CFLAGS) \
++              -D_FILE_OFFSET_BITS=64 \
++              -D_LARGEFILE_SOURCE \
++              -D_LARGEFILE64_SOURCE
++
++CFLAGS_COMMON = $(CFLAGS_ARCH) \
++              -DVERSION='"$(VERSION)"' \
++              -DRELEASE_DATE='"$(DATE)"'
++
++
+ SRC_BASE = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h

sadump_info.h
+ SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c tools.c printk.c detect_cycle.c
+ OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART))
+@@ -52,12 +54,12 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH))

meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +42 -0
+
+ LIBS = -ldw -lbz2 -ldl -lelf -lz
+ ifneq ($(LINKTYPE), dynamic)
+-LIBS := -static $(LIBS) -llzma
++LIBS := $(LIBS) -llzma
+ endif
+
+ ifeq ($(USELZO), on)
+ LIBS := -llzo2 $(LIBS)
+-CFLAGS += -DUSELZO
++CFLAGS_COMMON += -DUSELZO
+ endif
+
+ ifeq ($(USESNAPPY), on)
+@@ -65,12 +67,12 @@ LIBS := -lsnappy $(LIBS)
+ ifneq ($(LINKTYPE), dynamic)
+ LIBS := $(LIBS) -lstdc++
+ endif
+-CFLAGS += -DUSESNAPPY
++CFLAGS_COMMON += -DUSESNAPPY
+ endif
+
+ ifeq ($(USEZSTD), on)
+ LIBS := -lzstd $(LIBS)
+-CFLAGS += -DUSEZSTD
++CFLAGS_COMMON += -DUSEZSTD
+ endif
+
+ ifeq ($(DEBUG), on)
+@@ -104,14 +106,14 @@ LIBS := $(LIBS) $(call try-run,\
+ all: makedumpfile
+
+ $(OBJ_PART): $(SRC_PART)
+-      $(CC) $(CFLAGS) -c -o ./$@ $(VPATH)$(@:.o=.c)
++      $(CC) $(CFLAGS_COMMON) -c -o ./$@ $(VPATH)$(@:.o=.c)
+
+ $(OBJ_ARCH): $(SRC_ARCH)
+       @mkdir -p $(@D)
+       $(CC) $(CFLAGS_ARCH) -c -o ./$@ $(VPATH)$(@:.o=.c)
+
+ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH)
+-      $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@

$< $(LIBS)
++ $(CC) $(CFLAGS_COMMON) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH)

meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +8 -1
-rdynamic -o $@ $< $(LIBS)
+       @sed -e "s/@DATE@/$(DATE)/" \
+            -e "s/@VERSION@/$(VERSION)/" \
+            $(VPATH)makedumpfile.8.in > $(VPATH)makedumpfile.8
+@@ -120,7 +122,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH)
+            $(VPATH)makedumpfile.conf.5.in > $(VPATH)makedumpfile.conf.5
+
+ eppic_makedumpfile.so: extension_eppic.c
+-      $(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@

extension_eppic.c -fPIC -leppic -ltinfo
++ $(CC) $(CFLAGS_COMMON) $(LDFLAGS) -shared -rdynamic -o $@
extension_eppic.c -fPIC -leppic -ltinfo

meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +3 -0
+
+ clean:
+       rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8

makedumpfile.conf.5

meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb new file +3 -0
new file mode 100644
index 0000000000..85b44c4941
@@ -0,0 +1,62 @@
+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, \

meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb new file +22 -0
+    etc). \
+"
+HOMEPAGE = "https://github.com/makedumpfile/makedumpfile"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+LICENSE = "GPL-2.0-only"
+
+SRCBRANCH ?= "master"
+SRCREV = "c266469347d49287be38059d45e7aaa454db9cb2"
+
+DEPENDS = "bzip2 zlib elfutils xz"
+RDEPENDS:${PN}-tools = "perl ${PN}"
+
+# mips/rv32 would not compile.
+COMPATIBLE_HOST:mipsarcho32 = "null"
+COMPATIBLE_HOST:riscv32 = "null"
+
+PACKAGES =+ "${PN}-tools"
+FILES:${PN}-tools = "${bindir}/*.pl"
+
+SRC_URI = "\
+    git://

github.com/makedumpfile/makedumpfile;branch=${SRCBRANCH};protocol=https
<http://github.com/makedumpfile/makedumpfile;branch=$%7BSRCBRANCH%7D;protocol=https>
\

meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb new file +10 -0
+    file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \
+"
+
+S = "${WORKDIR}/git"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
+
+SECTION = "base"
+
+# If we do not specify TARGET, makedumpfile will build for the host but

use the

meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb new file +24 -0
+# target gcc.
+#
+
+MAKEDUMPFILE_TARGET ?= "${TARGET_ARCH}"
+MAKEDUMPFILE_TARGET:powerpc = "ppc"
+
+EXTRA_OEMAKE = "\
+    LINKTYPE=static \
+    TARGET=${MAKEDUMPFILE_TARGET} \
+    ${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}/etc/
+    install -m 644 ${S}/makedumpfile.conf

${D}/etc/makedumpfile.conf.sample
+}
--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#205734):
https://lists.openembedded.org/g/openembedded-core/message/205734
Mute This Topic: https://lists.openembedded.org/mt/108998255/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

@Alexander Kanavin <[email protected]> :
- kexec has been in poky for ages, and then in December 2015 the commit you mentioned added a hard dependency to makedumpfile in the kdump script, but did not create a recipe for makedumpfile (which did not have a recipe at that point).
- A makedumpfile recipe was added in July 2016 to meta-openembedded

Without makedumpfile, the script is quite useless. After a kernel panic, the device reboots to the capture kernel, the kdump script fails, the device reboots to the normal kernel, and /proc/vmcore is not available after the reboot.

Étienne

Quoted 13 lines · Alexander Kanavin
Quoted 2 lines · Alexander Kanavin via lists.openembedded.org

How was this added in the first place without bringing in this required

dependency?

It was there from the start:

https://urldefense.proofpoint.com/v2/url?u=https-3A__git.yoctoproject.org_poky_commit_-3Fh-3Dmaster-2Dnext-26id-3Da444eb5951112a4900665677b3bff323a8828e3f&d=DwIBaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=-GKFH-1LTTm97Sf5LaewiisHB28UDn40IHPACIZv8Urz1wvHWxzNq4f_v9xQTv_Z&s=vkBlYgnxz79yc9tJfWsFBn_Mm4sgtp7EUAbTg-BH53c&e=

Alex

#6 lore raw

Thanks, I don't have a problem with the patch, just to make it clear.

Alex

Quoted 21 lines · Etienne Cordonnier

@Alexander Kanavin :
- kexec has been in poky for ages, and then in December 2015 the commit you mentioned added a hard dependency to makedumpfile in the kdump script, but did not create a recipe for makedumpfile (which did not have a recipe at that point).
- A makedumpfile recipe was added in July 2016 to meta-openembedded

Without makedumpfile, the script is quite useless. After a kernel panic, the device reboots to the capture kernel, the kdump script fails, the device reboots to the normal kernel, and /proc/vmcore is not available after the reboot.

Étienne

Quoted 11 lines · Alexander Kanavin
Quoted 2 lines · Alexander Kanavin via lists.openembedded.org

How was this added in the first place without bringing in this required dependency?

It was there from the start:
https://urldefense.proofpoint.com/v2/url?u=https-3A__git.yoctoproject.org_poky_commit_-3Fh-3Dmaster-2Dnext-26id-3Da444eb5951112a4900665677b3bff323a8828e3f&d=DwIBaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=-GKFH-1LTTm97Sf5LaewiisHB28UDn40IHPACIZv8Urz1wvHWxzNq4f_v9xQTv_Z&s=vkBlYgnxz79yc9tJfWsFBn_Mm4sgtp7EUAbTg-BH53c&e=

Alex

#7 lore raw
In reply to [email protected]

don't forget to send a patch to remove it from meta-oe at the same time.

Quoted 267 lines · Etienne Cordonnier via lists.openembedded.org

From: Etienne Cordonnier <[email protected]>

The kdump script from kexec-tools does not work without makedumpfile (see https://git.yoctoproject.org/poky/tree/meta/recipes-kernel/kexec/kexec-tools/kdump#n14 ). Thus, let's import makedumpfile from meta-openembedded/meta-oe/recipes-kernel/makedumpfile and make kexec-tools RDEPENDS on makedumpfile.

makedumpfile is the utility which reads /proc/vmcore after a kernel panic and creates a kdump file under /var/crash/.

---
 meta/conf/distro/include/maintainers.inc      |   1 +
 .../kexec/kexec-tools_2.0.29.bb               |   1 +
 ...makedumpfile-replace-hardcode-CFLAGS.patch | 139 ++++++++++++++++++
 .../makedumpfile/makedumpfile_1.7.5.bb        |  62 ++++++++
 4 files changed, 203 insertions(+)
 create mode 100644 meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch
 create mode 100644 meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb
meta/conf/distro/include/maintainers.inc +1 -0
index b529786214..ad2544741f 100644
@@ -490,6 +490,7 @@ RECIPE_MAINTAINER:pn-m4-native = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-make = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-makedepend = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER:pn-makedevs = "Chen Qi <[email protected]>"
+RECIPE_MAINTAINER:pn-makedumpfile = "Etienne Cordonnier <[email protected]>"
 RECIPE_MAINTAINER:pn-make-mod-scripts = "Bruce Ashfield <[email protected]>"
 RECIPE_MAINTAINER:pn-man-db = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER:pn-man-pages = "Hongxu Jia <[email protected]>"
meta/recipes-kernel/kexec/kexec-tools_2.0.29.bb +1 -0
index 2c2901f19e..be24d064bb 100644
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09 \
                     "
 DEPENDS = "zlib xz"
+RDEPENDS:${PN} = "makedumpfile"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
            file://kdump \
meta/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch new file +139 -0
new file mode 100644
index 0000000000..96a996f616
@@ -0,0 +1,139 @@
+From 6d16911316cb576db0239f607e60918a222e4436 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Sun, 24 Apr 2022 17:25:33 +0800
+Subject: [PATCH] makedumpfile: replace hardcode CFLAGS
+
+* Create alias for target such as powerpc as powerpc32
+* Remove hardcode CFLAGS
+* Add CFLAGS_COMMON to instead of CFLAGS so can flexibly
+  customize CFLAGS and not hardcode the CFLAGS as previously
+* Forcibly to link dynamic library as the poky build
+  system doesn't build static library by default
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+
+[2021-11-18] Patch updated to use CFLAGS_COMMON for zstd
+Signed-off-by: Fathi Boudra <[email protected]>
+
+Rebase to 1.7.1
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ Makefile | 40 +++++++++++++++++++++-------------------
+ 1 file changed, 21 insertions(+), 19 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 71d8548..22acdd5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,12 +8,6 @@ ifeq ($(strip $CC),)
+ CC    = gcc
+ endif
+
+-CFLAGS_BASE := $(CFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
+-              -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+-CFLAGS      := $(CFLAGS_BASE) -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
+-CFLAGS_ARCH := $(CFLAGS_BASE)
+-# LDFLAGS = -L/usr/local/lib -I/usr/local/include
+-
+ HOST_ARCH := $(shell uname -m)
+ # Use TARGET as the target architecture if specified.
+ # Defaults to uname -m
+@@ -24,26 +18,34 @@ endif
+ ARCH := $(shell echo ${TARGET}  | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \
+                              -e s/arm.*/arm/ -e s/sa110/arm/ \
+                              -e s/s390x/s390/ -e s/parisc64/parisc/ \
+-                             -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/)
++                             -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/ \
++                             -e s/_powerpc_/_powerpc32_/)
+
+ CROSS :=
+ ifneq ($(TARGET), $(HOST_ARCH))
+ CROSS := -U__$(HOST_ARCH)__
+ endif
+
+-CFLAGS += -D__$(ARCH)__ $(CROSS)
+ CFLAGS_ARCH += -D__$(ARCH)__ $(CROSS)
+
+-ifeq ($(ARCH), powerpc64)
+-CFLAGS += -m64
++ifeq ($(ARCH), __powerpc64__)
+ CFLAGS_ARCH += -m64
+ endif
+
+-ifeq ($(ARCH), powerpc32)
+-CFLAGS += -m32
++ifeq ($(ARCH), __powerpc32__)
+ CFLAGS_ARCH += -m32
+ endif
+
++CFLAGS_ARCH += $(CFLAGS) \
++              -D_FILE_OFFSET_BITS=64 \
++              -D_LARGEFILE_SOURCE \
++              -D_LARGEFILE64_SOURCE
++
++CFLAGS_COMMON = $(CFLAGS_ARCH) \
++              -DVERSION='"$(VERSION)"' \
++              -DRELEASE_DATE='"$(DATE)"'
++
++
+ SRC_BASE = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h sadump_info.h
+ SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c tools.c printk.c detect_cycle.c
+ OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART))
+@@ -52,12 +54,12 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH))
+
+ LIBS = -ldw -lbz2 -ldl -lelf -lz
+ ifneq ($(LINKTYPE), dynamic)
+-LIBS := -static $(LIBS) -llzma
++LIBS := $(LIBS) -llzma
+ endif
+
+ ifeq ($(USELZO), on)
+ LIBS := -llzo2 $(LIBS)
+-CFLAGS += -DUSELZO
++CFLAGS_COMMON += -DUSELZO
+ endif
+
+ ifeq ($(USESNAPPY), on)
+@@ -65,12 +67,12 @@ LIBS := -lsnappy $(LIBS)
+ ifneq ($(LINKTYPE), dynamic)
+ LIBS := $(LIBS) -lstdc++
+ endif
+-CFLAGS += -DUSESNAPPY
++CFLAGS_COMMON += -DUSESNAPPY
+ endif
+
+ ifeq ($(USEZSTD), on)
+ LIBS := -lzstd $(LIBS)
+-CFLAGS += -DUSEZSTD
++CFLAGS_COMMON += -DUSEZSTD
+ endif
+
+ ifeq ($(DEBUG), on)
+@@ -104,14 +106,14 @@ LIBS := $(LIBS) $(call try-run,\
+ all: makedumpfile
+
+ $(OBJ_PART): $(SRC_PART)
+-      $(CC) $(CFLAGS) -c -o ./$@ $(VPATH)$(@:.o=.c)
++      $(CC) $(CFLAGS_COMMON) -c -o ./$@ $(VPATH)$(@:.o=.c)
+
+ $(OBJ_ARCH): $(SRC_ARCH)
+       @mkdir -p $(@D)
+       $(CC) $(CFLAGS_ARCH) -c -o ./$@ $(VPATH)$(@:.o=.c)
+
+ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH)
+-      $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS)
++      $(CC) $(CFLAGS_COMMON) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS)
+       @sed -e "s/@DATE@/$(DATE)/" \
+            -e "s/@VERSION@/$(VERSION)/" \
+            $(VPATH)makedumpfile.8.in > $(VPATH)makedumpfile.8
+@@ -120,7 +122,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH)
+            $(VPATH)makedumpfile.conf.5.in > $(VPATH)makedumpfile.conf.5
+
+ eppic_makedumpfile.so: extension_eppic.c
+-      $(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo
++      $(CC) $(CFLAGS_COMMON) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo
+
+ clean:
+       rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8 makedumpfile.conf.5
meta/recipes-kernel/makedumpfile/makedumpfile_1.7.5.bb new file +62 -1
new file mode 100644
index 0000000000..85b44c4941
@@ -0,0 +1,62 @@
+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 = "GPL-2.0-only"
+
+SRCBRANCH ?= "master"
+SRCREV = "c266469347d49287be38059d45e7aaa454db9cb2"
+
+DEPENDS = "bzip2 zlib elfutils xz"
+RDEPENDS:${PN}-tools = "perl ${PN}"
+
+# mips/rv32 would not compile.
+COMPATIBLE_HOST:mipsarcho32 = "null"
+COMPATIBLE_HOST:riscv32 = "null"
+
+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<pver>\d+(\.\d+)+)"
+
+SECTION = "base"
+
+# If we do not specify TARGET, makedumpfile will build for the host but use the
+# target gcc.
+#
+
+MAKEDUMPFILE_TARGET ?= "${TARGET_ARCH}"
+MAKEDUMPFILE_TARGET:powerpc = "ppc"
+
+EXTRA_OEMAKE = "\
+    LINKTYPE=static \
+    TARGET=${MAKEDUMPFILE_TARGET} \
+    ${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}/etc/
+    install -m 644 ${S}/makedumpfile.conf ${D}/etc/makedumpfile.conf.sample
+}
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205734): https://lists.openembedded.org/g/openembedded-core/message/205734
Mute This Topic: https://lists.openembedded.org/mt/108998255/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-