summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-oe/recipes-kernel
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-oe/recipes-kernel
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadtalos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[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 <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-kernel')
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb25
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch43
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb36
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch35
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch36
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch33
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch13
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch10
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.91
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch32
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch26
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch33
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch79
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch37
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.0.bb115
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb36
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/fix_systemd_path.patch127
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb46
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc49
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch103
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch62
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb11
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc131
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch134
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch73
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb54
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch32
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch29
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init40
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service11
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb45
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc65
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch30
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch51
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4581
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch12
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch46
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch98
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch44
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest19
-rw-r--r--meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb10
41 files changed, 2493 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb b/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb
new file mode 100644
index 000000000..8e370f962
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Proxy for UDP/TCP debug connections"
+DESCRIPTION = "The agent-proxy will forward tcp or udp connections as well as allow for script multiplexing of terminal sessions."
+HOMEPAGE = "http://kgdb.wiki.kernel.org/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+SECTION = "devel"
+
+EXTRA_OEMAKE = "'CC=${CC}'"
+
+SRCREV = "e6c9d3d996bd55e7ab14dbd74deb7841e0c3a4f1"
+PV = "1.96+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git;protocol=git \
+ file://0001-Makefile-Add-LDFLAGS-variable.patch \
+"
+
+BBCLASSEXTEND = "native nativesdk"
+
+S = "${WORKDIR}/git"
+
+do_install () {
+ install -d ${D}${bindir}
+ install -m 0755 agent-proxy ${D}${bindir}
+}
diff --git a/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch b/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch
new file mode 100644
index 000000000..5eec91d72
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch
@@ -0,0 +1,43 @@
+From 1beb0dad6f8b99eb3bf1b9982e0b49e81ff77bbc Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 23 Nov 2016 19:17:31 +0800
+Subject: [PATCH] Makefile: Add LDFLAGS variable
+
+Add LDFLAGS variable to make sure the extra linkder
+flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e20918f..25d92d3 100644
+--- a/Makefile
++++ b/Makefile
+@@ -51,7 +51,7 @@ $(CROSS_COMPILE)agent-proxy: $(OBJS)
+ $(CC) -DAGENT_VER=$(AGENTVER) $(LINKFLAGS) $(CFLAGS) -o $(extpath)$@ $(OBJS) wsock32.lib
+ else
+ $(CROSS_COMPILE)agent-proxy: $(OBJS)
+- $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) -o $(extpath)$@ $(OBJS) $(LDLIBS)
++ $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) $(LDFLAGS) -o $(extpath)$@ $(OBJS) $(LDLIBS)
+ endif
+
+
+@@ -61,9 +61,9 @@ clean:
+ rm -f $(extpath)$(CROSS_COMPILE)agent-proxy $(extpath)agent-proxy $(extpath)*.o $(extpath)*.obj $(extpath)*.exp $(extpath)*.exe $(extpath)*.ilk $(extpath)*.pdb *~
+
+ $(extpath)$(CROSS_COMPILE)%.o::%.c
+- $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) -c $< -o $@
++ $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) $(LDFLAGS) -c $< -o $@
+
+ $(extpath)%.obj:%.c
+- $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) -c -Fo$@ $(TLSPATH_INC) $<
++ $(CC) -DAGENT_VER=$(AGENTVER) $(CFLAGS) $(LDFLAGS) -c -Fo$@ $(TLSPATH_INC) $<
+
+
+--
+2.8.3
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb b/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb
new file mode 100644
index 000000000..4abd273fa
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Shows and sets processor power related values"
+DESCRIPTION = "cpupower is a collection of tools to examine and tune power \
+saving related features of your processor."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+DEPENDS = "pciutils gettext-native"
+PROVIDES = "virtual/cpupower"
+
+inherit kernelsrc kernel-arch
+
+do_populate_lic[depends] += "virtual/kernel:do_patch"
+
+EXTRA_OEMAKE = "-C ${S}/tools/power/cpupower O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+do_compile() {
+ oe_runmake
+}
+
+do_install() {
+ oe_runmake DESTDIR=${D} install
+ # Do not ship headers
+ rm -rf ${D}${includedir}
+ chown -R root:root ${D}
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+RDEPENDS_${PN} = "bash"
+
+python do_package_prepend() {
+ d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0])
+}
+
+B = "${WORKDIR}/${BPN}-${PV}"
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
new file mode 100644
index 000000000..26a34e5c1
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
@@ -0,0 +1,35 @@
+From 73269df4d8196abe81112acaa2613155b308a8b8 Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Fri, 9 Jan 2015 11:51:18 +0900
+Subject: [PATCH 1/9] cross_add_configure_option
+
+%% original patch: 0001-cross_add_configure_option.patch
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a2baec1..f1972c8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -232,7 +232,7 @@ gdb_merge: force
+ @echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
+ @rm -f ${PROGRAM}
+ @if [ ! -f ${GDB}/config.status ]; then \
+- (cd ${GDB}; ./configure ${GDB_CONF_FLAGS} --with-separate-debug-dir=/usr/lib/debug \
++ (cd ${GDB}; ./configure --host=${GDB_TARGET} --build=${GDB_HOST} --with-separate-debug-dir=/usr/lib/debug \
+ --with-bugurl="" --with-expat=no --with-python=no --disable-sim; \
+ make --no-print-directory CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
+ else make --no-print-directory rebuild; fi
+@@ -283,7 +283,7 @@ force:
+
+ make_configure: force
+ @rm -f configure
+- @${CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
++ @${BUILD_CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
+
+ clean: make_configure
+ @./configure ${CONF_TARGET_FLAG} -q -b
+--
+2.8.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch
new file mode 100644
index 000000000..8355fe44e
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch
@@ -0,0 +1,36 @@
+From 52fc1a7c17768fd52c3577d21dad84e8babb94b5 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 6 Apr 2017 23:01:14 -0400
+Subject: [PATCH 2/3] crash: fix build error unknown type name 'gdb_fpregset_t'
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ gdb-7.6/gdb/gdb_proc_service.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/gdb-7.6/gdb/gdb_proc_service.h b/gdb-7.6/gdb/gdb_proc_service.h
+index 8bc6088..99c6496 100644
+--- a/gdb-7.6/gdb/gdb_proc_service.h
++++ b/gdb-7.6/gdb/gdb_proc_service.h
+@@ -20,6 +20,7 @@
+ #define GDB_PROC_SERVICE_H
+
+ #include <sys/types.h>
++#include "gregset.h"
+
+ #ifdef HAVE_PROC_SERVICE_H
+ #include <proc_service.h>
+@@ -53,8 +54,6 @@
+ #include <sys/procfs.h>
+ #endif
+
+-#include "gregset.h"
+-
+ /* Functions in this interface return one of these status codes. */
+ typedef enum
+ {
+--
+2.8.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch
new file mode 100644
index 000000000..1f4bd01da
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch
@@ -0,0 +1,33 @@
+From c7950ef5228adc52a500b4fc67d7e48c3c09c1df Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 6 Apr 2017 23:02:44 -0400
+Subject: [PATCH 3/3] crash: detect the sysroot's glibc header file
+
+This is cross compile, so let the Makefile detect the sysroot's glibc
+header file, not the host's glibc header file.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index b6b7e80..94f21a5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -264,8 +264,8 @@ gdb_patch:
+ if [ "${ARCH}" = "x86_64" ] && [ "${TARGET}" = "PPC64" ] && [ -f ${GDB}-ppc64le-support.patch ]; then \
+ patch -d ${GDB} -p1 -F0 < ${GDB}-ppc64le-support.patch ; \
+ fi
+- if [ -f /usr/include/proc_service.h ]; then \
+- grep 'extern ps_err_e ps_get_thread_area (struct' /usr/include/proc_service.h; \
++ if [ -f ${RECIPE_SYSROOT}/usr/include/proc_service.h ]; then \
++ grep 'extern ps_err_e ps_get_thread_area (struct' ${RECIPE_SYSROOT}/usr/include/proc_service.h; \
+ if [ $$? -eq 0 ]; then \
+ patch -p0 < ${GDB}-proc_service.h.patch; \
+ fi; \
+--
+2.8.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch
new file mode 100644
index 000000000..0d44c7f17
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch
@@ -0,0 +1,13 @@
+diff -uprN crash-5.1.8.org/configure.c crash-5.1.8/configure.c
+--- crash-5.1.8.org/configure.c 2011-09-17 04:01:12.000000000 +0900
++++ crash-5.1.8/configure.c 2012-09-13 13:28:45.393344108 +0900
+@@ -391,6 +391,9 @@ get_current_configuration(struct support
+ arch_mismatch(sp);
+ }
+
++ /** Force define archtecture */
++ target_data.target = FORCE_DEFINE_ARCH;
++
+ if ((fp = fopen("Makefile", "r")) == NULL) {
+ perror("Makefile");
+ goto get_release;
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch
new file mode 100644
index 000000000..d567fa0a8
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch
@@ -0,0 +1,10 @@
+--- crash-5.1.8/Makefile.orig 2011-12-27 11:21:58.220652105 +0900
++++ crash-5.1.8/Makefile 2011-12-27 11:22:29.563651593 +0900
+@@ -285,6 +285,7 @@
+
+ library: make_build_data ${OBJECT_FILES}
+ ar -rs ${PROGRAM}lib.a ${OBJECT_FILES}
++ ${RANLIB} ${PROGRAM}lib.a
+
+ gdb: force
+ rm -f ${GDB_OFILES}
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9 b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9
new file mode 100644
index 000000000..d6fc22fb3
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9
@@ -0,0 +1 @@
+bash_cv_have_mbstate_t=yes
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch
new file mode 100644
index 000000000..e254fe877
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch
@@ -0,0 +1,32 @@
+Put gdb source tarball in SRC_URI and don't fetch and extract it during
+do_compile.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/Makefile b/Makefile
+index bb0a34e..5eb7604 100644
+--- a/Makefile
++++ b/Makefile
+@@ -226,7 +226,7 @@ all: make_configure
+ # @make --no-print-directory extensions
+
+ gdb_merge: force
+- @if [ ! -f ${GDB}/README ]; then \
++ @if [ ! -f ${GDB}/${GDB}.patch ]; then \
+ make --no-print-directory gdb_unzip; fi
+ @echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs
+ @echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
+@@ -253,11 +253,6 @@ gdb_unzip:
+ @rm -f gdb.files
+ @for FILE in ${GDB_FILES} dummy; do\
+ echo $$FILE >> gdb.files; done
+- @if [ ! -f ${GDB}.tar.gz ] && [ ! -f /usr/bin/wget ]; then \
+- echo /usr/bin/wget is required to download ${GDB}.tar.gz; echo; exit 1; fi
+- @if [ ! -f ${GDB}.tar.gz ] && [ -f /usr/bin/wget ]; then \
+- wget http://ftp.gnu.org/gnu/gdb/${GDB}.tar.gz; fi
+- @tar --exclude-from gdb.files -xvzmf ${GDB}.tar.gz
+ @make --no-print-directory gdb_patch
+
+ gdb_patch:
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch
new file mode 100644
index 000000000..aa5f44dd4
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch
@@ -0,0 +1,26 @@
+This enables parallel building (multiple jobs in gdb) by reading the
+value from GDB_MAKE_JOBS.
+
+Signed-off-by: Amy Fong <amy.fong@windriver.com>
+
+Upstream-Status: Pending
+
+Don't write ${TARGET} to crash.target which causes rebuild fails.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+--
+diff --git a/Makefile b/Makefile
+index 27a1d47..bcf2d2f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -232,8 +232,8 @@ gdb_merge: force
+ @if [ ! -f ${GDB}/config.status ]; then \
+ (cd ${GDB}; ./configure --host=${GDB_TARGET} --build=${GDB_HOST} --with-separate-debug-dir=/usr/lib/debug \
+ --with-bugurl="" --with-expat=no --with-python=no --disable-sim; \
+- make --no-print-directory CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
+- else make --no-print-directory rebuild; fi
++ make --no-print-directory CRASH_TARGET=${TARGET} ${GDB_MAKE_JOBS}; ) \
++ else make --no-print-directory ${GDB_MAKE_JOBS} rebuild; fi
+ @if [ ! -f ${PROGRAM} ]; then \
+ echo; echo "${PROGRAM} build failed"; \
+ echo; exit 1; fi
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch
new file mode 100644
index 000000000..905b4c2cd
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+It fails to build crash for mips with error:
+
+| mips-wrs-linux-gcc: error: unrecognized command line option '-m32'
+| Makefile:291: recipe for target 'make_build_data' failed
+
+So remove the unrecognized option '-m32' for mips.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/configure.c b/configure.c
+index cf1973b..71e97b3 100644
+--- a/configure.c
++++ b/configure.c
+@@ -151,7 +151,7 @@ void add_extra_lib(char *);
+ #define TARGET_CFLAGS_PPC64_ON_X86_64 "TARGET_CFLAGS="
+ #define TARGET_CFLAGS_MIPS "TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64"
+ #define TARGET_CFLAGS_MIPS_ON_X86 "TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64"
+-#define TARGET_CFLAGS_MIPS_ON_X86_64 "TARGET_CFLAGS=-m32 -D_FILE_OFFSET_BITS=64"
++#define TARGET_CFLAGS_MIPS_ON_X86_64 "TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64"
+ #define TARGET_CFLAGS_SPARC64 "TARGET_CFLAGS="
+
+ #define GDB_TARGET_DEFAULT "GDB_CONF_FLAGS="
+@@ -162,7 +162,7 @@ void add_extra_lib(char *);
+ #define GDB_TARGET_ARM64_ON_X86_64 "GDB_CONF_FLAGS=--target=aarch64-elf-linux" /* TBD */
+ #define GDB_TARGET_PPC64_ON_X86_64 "GDB_CONF_FLAGS=--target=powerpc64le-unknown-linux-gnu"
+ #define GDB_TARGET_MIPS_ON_X86 "GDB_CONF_FLAGS=--target=mipsel-elf-linux"
+-#define GDB_TARGET_MIPS_ON_X86_64 "GDB_CONF_FLAGS=--target=mipsel-elf-linux CFLAGS=-m32"
++#define GDB_TARGET_MIPS_ON_X86_64 "GDB_CONF_FLAGS=--target=mipsel-elf-linux"
+
+ /*
+ * The original plan was to allow the use of a particular version
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch
new file mode 100644
index 000000000..0185b5704
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch
@@ -0,0 +1,79 @@
+Upstream-Status: Backport
+
+https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=92fc615
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+--
+From 92fc6153a6fdf2a027d9780f5945712aafad4a9e Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 29 Mar 2015 15:59:01 -0400
+Subject: [PATCH] sim: common: sim-arange: fix extern inline handling
+
+With newer versions of gcc (5.x), the extern inline we're using with the
+sim-arange module no longer works. Since this code really wants the gnu
+inline semantics, use that attribute explicitly.
+
+Reported-by: DJ Delorie <dj@redhat.com>
+Reported-by: Joel Sherrill <joel.sherrill@oarcorp.com>
+---
+ gdb-7.6/sim/common/sim-arange.h | 20 ++++++++++++--------
+ gdb-7.6/sim/common/sim-inline.h | 4 +++-
+ 2 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/gdb-7.6/sim/common/sim-arange.h b/gdb-7.6/sim/common/sim-arange.h
+index 73117f3..de842c9 100644
+--- a/gdb-7.6/sim/common/sim-arange.h
++++ b/gdb-7.6/sim/common/sim-arange.h
+@@ -60,22 +60,26 @@ extern void sim_addr_range_delete (ADDR_RANGE * /*ar*/,
+ address_word /*start*/,
+ address_word /*end*/);
+
++/* TODO: This should get moved into sim-inline.h. */
++#ifdef HAVE_INLINE
++#ifdef SIM_ARANGE_C
++#define SIM_ARANGE_INLINE INLINE
++#else
++#define SIM_ARANGE_INLINE EXTERN_INLINE
++#endif
++#else
++#define SIM_ARANGE_INLINE EXTERN
++#endif
++
+ /* Return non-zero if ADDR is in range AR, traversing the entire tree.
+ If no range is specified, that is defined to mean "everything". */
+-extern INLINE int
++SIM_ARANGE_INLINE int
+ sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/);
+ #define ADDR_RANGE_HIT_P(ar, addr) \
+ ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr)))
+
+ #ifdef HAVE_INLINE
+-#ifdef SIM_ARANGE_C
+-#define SIM_ARANGE_INLINE INLINE
+-#else
+-#define SIM_ARANGE_INLINE EXTERN_INLINE
+-#endif
+ #include "sim-arange.c"
+-#else
+-#define SIM_ARANGE_INLINE
+ #endif
+ #define SIM_ARANGE_C_INCLUDED
+
+diff --git a/gdb-7.6/sim/common/sim-inline.h b/gdb-7.6/sim/common/sim-inline.h
+index af75562..8a9c286 100644
+--- a/gdb-7.6/sim/common/sim-inline.h
++++ b/gdb-7.6/sim/common/sim-inline.h
+@@ -303,7 +303,9 @@
+ /* ??? Temporary, pending decision to always use extern inline and do a vast
+ cleanup of inline support. */
+ #ifndef INLINE2
+-#if defined (__GNUC__)
++#if defined (__GNUC_GNU_INLINE__) || defined (__GNUC_STDC_INLINE__)
++#define INLINE2 __inline__ __attribute__ ((__gnu_inline__))
++#elif defined (__GNUC__)
+ #define INLINE2 __inline__
+ #else
+ #define INLINE2 /*inline*/
+--
+2.6.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch
new file mode 100644
index 000000000..77a287f14
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Backport
+
+https://sourceware.org/git/?p=binutils-gdb.git;h=0d8a6ab
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 0d8a6ab7d39d28fb1557e2a62e9e4b336341ab34 Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@iki.fi>
+Date: Mon, 17 Feb 2014 17:12:59 -0500
+Subject: [PATCH] sim: ppc: drop $(LIBS) from psim dependency
+
+When cross-compiling GDB for PPC, there's a prerequisite "-lz" for psim
+that results in a build failure. With such prerequisite, GNU Make will
+try to search the library from build machine's /usr/lib which is wrong.
+On 64-bit Linux build machines the compilation will fail because of this.
+
+URL: https://sourceware.org/bugzilla/show_bug.cgi?id=12202
+---
+ sim/ppc/Makefile.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/gdb-7.6/sim/ppc/Makefile.in b/gdb-7.6/sim/ppc/Makefile.in
+index b811f6f..740bdb0 100644
+--- a/gdb-7.6/sim/ppc/Makefile.in
++++ b/gdb-7.6/sim/ppc/Makefile.in
+@@ -552,7 +552,7 @@ PACKAGE_SRC = @sim_pk_src@
+ PACKAGE_OBJ = @sim_pk_obj@
+
+
+-psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(LIBINTL_DEP)
++psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
+ $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
+
+ run: psim
+--
+1.9.4
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.0.bb b/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.0.bb
new file mode 100644
index 000000000..9bea48e0d
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.0.bb
@@ -0,0 +1,115 @@
+SUMMARY = "Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles"
+DESCRIPTION = "The core analysis suite is a self-contained tool that can be used to\
+investigate either live systems, kernel core dumps created from the\
+netdump, diskdump and kdump packages from Red Hat Linux, the mcore kernel patch\
+offered by Mission Critical Linux, or the LKCD kernel patch."
+
+HOMEPAGE = "http://people.redhat.com/anderson"
+SECTION = "devel"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING3;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "zlib readline coreutils-native"
+
+SRC_URI = "https://github.com/crash-utility/${BPN}/archive/${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
+ http://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.gz;name=gdb;subdir=${BP} \
+ file://7001force_define_architecture.patch \
+ file://7003cross_ranlib.patch \
+ file://0001-cross_add_configure_option.patch \
+ file://sim-ppc-drop-LIBS-from-psim-dependency.patch \
+ file://sim-common-sim-arange-fix-extern-inline-handling.patch \
+ file://donnot-extract-gdb-during-do-compile.patch \
+ file://gdb_build_jobs_and_not_write_crash_target.patch \
+ file://remove-unrecognized-gcc-option-m32-for-mips.patch \
+ file://0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch \
+ file://0003-crash-detect-the-sysroot-s-glibc-header-file.patch \
+ "
+SRC_URI[md5sum] = "48899de3118e04cfa40a2364f5618193"
+SRC_URI[sha256sum] = "5d076e1fefb41aa178ad3e1cef6511670efc47de5cb04d4af9bdd4e8f2f18cbc"
+
+SRC_URI[gdb.md5sum] = "a9836707337e5f7bf76a009a8904f470"
+SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36"
+
+inherit gettext
+
+BBCLASSEXTEND = "native cross"
+TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"
+
+# crash 7.1.3 and before don't support mips64
+COMPATIBLE_HOST = "^(?!mips64).*"
+
+EXTRA_OEMAKE = 'RPMPKG="${PV}" \
+ GDB_TARGET="${TARGET_SYS}" \
+ GDB_HOST="${BUILD_SYS}" \
+ GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
+ LDFLAGS="${LDFLAGS}" \
+ '
+
+EXTRA_OEMAKE_class-cross = 'RPMPKG="${PV}" \
+ GDB_TARGET="${BUILD_SYS} \
+ \${GDB_CONF_FLAGS} \
+ --target=${TARGET_SYS}" \
+ GDB_HOST="${BUILD_SYS}" \
+ GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
+ '
+
+EXTRA_OEMAKE_append_class-native = " LDFLAGS='${BUILD_LDFLAGS}'"
+EXTRA_OEMAKE_append_class-cross = " LDFLAGS='${BUILD_LDFLAGS}'"
+
+REMOVE_M32 = "sed -i -e 's/#define TARGET_CFLAGS_ARM_ON_X86_64.*/#define TARGET_CFLAGS_ARM_ON_X86_64\t\"TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64\"/g' ${S}/configure.c"
+
+REMOVE_M32_class-cross = ""
+
+do_configure() {
+ :
+}
+
+do_compile_prepend() {
+ case ${TARGET_ARCH} in
+ aarch64*) ARCH=ARM64 ;;
+ arm*) ARCH=ARM ;;
+ i*86*) ARCH=X86 ;;
+ x86_64*) ARCH=X86_64 ;;
+ powerpc64*) ARCH=PPC64 ;;
+ powerpc*) ARCH=PPC ;;
+ mips*) ARCH=MIPS ;;
+ esac
+
+ sed -i s/FORCE_DEFINE_ARCH/"${ARCH}"/g ${S}/configure.c
+ ${REMOVE_M32}
+ sed -i 's/&gt;/>/g' ${S}/Makefile
+}
+
+do_compile() {
+ oe_runmake ${EXTRA_OEMAKE} RECIPE_SYSROOT=${RECIPE_SYSROOT}
+}
+
+do_install_prepend () {
+ install -d ${D}${bindir}
+ install -d ${D}/${mandir}/man8
+ install -d ${D}${includedir}/crash
+
+ install -m 0644 ${S}/crash.8 ${D}/${mandir}/man8/
+ install -m 0644 ${S}/defs.h ${D}${includedir}/crash
+}
+
+do_install_class-target () {
+ oe_runmake DESTDIR=${D} install
+}
+
+do_install_class-native () {
+ oe_runmake DESTDIR=${D}${STAGING_DIR_NATIVE} install
+}
+
+do_install_class-cross () {
+ install -m 0755 ${S}/crash ${D}/${bindir}
+}
+
+RDEPENDS_${PN} += "liblzma"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-cross = ""
+
+# Causes gcc to get stuck and eat all available memory in qemuarm builds
+# jenkins 15161 100 12.5 10389596 10321284 ? R 11:40 28:17 /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/cc1 -quiet -I . -I . -I ./common -I ./config -I ./../include/opcode -I ./../opcodes/.. -I ./../readline/.. -I ../bfd -I ./../bfd -I ./../include -I ../libdecnumber -I ./../libdecnumber -I ./gnulib/import -I build-gnulib/import -isysroot /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemuarm -MMD eval.d -MF .deps/eval.Tpo -MP -MT eval.o -D LOCALEDIR="/usr/local/share/locale" -D CRASH_MERGE -D HAVE_CONFIG_H -D TUI=1 eval.c -quiet -dumpbase eval.c -march=armv5te -mthumb -mthumb-interwork -mtls-dialect=gnu -auxbase-strip eval.o -g -O2 -Wall -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -feliminate-unused-debug-types -o -
+ARM_INSTRUCTION_SET = "arm"
diff --git a/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb b/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb
new file mode 100644
index 000000000..9f73d2799
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utility for IPMI control"
+DESCRIPTION = "This package contains a utility for interfacing with devices that support \
+the Intelligent Platform Management Interface specification. IPMI is \
+an open standard for machine health, inventory, and remote power control. \
+\
+This utility can communicate with IPMI-enabled devices through either a \
+kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in \
+the IPMI specification. IPMIv2 adds support for encrypted LAN \
+communications and remote Serial-over-LAN functionality. \
+\
+It provides commands for reading the Sensor Data Repository (SDR) and \
+displaying sensor values, displaying the contents of the System Event \
+Log (SEL), printing Field Replaceable Unit (FRU) information, reading and \
+setting LAN configuration, and chassis power control. \
+"
+
+HOMEPAGE = "http://ipmitool.sourceforge.net/"
+SECTION = "kernel/userland"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9aa91e13d644326bf281924212862184"
+
+DEPENDS = "openssl readline ncurses"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/ipmitool/ipmitool-${PV}.tar.bz2"
+SRC_URI[md5sum] = "bab7ea104c7b85529c3ef65c54427aa3"
+SRC_URI[sha256sum] = "0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01"
+
+inherit autotools
+
+# --disable-dependency-tracking speeds up the build
+# --enable-file-security adds some security checks
+# --disable-intf-free disables FreeIPMI support - we don't want to depend on
+# FreeIPMI libraries, FreeIPMI has its own ipmitoool-like utility.
+#
+EXTRA_OECONF = "--disable-dependency-tracking --enable-file-security --disable-intf-free"
diff --git a/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/fix_systemd_path.patch b/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/fix_systemd_path.patch
new file mode 100644
index 000000000..33116b3c0
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/fix_systemd_path.patch
@@ -0,0 +1,127 @@
+allow systemd path to be defined by configure option.
+
+The configure probes the host for systemd path information.
+
+Upstream Status: Inappropriate [Embedded]
+
+Signed-off-By: Armin Kuster <akuster@mvista.com>
+
+Index: ipmiutil-3.0.5/configure.ac
+===================================================================
+--- ipmiutil-3.0.5.orig/configure.ac
++++ ipmiutil-3.0.5/configure.ac
+@@ -149,7 +149,6 @@ CROSS_LFLAGS=""
+ CROSS_CFLAGS=""
+ LIBSENSORS=""
+ SAM2OBJ="isensor2.o ievents2.o"
+-SYSTEMD_DIR=/usr/share/ipmiutil
+
+ AC_ARG_ENABLE([useflags],
+ [ --enable-useflags include environment CFLAGS and LDFLAGS.],
+@@ -200,29 +199,42 @@ AC_ARG_ENABLE([gpl],
+
+ dnl Does this Linux have systemd enabled? Otherwise use sysv init.
+ AC_ARG_ENABLE([systemd],
+- [ --enable-systemd enable systemd service type=notify support and %_unitdir [[default=disabled]]],)
+-if test "x$enable_systemd" = "xyes"; then
+- GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD"
+- # if systemd enabled, install service scripts in unitdir
+- which rpm >/dev/null 2>&1
+- if test $? -eq 0 ; then
+- SYSTEMD_DIR=`rpm --eval "%{_unitdir}"`
+- else
+- SYSTEMD_DIR=/usr/share/ipmiutil
+- fi
++ [ --enable-systemd[=systemddir] install systemd unit file. If 'yes'
++ probe the system for unit directory.
++ If a path is specified, assume that
++ is a valid install path. [[default=disabled]]],)
++# Check whether --enable-systemd was given.
++if test "${enable_systemd+set}" = set; then :
++ withval=$enable_systemd; if test "$withval" = yes; then
++ GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD"
++ if test -z "$systemddir"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of the systemd unit files directory" >&5
++ $as_echo_n "checking location of the systemd unit files directory... " >&6; }
++ _rpmdir = ""
++ which rpm >/dev/null 2>&1
++ if test $? -eq 0 ; then
++ _rpmdir = `rpm --eval "%{_unitdir}"`
++ fi
++ for systemd_d in ${datadir}/usr/share/ipmiutil ${_rpmdir} /usr/share/ipmiutil; do
++ if test -z "$systemddir"; then
++ if test -d "$systemd_d"; then
++ systemddir="$systemd_d"
++ fi
++ fi
++ done
++ fi
++ if test -n "$systemddir"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $systemddir" >&5
++ $as_echo "$systemddir" >&6; }
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
++ $as_echo "not found" >&6; }
++ fi
+ else
+- # otherwise install the systemd service scripts in the data dir
+- SYSTEMD_DIR=/usr/share/ipmiutil
+- if test "x$sysname" != "xDarwin" ; then
+- if test "x$os" != "xhpux" ; then
+- # MacOS and HP-UX: 'which' command returns 0 always
+- which rpm >/dev/null 2>&1
+- if test $? -eq 0 ; then
+- datad=`rpm --eval "%{_datadir}"`
+- SYSTEMD_DIR=${datad}/ipmiutil
+- fi
+- fi
+- fi
++ if test "$withval" != no; then
++ systemddir=$withval
++ fi
++fi
+ fi
+
+ dnl start main logic
+@@ -528,7 +540,7 @@ AC_SUBST(INS_LIB)
+ AC_SUBST(SUBDIR_S)
+ AC_SUBST(CROSS_CFLAGS)
+ AC_SUBST(CROSS_LFLAGS)
+-AC_SUBST(SYSTEMD_DIR)
++AC_SUBST(systemddir)
+ AC_SUBST(SHR_LINK)
+ AC_SUBST(pkgconfigdir)
+
+Index: ipmiutil-3.0.5/scripts/Makefile.am
+===================================================================
+--- ipmiutil-3.0.5.orig/scripts/Makefile.am
++++ ipmiutil-3.0.5/scripts/Makefile.am
+@@ -17,7 +17,8 @@ cronto = ${DESTDIR}${etcdir}/cron.daily
+ sbinto = ${DESTDIR}${sbindir}
+ varto = ${DESTDIR}/var/lib/ipmiutil
+ initto = ${DESTDIR}@INIT_DIR@
+-sysdto = ${DESTDIR}@SYSTEMD_DIR@
++sysdto = ${DESTDIR}@systemddir@
++systemddir = @systemddir@
+ sysvinit = ${datato}
+ sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm iuser
+
+@@ -47,10 +48,14 @@ install:
+ ${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port
+ ${INSTALL_SCRIPT_SH} ipmi_info ${sysvinit}/ipmi_info
+ ${INSTALL_SCRIPT_SH} checksel ${datato}
+- ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto}
+- ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto}
+- ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto}
+- ${INSTALL_DATA_SH} ipmi_port.service ${sysdto}
++
++ if [ ! -z "${systemddir}" ]; then \
++ $(MKDIR) ${sysdto}; \
++ ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto}; \
++ ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto}; \
++ ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto}; \
++ ${INSTALL_DATA_SH} ipmi_port.service ${sysdto}; \
++ fi
+ ${INSTALL_SCRIPT_SH} ipmiutil.env ${datato}
+ ${INSTALL_SCRIPT_SH} ipmiutil.pre ${datato}
+ ${INSTALL_SCRIPT_SH} ipmiutil.setup ${datato}
diff --git a/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb b/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb
new file mode 100644
index 000000000..338cafd53
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb
@@ -0,0 +1,46 @@
+SUMMARY = "ipmiutil is an easy-to-use set of IPMI server management utilities.\
+It can get/set sensor thresholds, automate SEL management, do SOL console, etc."
+
+DESCRIPTION = "The IPMI Management Utilities currently work with platforms that \
+support the IPMI 1.5 or 2.0 specification. IPMI servers can be managed\
+locally, or remotely via IPMI LAN, even when the OS or main CPU is not\
+functional.\n \
+The ipmiutil utilities will use an IPMI Driver, either the Intel IPMI package \
+(ipmidrvr, /dev/imb), MontaVista OpenIPMI (/dev/ipmi0), the valinux IPMI \
+Driver (/dev/ipmikcs), or the LANDesk ldipmi daemon. The ipmiutil utilities \
+can also use direct user-space I/Os in Linux or FreeBSD if no IPMI driver \
+is detected."
+
+HOMEPAGE = "http://ipmiutil.sourceforge.net"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=626a5970304daa1fcb87f757fb42b795"
+
+DEPENDS += "openssl"
+
+PARALLEL_MAKE = ""
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/ipmiutil/ipmiutil-${PV}.tar.gz \
+ file://fix_systemd_path.patch \
+ "
+SRC_URI[md5sum] = "5feaf6a827205792e057bb4ff5c4e842"
+SRC_URI[sha256sum] = "b2d7f72535131c7832ba4be13dc33c81513fc3ee43fe797b4b52014600ecee5e"
+
+inherit autotools-brokensep pkgconfig systemd
+
+PACKAGECONFIG ?= "lanplus gpl"
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG[systemd] = "--enable-systemd=${datadir}/${BPN}, --enable-systemd=no"
+PACKAGECONFIG[sha256] = "--enable-sha256, --enable-sha256=no, openssl-native, openssl"
+PACKAGECONFIG[lanplus] = "--enable-lanplus, --enable-lanplus=no, openssl-native, openssl"
+PACKAGECONFIG[landesk] = "--enable-landesk, --enable-landesk=no"
+PACKAGECONFIG[sensors] = "--enable-libsensors, --enable-libsensors=no"
+
+#build with some GPL code
+PACKAGECONFIG[gpl] = "--enable-gpl, --enable-gpl=no"
+#no GPL or LanPlus libs
+PACKAGECONFIG[standalone] = "--enable-standalone, --enable-standalone=no"
+
+CFLAGS += "-I${STAGING_INCDIR}"
+LDFLAGS += "-L${STAGING_LIBDIR}"
+
+COMPATIBLE_HOST = '(x86_64|i.86).*-linux'
diff --git a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc
new file mode 100644
index 000000000..b1e73e954
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc
@@ -0,0 +1,49 @@
+SUMMARY = "Linux dynamic kernel patching infrastructure"
+DESCRIPTION = "kpatch is a Linux dynamic kernel patching infrastructure which allows you to patch a running kernel without rebooting or restarting any processes."
+LICENSE = "GPLv2 & LGPLv2"
+DEPENDS = "elfutils bash"
+
+SRC_URI = "git://github.com/dynup/kpatch.git;protocol=https \
+ file://0001-kpatch-build-add-cross-compilation-support.patch \
+ file://0002-kpatch-build-allow-overriding-of-distro-name.patch \
+ "
+
+EXTRA_OEMAKE = " \
+ PREFIX=${prefix} \
+ BINDIR=${D}${bindir} \
+ SBINDIR=${D}${sbindir} \
+ LIBDIR=${D}${libdir} \
+ MANDIR=${D}${mandir}/man1 \
+ SYSTEMDDIR=${D}${systemd_system_unitdir} \
+ DESTDIR=${D} \
+ BUILDMOD=no \
+ CC='${CC}' \
+ "
+
+S = "${WORKDIR}/git"
+
+do_install () {
+ oe_runmake install
+}
+
+PACKAGES =+ "kpatch-build"
+PROVIDES += "kpatch-build"
+
+COMPATIBLE_HOST = "(x86_64).*-linux"
+
+RDEPENDS_${PN} = "bash binutils"
+RDEPENDS_kpatch-build = "bash glibc-utils"
+
+FILES_${PN} = " \
+ ${sbindir}/kpatch \
+ ${systemd_system_unitdir}/kpatch.service \
+ ${mandir}/man1/kpatch.1.gz \
+ "
+FILES_kpatch-build = " \
+ ${bindir}/kpatch-build \
+ ${libexecdir}/* \
+ ${datadir}/kpatch \
+ ${mandir}/man1/kpatch-build.1.gz \
+ "
+
+SYSTEMD_SERVICE_${PN} = "kpatch.service"
diff --git a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch
new file mode 100644
index 000000000..459fb2197
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch
@@ -0,0 +1,103 @@
+From a9a80a1f4df65892a0269295ce8a64b06f2ff61d Mon Sep 17 00:00:00 2001
+From: Ruslan Bilovol <rbilovol@cisco.com>
+Date: Tue, 19 Dec 2017 15:59:04 +0200
+Subject: [PATCH] kpatch-build: add cross-compilation support
+
+This patch introduces new option for kpatch-build
+script "--cross-compile" which can be used for
+specifying cross-complier prefix.
+It allows to build live patches not only on
+target system, but also on hosts for a target other
+than the one on which the compiler is running
+
+Also removed quotes in exec lines, so it is
+possible to pass multy-component strings like
+"ccache x86_64-xelinux-linux-" as cross-compiler
+
+Upstream-Status: Pending
+
+Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
+---
+ kpatch-build/kpatch-build | 13 +++++++++++--
+ kpatch-build/kpatch-gcc | 4 ++--
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
+index 166ecbd..af24cc4 100755
+--- a/kpatch-build/kpatch-build
++++ b/kpatch-build/kpatch-build
+@@ -195,7 +195,7 @@ gcc_version_check() {
+ # gcc --version varies between distributions therefore extract version
+ # by compiling a test file and compare it to vmlinux's version.
+ echo 'void main(void) {}' > "$c"
+- out="$(gcc -c -pg -ffunction-sections -o "$o" "$c" 2>&1)"
++ out="$(${KPATCH_CROSS_COMPILE}gcc -c -pg -ffunction-sections -o "$o" "$c" 2>&1)"
+ gccver="$(gcc_version_from_file "$o")"
+ kgccver="$(gcc_version_from_file "$VMLINUX")"
+ rm -f "$c" "$o"
+@@ -381,12 +381,14 @@ usage() {
+ echo " -d, --debug Enable 'xtrace' and keep scratch files" >&2
+ echo " in <CACHEDIR>/tmp" >&2
+ echo " (can be specified multiple times)" >&2
++ echo " --cross-compile Specify the prefix used for all executables" >&2
++ echo " used during compilation" >&2
+ echo " --skip-cleanup Skip post-build cleanup" >&2
+ echo " --skip-gcc-check Skip gcc version matching check" >&2
+ echo " (not recommended)" >&2
+ }
+
+-options="$(getopt -o ha:r:s:c:v:j:t:n:o:d -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,debug,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed"
++options="$(getopt -o ha:r:s:c:v:j:t:n:o:d -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,debug,cross-compile:,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed"
+
+ eval set -- "$options"
+
+@@ -444,6 +446,10 @@ while [[ $# -gt 0 ]]; do
+ echo "DEBUG mode enabled"
+ fi
+ ;;
++ --cross-compile)
++ KPATCH_CROSS_COMPILE="$2"
++ shift
++ ;;
+ --skip-cleanup)
+ echo "Skipping cleanup"
+ SKIPCLEANUP=1
+@@ -691,6 +697,8 @@ if [[ $DEBUG -ge 4 ]]; then
+ export KPATCH_GCC_DEBUG=1
+ fi
+
++export KPATCH_CROSS_COMPILE
++
+ echo "Building original kernel"
+ ./scripts/setlocalversion --save-scmversion || die
+ make mrproper 2>&1 | logger || die
+@@ -840,6 +848,7 @@ cd "$TEMPDIR/patch" || die
+ KPATCH_BUILD="$SRCDIR" KPATCH_NAME="$MODNAME" \
+ KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS" \
+ KPATCH_LDFLAGS="$KPATCH_LDFLAGS" \
++CROSS_COMPILE="$KPATCH_CROSS_COMPILE" \
+ make 2>&1 | logger || die
+
+ if ! "$KPATCH_MODULE"; then
+diff --git a/kpatch-build/kpatch-gcc b/kpatch-build/kpatch-gcc
+index 6ba133c..3937948 100755
+--- a/kpatch-build/kpatch-gcc
++++ b/kpatch-build/kpatch-gcc
+@@ -8,7 +8,7 @@ TOOLCHAINCMD="$1"
+ shift
+
+ if [[ -z "$KPATCH_GCC_TEMPDIR" ]]; then
+- exec "$TOOLCHAINCMD" "$@"
++ exec ${KPATCH_CROSS_COMPILE}${TOOLCHAINCMD} "$@"
+ fi
+
+ declare -a args=("$@")
+@@ -80,4 +80,4 @@ elif [[ "$TOOLCHAINCMD" = "ld" ]] ; then
+ done
+ fi
+
+-exec "$TOOLCHAINCMD" "${args[@]}"
++exec ${KPATCH_CROSS_COMPILE}${TOOLCHAINCMD} "${args[@]}"
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch
new file mode 100644
index 000000000..a9d8a7f2c
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch
@@ -0,0 +1,62 @@
+From d418d716dae1e2a05131dfb42a19a4da2fc8a85d Mon Sep 17 00:00:00 2001
+From: Ruslan Bilovol <rbilovol@cisco.com>
+Date: Tue, 2 Jan 2018 14:50:03 +0200
+Subject: [PATCH] kpatch-build: allow overriding of distro name
+
+It is sometimes useful to have ability to override
+distro name, for example during cross-compilation
+build when livepatch modules will be ran on the
+target which differs from host.
+
+This patch adds a new --distro option which
+implements all needed functionality
+
+Upstream-Status: Pending
+
+Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
+---
+ kpatch-build/kpatch-build | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
+index af24cc4..4f9f78d 100755
+--- a/kpatch-build/kpatch-build
++++ b/kpatch-build/kpatch-build
+@@ -383,12 +383,13 @@ usage() {
+ echo " (can be specified multiple times)" >&2
+ echo " --cross-compile Specify the prefix used for all executables" >&2
+ echo " used during compilation" >&2
++ echo " --distro Override distro name" >&2
+ echo " --skip-cleanup Skip post-build cleanup" >&2
+ echo " --skip-gcc-check Skip gcc version matching check" >&2
+ echo " (not recommended)" >&2
+ }
+
+-options="$(getopt -o ha:r:s:c:v:j:t:n:o:d -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,debug,cross-compile:,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed"
++options="$(getopt -o ha:r:s:c:v:j:t:n:o:d -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,debug,cross-compile:,distro:,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed"
+
+ eval set -- "$options"
+
+@@ -450,6 +451,10 @@ while [[ $# -gt 0 ]]; do
+ KPATCH_CROSS_COMPILE="$2"
+ shift
+ ;;
++ --distro)
++ DISTRO="$2"
++ shift
++ ;;
+ --skip-cleanup)
+ echo "Skipping cleanup"
+ SKIPCLEANUP=1
+@@ -526,7 +531,7 @@ fi
+ # Don't check external file.
+ # shellcheck disable=SC1091
+ source /etc/os-release
+-DISTRO="$ID"
++DISTRO="${DISTRO:-${ID}}"
+ if [[ "$DISTRO" = fedora ]] || [[ "$DISTRO" = rhel ]] || [[ "$DISTRO" = ol ]] || [[ "$DISTRO" = centos ]]; then
+ [[ -z "$VMLINUX" ]] && VMLINUX="/usr/lib/debug/lib/modules/$ARCHVERSION/vmlinux"
+ [[ -e "$VMLINUX" ]] || die "kernel-debuginfo-$ARCHVERSION not installed"
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb
new file mode 100644
index 000000000..e495e2882
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb
@@ -0,0 +1,11 @@
+require kpatch.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRCREV = "db6efbb8c7e90d2b761272cf563047119072768f"
+
+PV = "0.5.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc b/meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc
new file mode 100644
index 000000000..9f14370cd
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc
@@ -0,0 +1,131 @@
+DESCRIPTION = "Linux Kernel"
+SECTION = "kernel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+INC_PR = "r0"
+
+inherit kernel siteinfo
+
+# Enable OABI compat for people stuck with obsolete userspace
+ARM_KEEP_OABI ?= "0"
+
+# Set the verbosity of kernel messages during runtime
+# You can define CMDLINE_DEBUG in your local.conf or distro.conf to override this behaviour
+CMDLINE_DEBUG ?= "loglevel=3"
+
+# Kernel bootlogo is distro-specific (default is OE logo).
+# Logo resolution (qvga, vga, ...) is machine-specific.
+LOGO_SIZE ?= '${@oe.utils.conditional("MACHINE_GUI_CLASS", "bigscreen", "vga", "qvga", d)}'
+# To use this, add file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 or similar
+# to your kernel recipe, and then structure your logos for each resolution
+# accordingly.
+
+LOCALVERSION ?= ""
+
+#kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""
+kernel_conf_variable() {
+ CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
+ if test "$2" = "n"
+ then
+ echo "# CONFIG_$1 is not set" >> ${B}/.config
+ else
+ echo "CONFIG_$1=$2" >> ${B}/.config
+ fi
+}
+
+do_configure_prepend() {
+ echo "" > ${B}/.config
+ CONF_SED_SCRIPT=""
+
+ #
+ # logo support, if you supply logo_linux_clut224.ppm in SRC_URI, then it's going to be used
+ #
+ if [ -e ${WORKDIR}/logo_linux_clut224.ppm ]; then
+ install -m 0644 ${WORKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm
+ kernel_conf_variable LOGO y
+ kernel_conf_variable LOGO_LINUX_CLUT224 y
+ fi
+
+ #
+ # oabi / eabi support
+ #
+ kernel_conf_variable AEABI y
+ if [ "${ARM_KEEP_OABI}" = "1" ] ; then
+ kernel_conf_variable OABI_COMPAT y
+ else
+ kernel_conf_variable OABI_COMPAT n
+ fi
+
+ # When enabling thumb for userspace we also need thumb support in the kernel
+ if [ "${ARM_INSTRUCTION_SET}" = "thumb" ] ; then
+ kernel_conf_variable ARM_THUMB y
+ fi
+
+ kernel_conf_variable CMDLINE "\"${CMDLINE} ${CMDLINE_DEBUG}\""
+
+ kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
+ kernel_conf_variable LOCALVERSION_AUTO n
+
+ kernel_conf_variable SYSFS_DEPRECATED n
+ kernel_conf_variable SYSFS_DEPRECATED_V2 n
+ kernel_conf_variable HOTPLUG y
+ kernel_conf_variable UEVENT_HELPER_PATH \"\"
+ kernel_conf_variable UNIX y
+ kernel_conf_variable SYSFS y
+ kernel_conf_variable PROC_FS y
+ kernel_conf_variable TMPFS y
+ kernel_conf_variable INOTIFY_USER y
+ kernel_conf_variable SIGNALFD y
+ kernel_conf_variable TMPFS_POSIX_ACL y
+ kernel_conf_variable BLK_DEV_BSG y
+ kernel_conf_variable DEVTMPFS y
+ kernel_conf_variable DEVTMPFS_MOUNT y
+
+ # Newer inits like systemd need cgroup support
+ if [ "${KERNEL_ENABLE_CGROUPS}" = "1" ] ; then
+ kernel_conf_variable CGROUP_SCHED y
+ kernel_conf_variable CGROUPS y
+ kernel_conf_variable CGROUP_NS y
+ kernel_conf_variable CGROUP_FREEZER y
+ kernel_conf_variable CGROUP_DEVICE y
+ kernel_conf_variable CPUSETS y
+ kernel_conf_variable PROC_PID_CPUSET y
+ kernel_conf_variable CGROUP_CPUACCT y
+ kernel_conf_variable RESOURCE_COUNTERS y
+ fi
+
+ #
+ # root-over-nfs-over-usb-eth support. Limited, but should cover some cases.
+ # Enable this by setting a proper CMDLINE_NFSROOT_USB.
+ #
+ if [ ! -z "${CMDLINE_NFSROOT_USB}" ]; then
+ bbnote "Configuring the kernel for root-over-nfs-over-usb-eth with CMDLINE ${CMDLINE_NFSROOT_USB}"
+ kernel_conf_variable INET y
+ kernel_conf_variable IP_PNP y
+ kernel_conf_variable USB_GADGET y
+ kernel_conf_variable USB_GADGET_SELECTED y
+ kernel_conf_variable USB_ETH y
+ kernel_conf_variable NFS_FS y
+ kernel_conf_variable ROOT_NFS y
+ kernel_conf_variable CMDLINE \"${CMDLINE_NFSROOT_USB} ${CMDLINE_DEBUG}\"
+ fi
+
+ sed -e "${CONF_SED_SCRIPT}" \
+ < '${WORKDIR}/defconfig' >>'${B}/.config'
+
+ yes '' | oe_runmake -C ${S} O=${B} oldconfig
+}
+
+do_configure_append() {
+ if test -e scripts/Makefile.fwinst ; then
+ sed -i -e "s:-m0644:-m 0644:g" scripts/Makefile.fwinst
+ fi
+}
+
+do_install_append() {
+ oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}/src/linux-${KERNEL_VERSION} ARCH=$ARCH
+}
+
+PACKAGES =+ "kernel-headers"
+FILES_kernel-headers = "${exec_prefix}/src/linux*"
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 <mingli.yu@windriver.com>
+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 <mingli.yu@windriver.com>
+---
+ 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 <alexandru.moise@windriver.com>
+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 <alexandru.moise@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ 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
+}
diff --git a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch
new file mode 100644
index 000000000..6ba6ad481
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch
@@ -0,0 +1,32 @@
+From 883f53ee33eaef8aca1288a110857402ad362966 Mon Sep 17 00:00:00 2001
+From: John Ogness <john.ogness@linutronix.de>
+Date: Fri, 8 Sep 2017 15:03:03 -0700
+Subject: [PATCH] fix compile error on arch=x32
+
+On the x32 architecture time_t is a "long long int". By
+ typecasting time_t to "long long", this should work correctly
+ for all architectures.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/minicoredumper/corestripper.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c
+index fd39bfb..07dc318 100644
+--- a/src/minicoredumper/corestripper.c
++++ b/src/minicoredumper/corestripper.c
+@@ -1241,7 +1241,7 @@ static int dump_compressed_tar(struct dump_info *di)
+ snprintf(hdr.mode, sizeof(hdr.mode), "%07o", 0644);
+ snprintf(hdr.uid, sizeof(hdr.uid), "%07o", 0);
+ snprintf(hdr.gid, sizeof(hdr.gid), "%07o", 0);
+- snprintf(hdr.mtime, sizeof(hdr.mtime), "%011lo",
++ snprintf(hdr.mtime, sizeof(hdr.mtime), "%011llo",
+ (long long)time(NULL));
+ memset(hdr.checksum, ' ', sizeof(hdr.checksum));
+ hdr.type = 'S';
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch
new file mode 100644
index 000000000..ad255fae0
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch
@@ -0,0 +1,29 @@
+From 6181d9c3c407ee030b4c3a94045318b9e3a3cc89 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 25 Jul 2017 14:08:54 -0700
+Subject: [PATCH] minicoredumper: Initialize pointer to config struct to null
+
+Fixes
+corestripper.c:3632:13: error: variable 'cfg' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/minicoredumper/corestripper.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c
+index a764073..ddb0d25 100644
+--- a/src/minicoredumper/corestripper.c
++++ b/src/minicoredumper/corestripper.c
+@@ -3605,7 +3605,7 @@ out:
+
+ static int do_all_dumps(struct dump_info *di, int argc, char *argv[])
+ {
+- struct config *cfg;
++ struct config *cfg = 0;
+ const char *recept;
+ bool live_dumper;
+ char *comm_base;
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init
new file mode 100644
index 000000000..9c96e3156
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# minicoredumper This shell script takes care of starting and stopping minicoredumper.
+#
+# chkconfig: 2345 24 89
+# description: minicoredumper.
+#
+# processname:
+# config: /etc/minicoredumper/
+
+### BEGIN INIT INFO
+# Provides: minicoredumper
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Should-Start: $syslog $network
+# Should-Stop: $syslog $network
+# Short-Description:
+# Description:
+### END INIT INFO
+
+. /etc/init.d/functions
+
+case "$1" in
+ start)
+ echo "|/usr/sbin/minicoredumper %p %u %g %s %t %h %e" > /proc/sys/kernel/core_pattern
+ ;;
+ stop)
+ echo "core" > /proc/sys/kernel/core_pattern
+ ;;
+ status)
+ if grep -q minicoredumper /proc/sys/kernel/core_pattern ; then
+ echo "minicoredumper is running"
+ else
+ echo "minicoredumper is stopped"
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status}"
+ exit 2
+esac
diff --git a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service
new file mode 100644
index 000000000..45d098f29
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Enable minicoredumper.
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/sh -c '/bin/echo "|/usr/sbin/minicoredumper %%p %%u %%g %%s %%t %%h %%e" > /proc/sys/kernel/core_pattern'
+ExecStop=/bin/sh -c '/bin/echo "core" > /proc/sys/kernel/core_pattern'
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb
new file mode 100644
index 000000000..0d3c66b07
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb
@@ -0,0 +1,45 @@
+SUMMARY = "minicoredumper provides an alternate core dump facility for Linux \
+to allow minimal and customized crash dumps"
+LICENSE = " LGPLv2.1 & BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=aa846ae365f71b69e9fa0d21a56391ec \
+ file://COPYING.BSD;md5=b915ac80d5236d6aa659cb986daf00e5 \
+ file://COPYING.LGPLv2.1;md5=321bf41f280cf805086dd5a720b37785 \
+ "
+DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux json-c"
+
+inherit autotools pkgconfig systemd update-rc.d
+
+SRCREV = "cdc1faf1212a51e89b477468876e229223fceb9a"
+
+PR .= "+git${SRCPV}"
+
+SRC_URI = "git://git.linuxfoundation.org/diamon/minicoredumper.git;protocol=http \
+ file://minicoredumper.service \
+ file://minicoredumper.init \
+ file://0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch \
+ file://0001-fix-compile-error-on-arch-x32.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+SYSTEMD_SERVICE_${PN} = "minicoredumper.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "minicoredumper"
+INITSCRIPT_PARAMS_${PN} = "defaults 89"
+
+do_install_append() {
+ rmdir ${D}${localstatedir}/run
+ install -d ${D}/${sysconfdir}/minicoredumper
+ cp -rf ${S}/etc/* ${D}/${sysconfdir}/
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/minicoredumper.service ${D}${systemd_system_unitdir}
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/minicoredumper.init ${D}${sysconfdir}/init.d/minicoredumper
+
+ # correct path of minicoredumper
+ sed -i -e s:/usr/bin/minicoredumper:${sbindir}/minicoredumper:g ${D}${sysconfdir}/init.d/minicoredumper
+ sed -i -e s:/usr/bin/minicoredumper:${sbindir}/minicoredumper:g ${D}${systemd_system_unitdir}/minicoredumper.service
+}
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc
new file mode 100644
index 000000000..4b01654fa
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc
@@ -0,0 +1,65 @@
+SUMMARY = "System-Wide Profiler"
+DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
+of profiling all running code at low overhead."
+HOMEPAGE = "http://oprofile.sourceforge.net/news/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191"
+
+LICENSE = "LGPLv2.1+ & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \
+ "
+SECTION = "devel"
+
+DEPENDS = "popt binutils"
+RDEPENDS_${PN} = "binutils-symlinks"
+RRECOMMENDS_${PN} = "kernel-vmlinux"
+
+FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}"
+FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+ file://acinclude.m4 \
+ file://automake-foreign.patch \
+ file://oprofile-cross-compile-tests.patch \
+ file://run-ptest \
+ file://root-home-dir.patch \
+ file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \
+ file://0001-Fix-FTBFS-problem-with-GCC-6.patch \
+"
+UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/"
+UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/"
+
+SRC_URI_append_libc-musl = " file://musl.patch"
+
+inherit autotools pkgconfig ptest
+
+EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC="
+do_configure () {
+ cp ${WORKDIR}/acinclude.m4 ${S}/
+ autotools_do_configure
+}
+
+EXTRA_OEMAKE = "SRCDIR=${PTEST_PATH}/libutil++/tests"
+do_compile_ptest() {
+ oe_runmake check
+}
+
+do_install_ptest() {
+ subdirs="libdb/tests libutil++/tests libregex/tests libutil/tests libop/tests libdb/tests "
+ for tooltest in ${subdirs}
+ do
+ find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH}
+ done
+
+ # needed by some libop tests
+ cp -r events ${D}${PTEST_PATH}
+
+ # needed by libregex regex_test
+ cp libregex/stl.pat ${D}${PTEST_PATH}/libregex
+ cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests
+
+ # needed by litutil++ file_manip_tests
+ cp ${S}/libutil++/tests/file_manip_tests.cpp \
+ libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests
+}
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch
new file mode 100644
index 000000000..ae8562a23
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch
@@ -0,0 +1,30 @@
+From 34b0d9b1a32fb404a30327a7ae8931c7c75583bf Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Tue, 9 Feb 2016 02:00:29 +0100
+Subject: [PATCH] Add rmb() definition for NIOS2 architecture
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted [ http://marc.info/?l=oprofile-list&m=145501915931874&w=2 ]
+---
+ libperf_events/operf_utils.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h
+index 32954cc..8270e53 100644
+--- a/libperf_events/operf_utils.h
++++ b/libperf_events/operf_utils.h
+@@ -178,6 +178,11 @@ void op_release_resources(void);
+ #define cpu_relax() asm volatile("" ::: "memory")
+ #endif
+
++#ifdef __nios2__
++#define rmb() asm volatile("" ::: "memory")
++#define cpu_relax() asm volatile("" ::: "memory")
++#endif
++
+ #ifdef __tile__
+ #include <asm/unistd.h>
+ #define rmb() __insn_mf()
+--
+2.7.0
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch
new file mode 100644
index 000000000..d372fd527
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch
@@ -0,0 +1,51 @@
+From 39d4d46a0bd504ac708ffe72df87bf74cd12ad30 Mon Sep 17 00:00:00 2001
+From: William Cohen <wcohen@redhat.com>
+Date: Fri, 5 Feb 2016 17:30:19 -0500
+Subject: [PATCH] Fix FTBFS problem with GCC-6
+
+GCC-6 is pickier about some of the type conversions causing the Fedora
+24 mass rebuild the build of oprofile failed with:
+
+make[3]: Entering directory '/builddir/build/BUILD/oprofile-1.1.0/libutil++'
+g++ -DHAVE_CONFIG_H -I. -I.. -I ../libutil -I ../libop -I ../libpp -W -Wall -fno-common -ftemplate-depth-50 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c -o op_bfd.o op_bfd.cpp
+op_bfd.cpp: In member function 'void op_bfd::get_symbol_range(symbol_index_t, long long unsigned int&, long long unsigned int&) const':
+op_bfd.cpp:538:47: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'const bool' in initialization
+ bool const verbose = cverb << (vbfd & vlevel1);
+ ^
+op_bfd.cpp:546:7: error: in argument to unary !
+ if (!verbose)
+ ^~~~~~~
+
+Avoid the intermediate bool type to make GCC-6 happy.
+
+Signed-off-by: William Cohen <wcohen@redhat.com>
+---
+Upstream-Status: Backport
+
+ libutil++/op_bfd.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libutil++/op_bfd.cpp b/libutil++/op_bfd.cpp
+index 389c920..f2eb42b 100644
+--- a/libutil++/op_bfd.cpp
++++ b/libutil++/op_bfd.cpp
+@@ -535,15 +535,13 @@ void op_bfd::get_symbol_range(symbol_index_t sym_idx,
+ {
+ op_bfd_symbol const & sym = syms[sym_idx];
+
+- bool const verbose = cverb << (vbfd & vlevel1);
+-
+ if (anon_obj)
+ start = sym.vma();
+ else
+ start = sym.filepos();
+ end = start + sym.size();
+
+- if (!verbose)
++ if (!(cverb << (vbfd & vlevel1)))
+ return;
+
+ io_state state(cverb << (vbfd & vlevel1));
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4 b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4
new file mode 100644
index 000000000..95ecd91b5
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4
@@ -0,0 +1,581 @@
+dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
+dnl see if autoconf.h defines the option
+AC_DEFUN([AX_KERNEL_OPTION], [
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+AC_TRY_COMPILE( [#include <linux/config.h>],
+[
+#ifndef $1
+break_me_hard(\\\);
+#endif
+],[$2],[$3],)
+CFLAGS=$SAVE_CFLAGS
+])
+
+dnl Handle the 2.4 module inside module/
+AC_DEFUN([AX_CONFIG_MODULE],
+[
+if test ! -f $KINC/linux/autoconf.h; then
+ AC_MSG_ERROR([no suitably configured kernel include tree found])
+fi
+
+dnl --- Get Linux kernel version and compile parameters ---
+
+AC_SUBST(KVERS)
+AC_MSG_CHECKING([for kernel version])
+dnl it's like this to handle mandrake's fubar version.h - bug #471448
+eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
+AC_MSG_RESULT([$KVERS])
+case "$KVERS" in
+2.2.*|2.4.*) ;;
+*) AC_MSG_ERROR([Unsupported kernel version])
+esac
+
+dnl Check for the minimal kernel version supported
+AC_MSG_CHECKING([kernel version])
+AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
+
+dnl linux/spinlock.h added at some point in past
+AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
+if test -f $KINC/linux/spinlock.h; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+AC_MSG_CHECKING([for rtc_lock])
+gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
+if test "$?" -eq 0; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+arch="unknown"
+AC_MSG_CHECKING(for x86-64 architecture)
+AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0)
+AX_MSG_RESULT_YN($x8664)
+BUILD_HAMMER=no
+if test "$x8664" -eq 1; then
+ arch="x86"
+ BUILD_HAMMER=yes
+else
+ AC_MSG_CHECKING(for x86 architecture)
+ AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
+ AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
+ AX_MSG_RESULT_YN($x86)
+ test "$x86" = 1 && arch="x86"
+
+ if test "$arch" = "unknown"; then
+ AC_MSG_CHECKING(for ia64 architecture)
+ AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
+ AX_MSG_RESULT_YN($ia64)
+ test "$ia64" = 1 && arch="ia64"
+ fi
+
+fi
+AC_SUBST(BUILD_HAMMER)
+
+test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
+
+dnl check to see if kernel verion appropriate for arch
+AC_MSG_CHECKING(arch/kernel version combination)
+case "$arch" in
+ia64)
+ AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
+ AC_MSG_ERROR([unsupported arch/kernel])) ;;
+*) AC_MSG_RESULT([ok])
+esac
+
+dnl for now we do not support PREEMPT patch
+AC_MSG_CHECKING([for preempt patch])
+AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
+AX_MSG_RESULT_YN([$preempt])
+test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
+
+AC_SUBST(KINC)
+
+MODINSTALLDIR=/lib/modules/$KVERS
+
+OPROFILE_MODULE_ARCH=$arch
+AC_SUBST(OPROFILE_MODULE_ARCH)
+]
+)
+
+dnl AX_MSG_RESULT_YN(a)
+dnl results "yes" iff a==1, "no" else
+AC_DEFUN([AX_MSG_RESULT_YN], [x=no
+test "x$1" = "x1" && x=yes
+AC_MSG_RESULT($x)])
+
+dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
+AC_DEFUN([AX_MALLOC_ATTRIBUTE],
+[
+AC_MSG_CHECKING([whether malloc attribute is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_COMPILE(,[
+void monkey() __attribute__((malloc));
+],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+]
+)
+
+dnl builtin_expect is used in module we can't add that in config.h
+AC_DEFUN([AX_BUILTIN_EXPECT],
+[
+AC_MSG_CHECKING([whether __builtin_expect is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_LINK(,[
+int i;
+if (__builtin_expect(i, 0)) { }
+],
+AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
+AC_MSG_RESULT([no]);)
+CFLAGS=$SAVE_CFLAGS
+]
+)
+
+dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
+AC_DEFUN([AX_EXTRA_DIRS],
+[
+AC_ARG_WITH(extra-includes,
+[ --with-extra-includes=DIR add extra include paths],
+ use_extra_includes="$withval",
+ use_extra_includes=NO
+)
+if test -n "$use_extra_includes" && \
+ test "$use_extra_includes" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_includes; do
+ extra_includes="$extra_includes -I$dir"
+ done
+ IFS=$ac_save_ifs
+ CPPFLAGS="$CPPFLAGS $extra_includes"
+fi
+
+AC_ARG_WITH(extra-libs,
+[ --with-extra-libs=DIR add extra library paths],
+ use_extra_libs=$withval,
+ use_extra_libs=NO
+)
+if test -n "$use_extra_libs" && \
+ test "$use_extra_libs" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_libs; do
+ extra_libraries="$extra_libraries -L$dir"
+ done
+ IFS=$ac_save_ifs
+ LDFLAGS="$LDFLAGS $extra_libraries"
+fi
+]
+)
+
+dnl AX_POPT_CONST - check popt prototype
+AC_DEFUN([AX_POPT_CONST],
+[
+AC_MSG_CHECKING([popt prototype])
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-Werror $CXXFLAGS"
+AC_TRY_COMPILE([#include <popt.h>],
+[
+int c; char **v;
+poptGetContext(0, c, v, 0, 0);
+],
+AC_MSG_RESULT([takes char **]);,
+AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
+CXXFLAGS="$SAVE_CXXFLAGS"
+]
+)
+
+dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
+AC_DEFUN([AX_CHECK_SSTREAM],
+[
+AC_MSG_CHECKING([whether to use included sstream])
+AC_TRY_COMPILE([#include <sstream>], [],
+AC_MSG_RESULT([no]);,
+AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
+]
+)
+
+dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
+dnl exec action-if-true if typedef_name is a typedef to type else exec
+dnl action-if-false
+dnl currently work only with type typedef'ed in stddef.h
+AC_DEFUN([AX_CHECK_TYPEDEF], [
+dnl AC_LANG_PUSH(C) not in autoconf 2.13
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+
+AC_TRY_COMPILE(
+ [
+ #include <stddef.h>
+ ],
+ [
+ typedef void (*fct1)($1);
+ typedef void (*fct2)($2);
+ fct1 f1 = 0;
+ fct2 f2 = 0;
+ if (f1 == f2) {}
+ ],
+[$3],[$4])
+
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
+dnl set var_name to the typedef name of $1 which must be in canditate_list
+dnl else produce a fatal error
+AC_DEFUN([AX_TYPEDEFED_NAME], [
+ AC_MSG_CHECKING([type of $1])
+ for f in $2; do
+ AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
+ if test -n "${$3}"; then
+ break
+ fi
+ done
+ if test -n "${$3}"; then
+ AC_MSG_RESULT([${$3}])
+ else
+ AC_MSG_ERROR([not found])
+ fi
+])
+
+dnl find a binary in the path
+AC_DEFUN([QT_FIND_PATH],
+[
+ AC_MSG_CHECKING([for $1])
+ AC_CACHE_VAL(qt_cv_path_$1,
+ [
+ qt_cv_path_$1="NONE"
+ if test -n "$$2"; then
+ qt_cv_path_$1="$$2";
+ else
+ dirs="$3"
+ qt_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ IFS=$qt_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/$1"; then
+ if test -n "$5"; then
+ evalstr="$dir/$1 $5 2>&1 "
+ if eval $evalstr; then
+ qt_cv_path_$1="$dir/$1"
+ break
+ fi
+ else
+ qt_cv_path_$1="$dir/$1"
+ break
+ fi
+ fi
+ done
+ fi
+ ])
+
+ if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
+ AC_MSG_RESULT(not found)
+ $4
+ else
+ AC_MSG_RESULT($qt_cv_path_$1)
+ $2=$qt_cv_path_$1
+ fi
+])
+
+dnl Find the uic compiler on the path or in qt_cv_dir
+AC_DEFUN([QT_FIND_UIC],
+[
+ QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
+ if test -z "$ac_uic" -a "$FATAL" = 1; then
+ AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
+ fi
+])
+
+dnl Find the right moc in path/qt_cv_dir
+AC_DEFUN([QT_FIND_MOC],
+[
+ QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
+ QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
+
+ if test -n "$ac_moc1" -a -n "$ac_moc2"; then
+ dnl found both. Prefer Qt3's if it exists else moc2
+ $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
+ if test "$?" = 0; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ else
+ if test -n "$ac_moc1"; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ fi
+
+ if test -z "$ac_moc" -a "$FATAL" = 1; then
+ AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
+ fi
+])
+
+dnl check a particular libname
+AC_DEFUN([QT_TRY_LINK],
+[
+ SAVE_LIBS="$LIBS"
+ LIBS="$LIBS $1"
+ AC_TRY_LINK([
+ #include <qglobal.h>
+ #include <qstring.h>
+ ],
+ [
+ QString s("mangle_failure");
+ #if (QT_VERSION < 221)
+ break_me_(\\\);
+ #endif
+ ],
+ qt_cv_libname=$1,
+ )
+ LIBS="$SAVE_LIBS"
+])
+
+dnl check we can do a compile
+AC_DEFUN([QT_CHECK_COMPILE],
+[
+ AC_MSG_CHECKING([for Qt library name])
+
+ AC_CACHE_VAL(qt_cv_libname,
+ [
+ AC_LANG_CPLUSPLUS
+ SAVE_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
+
+ for libname in -lqt-mt -lqt3 -lqt2 -lqt;
+ do
+ QT_TRY_LINK($libname)
+ if test -n "$qt_cv_libname"; then
+ break;
+ fi
+ done
+
+ CXXFLAGS=$SAVE_CXXFLAGS
+ ])
+
+ if test -z "$qt_cv_libname"; then
+ AC_MSG_RESULT([failed])
+ if test "$FATAL" = 1 ; then
+ AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
+ fi
+ else
+ AC_MSG_RESULT([$qt_cv_libname])
+ fi
+])
+
+dnl get Qt version we're using
+AC_DEFUN([QT_GET_VERSION],
+[
+ AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
+ [
+ AC_LANG_CPLUSPLUS
+ SAVE_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
+
+ cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+#include <qglobal.h>
+"%%%"QT_VERSION_STR"%%%"
+EOF
+ lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
+ grep '^"%%%"' 2>/dev/null | \
+ sed -e 's/"%%%"//g' -e 's/"//g'`
+ rm -f conftest.$ac_ext
+ CPPFLAGS=$SAVE_CPPFLAGS
+ ])
+
+ QT_VERSION=$lyx_cv_qtversion
+ AC_SUBST(QT_VERSION)
+])
+
+dnl start here
+AC_DEFUN([QT_DO_IT_ALL],
+[
+ dnl Please leave this alone. I use this file in
+ dnl oprofile.
+ FATAL=0
+
+ AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ],
+ [ qt_cv_dir=`eval echo "$withval"/` ])
+
+ AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ],
+ [ qt_cv_includes=`eval echo "$withval"` ])
+
+ AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.],
+ [ qt_cv_libraries=`eval echo "$withval"` ])
+
+ dnl pay attention to $QTDIR unless overridden
+ if test -z "$qt_cv_dir"; then
+ qt_cv_dir=$QTDIR
+ fi
+
+ dnl derive inc/lib if needed
+ if test -n "$qt_cv_dir"; then
+ if test -z "$qt_cv_includes"; then
+ qt_cv_includes=$qt_cv_dir/include
+ fi
+ if test -z "$qt_cv_libraries"; then
+ qt_cv_libraries=$qt_cv_dir/lib
+ fi
+ fi
+
+ dnl flags for compilation
+ QT_INCLUDES=
+ QT_LDFLAGS=
+ if test -n "$qt_cv_includes"; then
+ QT_INCLUDES="-I$qt_cv_includes"
+ fi
+ if test -n "$qt_cv_libraries"; then
+ QT_LDFLAGS="-L$qt_cv_libraries"
+ fi
+ AC_SUBST(QT_INCLUDES)
+ AC_SUBST(QT_LDFLAGS)
+
+ QT_FIND_MOC
+ MOC=$ac_moc
+ AC_SUBST(MOC)
+ QT_FIND_UIC
+ UIC=$ac_uic
+ AC_SUBST(UIC)
+
+ QT_CHECK_COMPILE
+
+ QT_LIB=$qt_cv_libname;
+ AC_SUBST(QT_LIB)
+
+ if test -n "$qt_cv_libname"; then
+ QT_GET_VERSION
+ fi
+])
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
+AC_MSG_CHECKING([whether ${CXX} support precompiled header])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+dnl we consider than if -Winvalid-pch is accepted pch will works ...
+CXXFLAGS=-Winvalid-pch
+dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
+dnl the fact than some pch will be invalid for the given compilation option
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_CHECK_DOCBOOK
+AC_DEFUN([AX_CHECK_DOCBOOK], [
+# It's just rude to go over the net to build
+XSLTPROC_FLAGS=--nonet
+DOCBOOK_ROOT=
+if test ! -f /etc/xml/catalog; then
+ for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
+ do
+ if test -d "$i"; then
+ DOCBOOK_ROOT=$i
+ fi
+ done
+
+ # Last resort - try net
+ if test -z "$DOCBOOK_ROOT"; then
+ XSLTPROC_FLAGS=
+ fi
+else
+ XML_CATALOG=/etc/xml/catalog
+ CAT_ENTRY_START='<!--'
+ CAT_ENTRY_END='-->'
+fi
+
+AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
+XSLTPROC_WORKS=no
+if test -n "$XSLTPROC"; then
+ AC_MSG_CHECKING([whether xsltproc works])
+
+ if test -n "$XML_CATALOG"; then
+ DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+ else
+ DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
+ fi
+
+ $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="test">
+</book>
+END
+ if test "$?" = 0; then
+ XSLTPROC_WORKS=yes
+ fi
+ AC_MSG_RESULT($XSLTPROC_WORKS)
+fi
+AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
+
+AC_SUBST(XML_CATALOG)
+AC_SUBST(XSLTPROC_FLAGS)
+AC_SUBST(DOCBOOK_ROOT)
+AC_SUBST(CAT_ENTRY_START)
+AC_SUBST(CAT_ENTRY_END)
+])
+
+dnl AX_CFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CC support it.
+AC_DEFUN([AX_CFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CC} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CXXFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CXX} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_COPY_IF_CHANGE(source, dest)
+dnl copy source to dest if they don't compare equally or if dest doesn't exist
+AC_DEFUN([AX_COPY_IF_CHANGE], [
+if test -r $2; then
+ if cmp $1 $2 > /dev/null; then
+ echo $2 is unchanged
+ else
+ cp -f $1 $2
+ fi
+else
+ cp -f $1 $2
+fi
+])
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch
new file mode 100644
index 000000000..b9bb6c577
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch
@@ -0,0 +1,12 @@
+oprofile doesn't want GNU-levels of automake strictness so tell it to be "foreign".
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 5740585..cf6c316 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -16 +16 @@ AC_CONFIG_SRCDIR([libop/op_config.h])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch
new file mode 100644
index 000000000..51db40845
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch
@@ -0,0 +1,46 @@
+Fix glibc-isms so that oprofile builds with musl.
+
+Patch taken from openwrt (https://github.com/openwrt-mirror/openwrt/blob/master/package/devel/oprofile/patches/100-musl.patch)
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- a/pe_profiling/operf.cpp
++++ b/pe_profiling/operf.cpp
+@@ -857,11 +857,14 @@ static int __delete_old_previous_sample_
+ int tflag __attribute__((unused)),
+ struct FTW *ftwbuf __attribute__((unused)))
+ {
++ int err;
++
+ if (remove(fpath)) {
++ err = errno;
+ perror("sample data removal error");
+- return FTW_STOP;
++ return err;
+ } else {
+- return FTW_CONTINUE;
++ return 0;
+ }
+ }
+
+@@ -896,7 +899,7 @@ static void convert_sample_data(void)
+ return;
+
+ if (!operf_options::append) {
+- int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
++ int flags = FTW_DEPTH;
+ errno = 0;
+ if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
+ errno != ENOENT) {
+--- a/libop/op_events.c
++++ b/libop/op_events.c
+@@ -83,7 +83,7 @@ static int parse_hex(char const * str)
+ static u64 parse_long_hex(char const * str)
+ {
+ u64 value;
+- if (sscanf(str, "%Lx", &value) != 1)
++ if (sscanf(str, "0x%llx", &value) != 1)
+ parse_error("expected long hexadecimal value");
+
+ fflush(stderr);
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
new file mode 100644
index 000000000..aefa9548e
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
@@ -0,0 +1,98 @@
+Prevent running check tests on host if cross compiling
+
+This patch enables running the 'make check' tests on the target
+in a cross-compiled environment. If not cross-compiling, then 'make
+ check' builds and executes the tests; no change from this patch.
+In a cross-compiling environment, the make variable CROSS_COMPILE is
+set which bypasses assiging tests to the makekfile variable TESTS.
+Since TESTS is empty, the 'make check' process never tries to run the
+tests on the hosts. On the target, the tests must be run manually.
+
+Also, in the libutil++ tests, a makefile variable SRCDIR is passed into
+the compilation phase, pointing to the runtime location of the test
+'file-manip-tests'. The mechanism used for a host test, based on
+'topdir' doesn't work. Instead, if CROSS_COMPILE is set, the
+makefile takes the path of SRCDIR from the build environment and not
+from an expression based on the host path 'topdir'.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index 41ece64..ce5a16f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -392,6 +392,7 @@ AC_ARG_ENABLE(account-check,
+ enable_account_check=$enableval, enable_account_check=yes)
+
+ AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes")
++AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes")
+
+ AC_SUBST(OP_CFLAGS)
+ AC_SUBST(OP_CXXFLAGS)
+diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am
+index 8a69003..d820090 100644
+--- a/libdb/tests/Makefile.am
++++ b/libdb/tests/Makefile.am
+@@ -13,4 +13,6 @@ check_PROGRAMS = db_test
+ db_test_SOURCES = db_test.c
+ db_test_LDADD = ../libodb.a ../../libutil/libutil.a
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am
+index 8a79eb5..6d417c4 100644
+--- a/libop/tests/Makefile.am
++++ b/libop/tests/Makefile.am
+@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS}
+ mangle_tests_SOURCES = mangle_tests.c
+ mangle_tests_LDADD = ${COMMON_LIBS}
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS} utf8_checker.sh
++endif
+diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am
+index 6f19838..1d176f9 100644
+--- a/libregex/tests/Makefile.am
++++ b/libregex/tests/Makefile.am
+@@ -18,4 +18,6 @@ java_test_LDADD = \
+
+ EXTRA_DIST = mangled-name.in
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am
+index 51af031..a01ea2d 100644
+--- a/libutil++/tests/Makefile.am
++++ b/libutil++/tests/Makefile.am
+@@ -1,7 +1,9 @@
+
+ REALPATH= readlink -f
+
++if ! CROSS_COMPILE
+ SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
++endif
+
+ AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@
+@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS}
+ utility_tests_SOURCES = utility_tests.cpp
+ utility_tests_LDADD = ${COMMON_LIBS}
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am
+index dfcd6ec..e8831b5 100644
+--- a/libutil/tests/Makefile.am
++++ b/libutil/tests/Makefile.am
+@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a
+ string_tests_SOURCES = string_tests.c
+ string_tests_LDADD = ../libutil.a
+
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch
new file mode 100644
index 000000000..3eaf6a794
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch
@@ -0,0 +1,44 @@
+oprofile: Determine the root home directory dynamically
+
+This commit detects the root home directory dynamically with changes to
+the oprofile gui app source.
+
+The commit replaces an earlier fix that detected and adjusted a
+'non-standard' root home directory at build time. The advantage of this
+patch is that the oprofile tools are adjusted to the current run-time
+path to ~root, not the build time path.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+Index: oprofile-1.0.0/doc/oprofile.html
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.html 2014-11-03 17:55:31.511034857 +0000
++++ oprofile-1.0.0/doc/oprofile.html 2014-11-03 17:57:26.415037988 +0000
+@@ -1563,8 +1563,8 @@
+ <span class="emphasis"><em>must</em></span> stop it in a controlled manner in order to process
+ the profile data it has collected. Use <code class="code">kill -SIGINT &lt;operf-PID&gt;</code>
+ for this purpose. It is recommended that when running <span class="command"><strong>operf</strong></span>
+- with this option, your current working directory should be <code class="filename">/root</code> or a subdirectory
+- of <code class="filename">/root</code> to avoid storing sample data files in locations accessible by regular users.
++ with this option, your current working directory should be <code class="filename">~root</code> or a subdirectory
++ of <code class="filename">~root</code> to avoid storing sample data files in locations accessible by regular users.
+ </p>
+ </dd>
+ <dt>
+Index: oprofile-1.0.0/doc/oprofile.xml
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.xml 2014-11-03 17:55:31.515034857 +0000
++++ oprofile-1.0.0/doc/oprofile.xml 2014-11-03 17:58:03.719039005 +0000
+@@ -654,8 +654,8 @@
+ <emphasis>must</emphasis> stop it in a controlled manner in order to process
+ the profile data it has collected. Use <code>kill -SIGINT &lt;operf-PID&gt;</code>
+ for this purpose. It is recommended that when running <command>operf</command>
+- with this option, your current working directory should be <filename>/root</filename> or a subdirectory
+- of <filename>/root</filename> to avoid storing sample data files in locations accessible by regular users.
++ with this option, your current working directory should be <filename>~root</filename> or a subdirectory
++ of <filename>~root</filename> to avoid storing sample data files in locations accessible by regular users.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest
new file mode 100644
index 000000000..4814be652
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+saved_dir=$PWD
+for dir in */tests ; do
+ cd $dir
+ for atest in * ; do
+ if [ \( -x $atest \) -a \( -f $atest \) ] ; then
+ ./$atest > ${atest}.stdout 2> ${atest}.stderr
+ if [ $? = 0 ] ; then
+ echo "PASS: $dir $atest"
+ rm ${atest}.stdout ${atest}.stderr
+ else
+ echo "FAIL: ${dir}/${atest}"
+ fi
+ fi
+ done
+ cd $saved_dir
+done
+
diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb
new file mode 100644
index 000000000..92a94ad0d
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb
@@ -0,0 +1,10 @@
+require oprofile.inc
+
+DEPENDS += "virtual/kernel"
+DEPENDS_append_powerpc64 = " libpfm4"
+
+SRC_URI[md5sum] = "248c4c069f9476f427fa7195563f9867"
+SRC_URI[sha256sum] = "cf759a6de1a6033d5dfc93bda129a9f2e128aecc4238cc657feb0801d1b0366c"
+
+S = "${WORKDIR}/oprofile-${PV}"
+
OpenPOWER on IntegriCloud