diff options
| -rw-r--r-- | meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch | 134 | ||||
| -rw-r--r-- | meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.0.bb | 53 |
2 files changed, 187 insertions, 0 deletions
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 new file mode 100644 index 0000000000..d599a91933 --- /dev/null +++ b/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch | |||
| @@ -0,0 +1,134 @@ | |||
| 1 | From 3c2f4ff583a156a7ed2fa0cc002a413c391d063d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
| 3 | Date: Thu, 21 Jul 2016 18:06:21 +0800 | ||
| 4 | Subject: [PATCH] makedumpfile: replace hardcode CFLAGS | ||
| 5 | |||
| 6 | * Create alias for target such as powerpc as powerpc32 | ||
| 7 | * Remove hardcode CFLAGS | ||
| 8 | * Add CFLAGS_COMMON to instead of CFLAGS so can flexibly | ||
| 9 | customize CFLAGS and not hardcode the CFLAGS as previously | ||
| 10 | * Forcibly to link dynamic library as the poky build | ||
| 11 | system doesn't build static library by default | ||
| 12 | |||
| 13 | Upstream-Status: Inappropriate[oe specific] | ||
| 14 | |||
| 15 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 16 | --- | ||
| 17 | Makefile | 46 +++++++++++++++++++++++----------------------- | ||
| 18 | 1 file changed, 23 insertions(+), 23 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/Makefile b/Makefile | ||
| 21 | index 7dde3e4..c5286ac 100644 | ||
| 22 | --- a/Makefile | ||
| 23 | +++ b/Makefile | ||
| 24 | @@ -8,13 +8,6 @@ ifeq ($(strip $CC),) | ||
| 25 | CC = gcc | ||
| 26 | endif | ||
| 27 | |||
| 28 | -CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ | ||
| 29 | - -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ | ||
| 30 | - -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"' | ||
| 31 | -CFLAGS_ARCH = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ | ||
| 32 | - -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE | ||
| 33 | -# LDFLAGS = -L/usr/local/lib -I/usr/local/include | ||
| 34 | - | ||
| 35 | HOST_ARCH := $(shell uname -m) | ||
| 36 | # Use TARGET as the target architecture if specified. | ||
| 37 | # Defaults to uname -m | ||
| 38 | @@ -22,29 +15,36 @@ ifeq ($(strip($TARGET)),) | ||
| 39 | TARGET := $(HOST_ARCH) | ||
| 40 | endif | ||
| 41 | |||
| 42 | -ARCH := $(shell echo ${TARGET} | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \ | ||
| 43 | - -e s/arm.*/arm/ -e s/sa110/arm/ \ | ||
| 44 | - -e s/s390x/s390/ -e s/parisc64/parisc/ \ | ||
| 45 | - -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/) | ||
| 46 | +ARCH := $(shell echo __${TARGET}__ | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \ | ||
| 47 | + -e s/arm.*/arm/ -e s/sa110/arm/ \ | ||
| 48 | + -e s/s390x/s390/ -e s/parisc64/parisc/ \ | ||
| 49 | + -e s/ppc64/powerpc64/ -e s/ppc/powerpc32/ \ | ||
| 50 | + -e s/_powerpc_/_powerpc32_/) | ||
| 51 | |||
| 52 | CROSS := | ||
| 53 | ifneq ($(TARGET), $(HOST_ARCH)) | ||
| 54 | CROSS := -U__$(HOST_ARCH)__ | ||
| 55 | endif | ||
| 56 | |||
| 57 | -CFLAGS += -D__$(ARCH)__ $(CROSS) | ||
| 58 | -CFLAGS_ARCH += -D__$(ARCH)__ $(CROSS) | ||
| 59 | +CFLAGS_ARCH += -D$(ARCH) $(CROSS) | ||
| 60 | |||
| 61 | -ifeq ($(ARCH), powerpc64) | ||
| 62 | -CFLAGS += -m64 | ||
| 63 | +ifeq ($(ARCH), __powerpc64__) | ||
| 64 | CFLAGS_ARCH += -m64 | ||
| 65 | endif | ||
| 66 | |||
| 67 | -ifeq ($(ARCH), powerpc32) | ||
| 68 | -CFLAGS += -m32 | ||
| 69 | +ifeq ($(ARCH), __powerpc32__) | ||
| 70 | CFLAGS_ARCH += -m32 | ||
| 71 | endif | ||
| 72 | |||
| 73 | +CFLAGS_ARCH += $(CFLAGS) \ | ||
| 74 | + -D_FILE_OFFSET_BITS=64 \ | ||
| 75 | + -D_LARGEFILE_SOURCE \ | ||
| 76 | + -D_LARGEFILE64_SOURCE | ||
| 77 | + | ||
| 78 | +CFLAGS_COMMON = $(CFLAGS_ARCH) \ | ||
| 79 | + -DVERSION='"$(VERSION)"' \ | ||
| 80 | + -DRELEASE_DATE='"$(DATE)"' | ||
| 81 | + | ||
| 82 | SRC_BASE = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h sadump_info.h | ||
| 83 | SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c | ||
| 84 | OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART)) | ||
| 85 | @@ -54,17 +54,17 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) | ||
| 86 | |||
| 87 | LIBS = -ldw -lbz2 -lebl -ldl -lelf -lz | ||
| 88 | ifneq ($(LINKTYPE), dynamic) | ||
| 89 | -LIBS := -static $(LIBS) | ||
| 90 | +LIBS := $(LIBS) | ||
| 91 | endif | ||
| 92 | |||
| 93 | ifeq ($(USELZO), on) | ||
| 94 | LIBS := -llzo2 $(LIBS) | ||
| 95 | -CFLAGS += -DUSELZO | ||
| 96 | +CFLAGS_COMMON += -DUSELZO | ||
| 97 | endif | ||
| 98 | |||
| 99 | ifeq ($(USESNAPPY), on) | ||
| 100 | LIBS := -lsnappy $(LIBS) | ||
| 101 | -CFLAGS += -DUSESNAPPY | ||
| 102 | +CFLAGS_COMMON += -DUSESNAPPY | ||
| 103 | endif | ||
| 104 | |||
| 105 | LIBS := -lpthread $(LIBS) | ||
| 106 | @@ -72,14 +72,14 @@ LIBS := -lpthread $(LIBS) | ||
| 107 | all: makedumpfile | ||
| 108 | |||
| 109 | $(OBJ_PART): $(SRC_PART) | ||
| 110 | - $(CC) $(CFLAGS) -c -o ./$@ $(VPATH)$(@:.o=.c) | ||
| 111 | + $(CC) $(CFLAGS_COMMON) -c -o ./$@ $(VPATH)$(@:.o=.c) | ||
| 112 | |||
| 113 | $(OBJ_ARCH): $(SRC_ARCH) | ||
| 114 | @mkdir -p $(@D) | ||
| 115 | $(CC) $(CFLAGS_ARCH) -c -o ./$@ $(VPATH)$(@:.o=.c) | ||
| 116 | |||
| 117 | makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) | ||
| 118 | - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS) | ||
| 119 | + $(CC) $(CFLAGS_COMMON) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -rdynamic -o $@ $< $(LIBS) | ||
| 120 | echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8 | ||
| 121 | grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8 | ||
| 122 | mv temp.8 makedumpfile.8 | ||
| 123 | @@ -90,7 +90,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) | ||
| 124 | gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz | ||
| 125 | |||
| 126 | eppic_makedumpfile.so: extension_eppic.c | ||
| 127 | - $(CC) $(CFLAGS) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo | ||
| 128 | + $(CC) $(CFLAGS_COMMON) $(LDFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo | ||
| 129 | |||
| 130 | clean: | ||
| 131 | rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8.gz makedumpfile.conf.5.gz | ||
| 132 | -- | ||
| 133 | 2.8.1 | ||
| 134 | |||
diff --git a/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.0.bb b/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.0.bb new file mode 100644 index 0000000000..be859a2d4b --- /dev/null +++ b/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.0.bb | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | SUMMARY = "VMcore extraction tool" | ||
| 2 | DESCRIPTION = "\ | ||
| 3 | This program is used to extract a subset of the memory available either \ | ||
| 4 | via /dev/mem or /proc/vmcore (for crashdumps). It is used to get memory \ | ||
| 5 | images without extra uneeded information (zero pages, userspace programs, \ | ||
| 6 | etc). \ | ||
| 7 | " | ||
| 8 | HOMEPAGE = "http://makedumpfile.sourceforge.net" | ||
| 9 | |||
| 10 | DEPENDS = "bzip2 zlib elfutils" | ||
| 11 | RDEPENDS_${PN}-tools = "perl ${PN}" | ||
| 12 | |||
| 13 | # arm would compile but has never been tested upstream. mips would not compile. | ||
| 14 | # | ||
| 15 | COMPATIBLE_HOST = "(x86_64|i.86|powerpc).*-linux" | ||
| 16 | |||
| 17 | PACKAGES =+ "${PN}-tools" | ||
| 18 | FILES_${PN}-tools = "${bindir}/*.pl" | ||
| 19 | |||
| 20 | SRC_URI = "\ | ||
| 21 | ${SOURCEFORGE_MIRROR}/makedumpfile/${BPN}-${PV}.tar.gz \ | ||
| 22 | file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \ | ||
| 23 | " | ||
| 24 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
| 25 | LICENSE = "GPLv2.0" | ||
| 26 | |||
| 27 | SRC_URI[md5sum] = "041c5c6de2c3066600e4ca646c2397d6" | ||
| 28 | SRC_URI[sha256sum] = "e3147abc52df2ceac1e9affef45bf37e2f2e1d9979bc94a761ee11e4044072ac" | ||
| 29 | |||
| 30 | SECTION = "base" | ||
| 31 | |||
| 32 | # If we do not specify TARGET, makedumpfile will build for the host but use the | ||
| 33 | # target gcc. | ||
| 34 | # | ||
| 35 | EXTRA_OEMAKE = "\ | ||
| 36 | LINKTYPE=static \ | ||
| 37 | TARGET=${TARGET_ARCH} \ | ||
| 38 | " | ||
| 39 | |||
| 40 | do_install () { | ||
| 41 | mkdir -p ${D}/usr/bin | ||
| 42 | install -m 755 ${S}/makedumpfile ${D}/usr/bin | ||
| 43 | install -m 755 ${S}/makedumpfile-R.pl ${D}/usr/bin | ||
| 44 | |||
| 45 | mkdir -p ${D}/usr/share/man/man8 | ||
| 46 | install -m 644 ${S}/makedumpfile.8.gz ${D}/usr/share/man/man8 | ||
| 47 | |||
| 48 | mkdir -p ${D}/usr/share/man/man5 | ||
| 49 | install -m 644 ${S}/makedumpfile.conf.5.gz ${D}/usr/share/man/man5 | ||
| 50 | |||
| 51 | mkdir -p ${D}/etc/ | ||
| 52 | install -m 644 ${S}/makedumpfile.conf ${D}/etc/makedumpfile.conf.sample | ||
| 53 | } | ||
