From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- ...0001-makedumpfile-replace-hardcode-CFLAGS.patch | 134 +++++++++++++++++++++ ...-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch | 73 +++++++++++ .../makedumpfile/makedumpfile_1.6.2.bb | 54 +++++++++ 3 files changed, 261 insertions(+) create mode 100644 meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch create mode 100644 meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch create mode 100644 meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb (limited to 'meta-openembedded/meta-oe/recipes-kernel/makedumpfile') diff --git a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch new file mode 100644 index 000000000..d599a9193 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch @@ -0,0 +1,134 @@ +From 3c2f4ff583a156a7ed2fa0cc002a413c391d063d Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Thu, 21 Jul 2016 18:06:21 +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 +--- + Makefile | 46 +++++++++++++++++++++++----------------------- + 1 file changed, 23 insertions(+), 23 deletions(-) + +diff --git a/Makefile b/Makefile +index 7dde3e4..c5286ac 100644 +--- a/Makefile ++++ b/Makefile +@@ -8,13 +8,6 @@ ifeq ($(strip $CC),) + CC = gcc + endif + +-CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ +- -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ +- -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"' +-CFLAGS_ARCH = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ +- -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE +-# 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 +@@ -22,29 +15,36 @@ ifeq ($(strip($TARGET)),) + TARGET := $(HOST_ARCH) + 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/) ++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/_powerpc_/_powerpc32_/) + + CROSS := + ifneq ($(TARGET), $(HOST_ARCH)) + CROSS := -U__$(HOST_ARCH)__ + endif + +-CFLAGS += -D__$(ARCH)__ $(CROSS) +-CFLAGS_ARCH += -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 + OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART)) +@@ -54,17 +54,17 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) + + LIBS = -ldw -lbz2 -lebl -ldl -lelf -lz + ifneq ($(LINKTYPE), dynamic) +-LIBS := -static $(LIBS) ++LIBS := $(LIBS) + endif + + ifeq ($(USELZO), on) + LIBS := -llzo2 $(LIBS) +-CFLAGS += -DUSELZO ++CFLAGS_COMMON += -DUSELZO + endif + + ifeq ($(USESNAPPY), on) + LIBS := -lsnappy $(LIBS) +-CFLAGS += -DUSESNAPPY ++CFLAGS_COMMON += -DUSESNAPPY + endif + + LIBS := -lpthread $(LIBS) +@@ -72,14 +72,14 @@ LIBS := -lpthread $(LIBS) + 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) + 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 +@@ -90,7 +90,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) + gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz + + 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.gz makedumpfile.conf.5.gz +-- +2.8.1 + diff --git a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch new file mode 100644 index 000000000..e0c3d9af6 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch @@ -0,0 +1,73 @@ +From 653fe8e724081d2f289c2245d1220d5f7170538d 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 +--- + arch/ppc64.c | 28 ++-------------------------- + 1 file changed, 2 insertions(+), 26 deletions(-) + +diff --git a/arch/ppc64.c b/arch/ppc64.c +index 89a7f05..6c928ab 100644 +--- a/arch/ppc64.c ++++ b/arch/ppc64.c +@@ -302,37 +302,13 @@ ppc64_vtop_level4(unsigned long vaddr) + } + + int +-set_ppc64_max_physmem_bits(void) +-{ +- long array_len = ARRAY_LENGTH(mem_section); +- /* +- * 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; +- +- return FALSE; +-} +- +-int + 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) { +-- +2.5.0 + diff --git a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb new file mode 100644 index 000000000..d6f2d807e --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb @@ -0,0 +1,54 @@ +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 = "http://makedumpfile.sourceforge.net" + +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" +LICENSE = "GPLv2.0" + +DEPENDS = "bzip2 zlib elfutils" +RDEPENDS_${PN}-tools = "perl ${PN}" + +# arm would compile but has never been tested upstream. mips would not compile. +# +COMPATIBLE_HOST = "(x86_64|i.86|powerpc|arm).*-linux" + +PACKAGES =+ "${PN}-tools" +FILES_${PN}-tools = "${bindir}/*.pl" + +SRC_URI = "\ + ${SOURCEFORGE_MIRROR}/makedumpfile/${BPN}-${PV}.tar.gz \ + file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \ + file://0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch \ +" +SRC_URI[md5sum] = "72be5bf973eed898c5127e3abc466583" +SRC_URI[sha256sum] = "ee3d21cb4032a60bd2c802d1d8b21b9f399710e1574f8de8ead5ab50cd821a6d" + +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} \ +" + +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.1