From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- .../recipes-kernel/agent-proxy/agent-proxy_git.bb | 25 + .../files/0001-Makefile-Add-LDFLAGS-variable.patch | 43 ++ .../meta-oe/recipes-kernel/bpftool/bpftool.bb | 33 ++ .../broadcom-bt-firmware_git.bb | 76 +++ .../meta-oe/recipes-kernel/cpupower/cpupower.bb | 35 ++ .../crash/0001-cross_add_configure_option.patch | 35 ++ ...uild-error-unknown-type-name-gdb_fpregset.patch | 36 ++ ...sh-detect-the-sysroot-s-glibc-header-file.patch | 33 ++ .../crash/7001force_define_architecture.patch | 13 + .../crash/crash/7003cross_ranlib.patch | 10 + .../crash/crash/config-site.crash-7.0.9 | 1 + .../donnot-extract-gdb-during-do-compile.patch | 32 ++ ...gdb_build_jobs_and_not_write_crash_target.patch | 26 + ...move-unrecognized-gcc-option-m32-for-mips.patch | 33 ++ ...mon-sim-arange-fix-extern-inline-handling.patch | 79 +++ .../sim-ppc-drop-LIBS-from-psim-dependency.patch | 37 ++ .../meta-oe/recipes-kernel/crash/crash_7.2.4.bb | 120 +++++ .../ipmitool/0001-Migrate-to-openssl-1.1.patch | 152 ++++++ .../recipes-kernel/ipmitool/ipmitool_1.8.18.bb | 38 ++ .../ipmiutil/ipmiutil/fix_systemd_path.patch | 127 +++++ .../recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb | 46 ++ .../kernel-selftest/kernel-selftest.bb | 123 +++++ .../kernel-selftest/kernel-selftest/COPYING | 18 + .../kernel-selftest/kernel-selftest/run-ptest | 11 + .../kernel-selftest/userfaultfd.patch | 322 ++++++++++++ .../meta-oe/recipes-kernel/kpatch/kpatch.inc | 51 ++ ...patch-build-add-cross-compilation-support.patch | 101 ++++ ...tch-build-allow-overriding-of-distro-name.patch | 60 +++ .../meta-oe/recipes-kernel/kpatch/kpatch_git.bb | 11 + .../meta-oe/recipes-kernel/linux/linux.inc | 131 +++++ ...0001-makedumpfile-replace-hardcode-CFLAGS.patch | 132 +++++ ...-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch | 72 +++ .../makedumpfile/makedumpfile_1.6.4.bb | 57 ++ ...per-Initialize-pointer-to-config-struct-t.patch | 29 + .../minicoredumper/files/minicoredumper.init | 40 ++ .../minicoredumper/files/minicoredumper.service | 11 + .../minicoredumper/minicoredumper_2.0.0.bb | 47 ++ .../meta-oe/recipes-kernel/oprofile/oprofile.inc | 65 +++ ...Add-rmb-definition-for-NIOS2-architecture.patch | 30 ++ .../recipes-kernel/oprofile/oprofile/acinclude.m4 | 581 +++++++++++++++++++++ .../oprofile/oprofile/automake-foreign.patch | 12 + .../recipes-kernel/oprofile/oprofile/musl.patch | 46 ++ .../oprofile/oprofile-cross-compile-tests.patch | 98 ++++ .../oprofile/oprofile/root-home-dir.patch | 44 ++ .../recipes-kernel/oprofile/oprofile/run-ptest | 19 + .../recipes-kernel/oprofile/oprofile_1.3.0.bb | 10 + .../recipes-kernel/turbostat/turbostat/COPYING | 18 + .../recipes-kernel/turbostat/turbostat_3.4.bb | 57 ++ 48 files changed, 3226 insertions(+) create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_git.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9 create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.4.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-Migrate-to-openssl-1.1.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/fix_systemd_path.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING create mode 100755 external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.4.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4 create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat/COPYING create mode 100644 external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb (limited to 'external/meta-openembedded/meta-oe/recipes-kernel') diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb b/external/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/agent-proxy_git.bb new file mode 100644 index 00000000..8e370f96 --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch b/external/meta-openembedded/meta-oe/recipes-kernel/agent-proxy/files/0001-Makefile-Add-LDFLAGS-variable.patch new file mode 100644 index 00000000..5eec91d7 --- /dev/null +++ b/external/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 +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 +--- + 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/external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb b/external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb new file mode 100644 index 00000000..dd7eaa2a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb @@ -0,0 +1,33 @@ +SUMMARY = "Inspect and manipulate eBPF programs and maps" +DESCRIPTION = "bpftool is a kernel tool for inspection and simple manipulation \ +of eBPF programs and maps." +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" +DEPENDS = "binutils elfutils" +PROVIDES = "virtual/bpftool" + +inherit bash-completion kernelsrc kernel-arch + +do_populate_lic[depends] += "virtual/kernel:do_patch" + +EXTRA_OEMAKE = "-C ${S}/tools/bpf/bpftool O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}" + +do_configure[depends] += "virtual/kernel:do_shared_workdir" + +COMPATIBLE_HOST_libc-musl = 'null' + +do_compile() { + oe_runmake +} + +do_install() { + oe_runmake DESTDIR=${D} install +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +python do_package_prepend() { + d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0]) +} + +B = "${WORKDIR}/${BPN}-${PV}" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_git.bb b/external/meta-openembedded/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_git.bb new file mode 100644 index 00000000..8c474ecd --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_git.bb @@ -0,0 +1,76 @@ +# Copyright (C) 2018 Krzysztof Kozlowski +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "Broadcom Bluetooth firmware files" +DESCRIPTION = "Firmware for Broadcom Bluetooth devices. Note that in case of BT+WiFi devices, separate WiFi firmware might be needed." +HOMEPAGE = "https://github.com/winterheart/broadcom-bt-firmware" + +LICENSE = "Firmware-Broadcom-WIDCOMM" +NO_GENERIC_LICENSE[Firmware-Broadcom-WIDCOMM] = "LICENSE.broadcom_bcm20702" + +LIC_FILES_CHKSUM = "file://LICENSE.broadcom_bcm20702;md5=c0d5ea0502b00df74173d0f8a48b619d" +SRC_URI = "git://github.com/winterheart/broadcom-bt-firmware.git" +SRCREV = "c0bd928b8ae5754b6077c99afe6ef5c949a58f32" +PE = "1" +PV = "0.0+git${SRCPV}" + +S = "${WORKDIR}/git" + +inherit allarch + +CLEANBROKEN = "1" + +do_compile() { + : +} + +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/brcm/ + cp brcm/*.hcd ${D}${nonarch_base_libdir}/firmware/brcm/ + + # For license package: + install -m 0644 LICENSE.broadcom_bcm20702 ${D}${nonarch_base_libdir}/firmware/brcm/ + + # For main package: + install -m 0644 DEVICES.md ${D}${nonarch_base_libdir}/firmware/brcm/ +} + +PACKAGES =+ " \ + ${PN}-bcm20702a1 \ + ${PN}-bcm20702b0 \ + ${PN}-bcm20703a1 \ + ${PN}-bcm43142a0 \ + ${PN}-bcm4335c0 \ + ${PN}-bcm4350c5 \ + ${PN}-bcm4356a2 \ + ${PN}-bcm4371c2 \ + ${PN}-license \ +" + +RDEPENDS_${PN}-bcm20702a1 = "${PN}-license" +RDEPENDS_${PN}-bcm20702b0 = "${PN}-license" +RDEPENDS_${PN}-bcm20703a1 = "${PN}-license" +RDEPENDS_${PN}-bcm43142a0 = "${PN}-license" +RDEPENDS_${PN}-bcm4335c0 = "${PN}-license" +RDEPENDS_${PN}-bcm4350c5 = "${PN}-license" +RDEPENDS_${PN}-bcm4356a2 = "${PN}-license" +RDEPENDS_${PN}-bcm4371c2 = "${PN}-license" + +FILES_${PN}-bcm20702a1 = "${nonarch_base_libdir}/firmware/brcm/BCM20702A1*hcd" +FILES_${PN}-bcm20702b0 = "${nonarch_base_libdir}/firmware/brcm/BCM20702B0*hcd" +FILES_${PN}-bcm20703a1 = "${nonarch_base_libdir}/firmware/brcm/BCM20703A1*hcd" +FILES_${PN}-bcm43142a0 = "${nonarch_base_libdir}/firmware/brcm/BCM43142A0*hcd" +FILES_${PN}-bcm4335c0 = "${nonarch_base_libdir}/firmware/brcm/BCM4335C0*hcd" +FILES_${PN}-bcm4350c5 = "${nonarch_base_libdir}/firmware/brcm/BCM4350C5*hcd" +FILES_${PN}-bcm4356a2 = "${nonarch_base_libdir}/firmware/brcm/BCM4356A2*hcd" +FILES_${PN}-bcm4371c2 = "${nonarch_base_libdir}/firmware/brcm/BCM4371C2*hcd" +FILES_${PN}-license += "${nonarch_base_libdir}/firmware/brcm/LICENSE.broadcom_bcm20702" + +FILES_${PN} += "${nonarch_base_libdir}/firmware/brcm/*" +RDEPENDS_${PN} += "${PN}-license" + +# Make broadcom-bt-firmware depend on all of the split-out packages. +python populate_packages_prepend () { + firmware_pkgs = oe.utils.packages_filter_out_system(d) + d.appendVar('RDEPENDS_broadcom-bt-firmware', ' ' + ' '.join(firmware_pkgs)) +} diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb b/external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb new file mode 100644 index 00000000..dd465036 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb @@ -0,0 +1,35 @@ +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" +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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch new file mode 100644 index 00000000..26a34e5c --- /dev/null +++ b/external/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 +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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch new file mode 100644 index 00000000..8355fe44 --- /dev/null +++ b/external/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 +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 +--- + 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 ++#include "gregset.h" + + #ifdef HAVE_PROC_SERVICE_H + #include +@@ -53,8 +54,6 @@ + #include + #endif + +-#include "gregset.h" +- + /* Functions in this interface return one of these status codes. */ + typedef enum + { +-- +2.8.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch new file mode 100644 index 00000000..1f4bd01d --- /dev/null +++ b/external/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 +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 +--- + 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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch new file mode 100644 index 00000000..0d44c7f1 --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch new file mode 100644 index 00000000..d567fa0a --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9 b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9 new file mode 100644 index 00000000..d6fc22fb --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch new file mode 100644 index 00000000..e254fe87 --- /dev/null +++ b/external/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 +--- +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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch new file mode 100644 index 00000000..aa5f44dd --- /dev/null +++ b/external/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 + +Upstream-Status: Pending + +Don't write ${TARGET} to crash.target which causes rebuild fails. + +Signed-off-by: Kai Kang +-- +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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch new file mode 100644 index 00000000..905b4c2c --- /dev/null +++ b/external/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 +--- +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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch new file mode 100644 index 00000000..0185b570 --- /dev/null +++ b/external/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 +-- +From 92fc6153a6fdf2a027d9780f5945712aafad4a9e Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +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 +Reported-by: Joel Sherrill +--- + 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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch new file mode 100644 index 00000000..77a287f1 --- /dev/null +++ b/external/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 +--- +From 0d8a6ab7d39d28fb1557e2a62e9e4b336341ab34 Mon Sep 17 00:00:00 2001 +From: Aaro Koskinen +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/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.4.bb b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.4.bb new file mode 100644 index 00000000..c72b1a32 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.4.bb @@ -0,0 +1,120 @@ +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] = "4f66eb0e9a82ff83de06ac2b37501f5c" +SRC_URI[sha256sum] = "85ca2e93f1ee628ef2499ab9c78623f8b04500bdf7378c09de19283f6a7a698f" + +SRC_URI[gdb.md5sum] = "a9836707337e5f7bf76a009a8904f470" +SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36" + +UPSTREAM_CHECK_URI = "https://github.com/crash-utility/crash/releases" + +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/>/>/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" + +# http://errors.yoctoproject.org/Errors/Details/186964/ +EXCLUDE_FROM_WORLD_libc-musl = "1" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-Migrate-to-openssl-1.1.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-Migrate-to-openssl-1.1.patch new file mode 100644 index 00000000..394aa16a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-Migrate-to-openssl-1.1.patch @@ -0,0 +1,152 @@ +From c9dcb6afef9c343d070aaff208d11a997a45a105 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 5 Sep 2018 22:19:38 -0700 +Subject: [PATCH] Migrate to openssl 1.1 + +Upstream-Status: Backport [https://sourceforge.net/p/ipmitool/source/ci/1664902525a1c3771b4d8b3ccab7ea1ba6b2bdd1/] + +Signed-off-by: Khem Raj +--- + src/plugins/lanplus/lanplus_crypt_impl.c | 50 ++++++++++++++---------- + 1 file changed, 29 insertions(+), 21 deletions(-) + +diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c +index d5fac37..9652a5e 100644 +--- a/src/plugins/lanplus/lanplus_crypt_impl.c ++++ b/src/plugins/lanplus/lanplus_crypt_impl.c +@@ -164,11 +164,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, + uint8_t * output, + uint32_t * bytes_written) + { +- EVP_CIPHER_CTX ctx; +- EVP_CIPHER_CTX_init(&ctx); +- EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); +- EVP_CIPHER_CTX_set_padding(&ctx, 0); +- ++ EVP_CIPHER_CTX *ctx = NULL; + + *bytes_written = 0; + +@@ -182,6 +178,14 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, + printbuf(input, input_length, "encrypting this data"); + } + ++ ctx = EVP_CIPHER_CTX_new(); ++ if (ctx == NULL) { ++ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed"); ++ return; ++ } ++ EVP_CIPHER_CTX_init(ctx); ++ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); ++ EVP_CIPHER_CTX_set_padding(ctx, 0); + + /* + * The default implementation adds a whole block of padding if the input +@@ -191,28 +195,28 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, + assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); + + +- if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) ++ if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) + { + /* Error */ + *bytes_written = 0; +- return; + } + else + { + uint32_t tmplen; + +- if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) ++ if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) + { ++ /* Error */ + *bytes_written = 0; +- return; /* Error */ + } + else + { + /* Success */ + *bytes_written += tmplen; +- EVP_CIPHER_CTX_cleanup(&ctx); + } + } ++ /* performs cleanup and free */ ++ EVP_CIPHER_CTX_free(ctx); + } + + +@@ -239,11 +243,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, + uint8_t * output, + uint32_t * bytes_written) + { +- EVP_CIPHER_CTX ctx; +- EVP_CIPHER_CTX_init(&ctx); +- EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); +- EVP_CIPHER_CTX_set_padding(&ctx, 0); +- ++ EVP_CIPHER_CTX *ctx = NULL; + + if (verbose >= 5) + { +@@ -252,12 +252,20 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, + printbuf(input, input_length, "decrypting this data"); + } + +- + *bytes_written = 0; + + if (input_length == 0) + return; + ++ ctx = EVP_CIPHER_CTX_new(); ++ if (ctx == NULL) { ++ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed"); ++ return; ++ } ++ EVP_CIPHER_CTX_init(ctx); ++ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); ++ EVP_CIPHER_CTX_set_padding(ctx, 0); ++ + /* + * The default implementation adds a whole block of padding if the input + * data is perfectly aligned. We would like to keep that from happening. +@@ -266,33 +274,33 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, + assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); + + +- if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) ++ if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) + { + /* Error */ + lprintf(LOG_DEBUG, "ERROR: decrypt update failed"); + *bytes_written = 0; +- return; + } + else + { + uint32_t tmplen; + +- if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) ++ if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) + { ++ /* Error */ + char buffer[1000]; + ERR_error_string(ERR_get_error(), buffer); + lprintf(LOG_DEBUG, "the ERR error %s", buffer); + lprintf(LOG_DEBUG, "ERROR: decrypt final failed"); + *bytes_written = 0; +- return; /* Error */ + } + else + { + /* Success */ + *bytes_written += tmplen; +- EVP_CIPHER_CTX_cleanup(&ctx); + } + } ++ /* performs cleanup and free */ ++ EVP_CIPHER_CTX_free(ctx); + + if (verbose >= 5) + { diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb new file mode 100644 index 00000000..b7f1aa91 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb @@ -0,0 +1,38 @@ +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 \ + file://0001-Migrate-to-openssl-1.1.patch \ + " +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/external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/fix_systemd_path.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/fix_systemd_path.patch new file mode 100644 index 00000000..33116b3c --- /dev/null +++ b/external/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 + +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/external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb b/external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil_3.0.5.bb new file mode 100644 index 00000000..338cafd5 --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb new file mode 100644 index 00000000..181e97ca --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb @@ -0,0 +1,123 @@ +SUMMARY = "Kernel selftest for Linux" +DESCRIPTION = "Kernel selftest for Linux" +LICENSE = "GPLv2" + +LIC_FILES_CHKSUM = "file://../COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" + +DEPENDS = "rsync-native llvm-native" + +# for musl libc +SRC_URI_append_libc-musl = "\ + file://userfaultfd.patch \ + " +SRC_URI += "file://run-ptest \ + file://COPYING \ + " + +# now we just test bpf and vm +# we will append other kernel selftest in the future +# bpf was added in 4.10 with: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d +# if you have older kernel than that you need to remove it from PACKAGECONFIG +PACKAGECONFIG ??= "bpf vm" +PACKAGECONFIG_remove_x86 = "bpf" +PACKAGECONFIG_remove_arm = "bpf" + +PACKAGECONFIG[bpf] = ",,elfutils libcap libcap-ng rsync-native," +PACKAGECONFIG[vm] = ",,libcap,libgcc bash" + +do_patch[depends] += "virtual/kernel:do_shared_workdir" + +inherit linux-kernel-base kernel-arch ptest + +S = "${WORKDIR}/${BP}" + +TEST_LIST = "\ + ${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \ +" + +EXTRA_OEMAKE = '\ + CROSS_COMPILE=${TARGET_PREFIX} \ + ARCH=${ARCH} \ + CC="${CC}" \ + AR="${AR}" \ + LD="${LD}" \ + DESTDIR="${D}" \ +' + +KERNEL_SELFTEST_SRC ?= "Makefile \ + include \ + tools \ + scripts \ + arch \ + LICENSES \ +" + +python __anonymous () { + import re + + var = d.getVar('TARGET_CC_ARCH') + pattern = '_FORTIFY_SOURCE=[^0]' + + if re.search(pattern, var): + d.appendVar('TARGET_CC_ARCH', " -O") +} + +do_compile() { + bbwarn "clang >= 6.0 with bpf support is needed with kernel 4.18+ so \ +either install it and add it to HOSTTOOLS, or add \ +clang-native from meta-clang to dependency" + for i in ${TEST_LIST} + do + oe_runmake -C ${S}/tools/testing/selftests/${i} + done +} + +do_install() { + for i in ${TEST_LIST} + do + oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/usr/kernel-selftest/${i} install + done + if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then + sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py + fi + chown root:root -R ${D}/usr/kernel-selftest +} + +do_configure() { + install -D -m 0644 ${WORKDIR}/COPYING ${S}/COPYING +} + +do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated" +python copy_kselftest_source_from_kernel() { + sources = (d.getVar("KERNEL_SELFTEST_SRC") or "").split() + src_dir = d.getVar("STAGING_KERNEL_DIR") + dest_dir = d.getVar("S") + bb.utils.mkdirhier(dest_dir) + for s in sources: + src = oe.path.join(src_dir, s) + dest = oe.path.join(dest_dir, s) + if os.path.isdir(src): + oe.path.copytree(src, dest) + else: + bb.utils.copyfile(src, dest) +} + +remove_unrelated() { + if ${@bb.utils.contains('PACKAGECONFIG','bpf','true','false',d)} ; then + test -f ${S}/tools/testing/selftests/bpf/Makefile && \ + sed -i -e 's/test_pkt_access.*$/\\/' \ + -e 's/test_pkt_md_access.*$/\\/' \ + -e 's/sockmap_verdict_prog.*$/\\/' \ + ${S}/tools/testing/selftests/bpf/Makefile || \ + bberror "Your kernel is probably older than 4.10 and doesn't have tools/testing/selftests/bpf/Makefile file from https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d, disable bpf PACKAGECONFIG" + fi +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +INHIBIT_PACKAGE_DEBUG_SPLIT="1" +FILES_${PN} += "/usr/kernel-selftest" + +RDEPENDS_${PN} += "python3" +# tools/testing/selftests/vm/Makefile doesn't respect LDFLAGS and tools/testing/selftests/Makefile explicitly overrides to empty +INSANE_SKIP_${PN} += "ldflags" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING new file mode 100644 index 00000000..da4cb28f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING @@ -0,0 +1,18 @@ +The Linux Kernel is provided under: + + SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note + +Being under the terms of the GNU General Public License version 2 only, +according with: + + LICENSES/preferred/GPL-2.0 + +With an explicit syscall exception, as stated at: + + LICENSES/exceptions/Linux-syscall-note + +In addition, other licenses may also apply. Please see: + + Documentation/process/license-rules.rst + +for more details. diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest new file mode 100755 index 00000000..d40b9576 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest @@ -0,0 +1,11 @@ +#!/bin/sh +export PATH=$PATH:/usr/kernel-selftest/bpf + +# test_align +test_align | grep "12 pass" &> /dev/null +if [ $? == 0 ]; then + echo "[PASS]: test_align" +else + echo "[FAIL]: test_align" +fi + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch new file mode 100644 index 00000000..bed20510 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch @@ -0,0 +1,322 @@ +From c7b375747cffb627d02543d946b28525455d7d46 Mon Sep 17 00:00:00 2001 +From: "Hongzhi.Song" +Date: Fri, 13 Jul 2018 06:06:19 -0700 +Subject: [PATCH] vm: add some funtions to support musl libc + +Signed-off-by: Hongzhi.Song +--- + tools/testing/selftests/vm/userfaultfd.c | 298 +++++++++++++++++++++++++++++++ + 1 file changed, 298 insertions(+) + +diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c +index de2f9ec..dc73021 100644 +--- a/tools/testing/selftests/vm/userfaultfd.c ++++ b/tools/testing/selftests/vm/userfaultfd.c +@@ -71,6 +71,304 @@ + + #ifdef __NR_userfaultfd + ++/* Linear congruential. */ ++#define TYPE_0 0 ++#define BREAK_0 8 ++#define DEG_0 0 ++#define SEP_0 0 ++ ++/* x**7 + x**3 + 1. */ ++#define TYPE_1 1 ++#define BREAK_1 32 ++#define DEG_1 7 ++#define SEP_1 3 ++ ++/* x**15 + x + 1. */ ++#define TYPE_2 2 ++#define BREAK_2 64 ++#define DEG_2 15 ++#define SEP_2 1 ++ ++/* x**31 + x**3 + 1. */ ++#define TYPE_3 3 ++#define BREAK_3 128 ++#define DEG_3 31 ++#define SEP_3 3 ++ ++/* x**63 + x + 1. */ ++#define TYPE_4 4 ++#define BREAK_4 256 ++#define DEG_4 63 ++#define SEP_4 1 ++ ++/* Array versions of the above information to make code run faster. ++ Relies on fact that TYPE_i == i. */ ++ ++#define MAX_TYPES 5 /* Max number of types above. */ ++ ++#define __set_errno(val) (errno = (val)) ++ ++struct random_data ++ { ++ int32_t *fptr; /* Front pointer. */ ++ int32_t *rptr; /* Rear pointer. */ ++ int32_t *state; /* Array of state values. */ ++ int rand_type; /* Type of random number generator. */ ++ int rand_deg; /* Degree of random number generator. */ ++ int rand_sep; /* Distance between front and rear. */ ++ int32_t *end_ptr; /* Pointer behind state table. */ ++ }; ++ ++struct random_poly_info ++{ ++ int seps[MAX_TYPES]; ++ int degrees[MAX_TYPES]; ++}; ++ ++static const struct random_poly_info random_poly_info = ++{ ++ { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }, ++ { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 } ++}; ++ ++/* If we are using the trivial TYPE_0 R.N.G., just do the old linear ++ congruential bit. Otherwise, we do our fancy trinomial stuff, which is the ++ same in all the other cases due to all the global variables that have been ++ set up. The basic operation is to add the number at the rear pointer into ++ the one at the front pointer. Then both pointers are advanced to the next ++ location cyclically in the table. The value returned is the sum generated, ++ reduced to 31 bits by throwing away the "least random" low bit. ++ Note: The code takes advantage of the fact that both the front and ++ rear pointers can't wrap on the same call by not testing the rear ++ pointer if the front one has wrapped. Returns a 31-bit random number. */ ++ ++int random_r (struct random_data *buf, int32_t *result) ++{ ++ int32_t *state; ++ ++ if (buf == NULL || result == NULL) ++ goto fail; ++ ++ state = buf->state; ++ ++ if (buf->rand_type == TYPE_0) ++ { ++ int32_t val = ((state[0] * 1103515245U) + 12345U) & 0x7fffffff; ++ state[0] = val; ++ *result = val; ++ } ++ else ++ { ++ int32_t *fptr = buf->fptr; ++ int32_t *rptr = buf->rptr; ++ int32_t *end_ptr = buf->end_ptr; ++ uint32_t val; ++ ++ val = *fptr += (uint32_t) *rptr; ++ /* Chucking least random bit. */ ++ *result = val >> 1; ++ ++fptr; ++ if (fptr >= end_ptr) ++ { ++ fptr = state; ++ ++rptr; ++ } ++ else ++ { ++ ++rptr; ++ if (rptr >= end_ptr) ++ rptr = state; ++ } ++ buf->fptr = fptr; ++ buf->rptr = rptr; ++ } ++ return 0; ++ ++ fail: ++ __set_errno (EINVAL); ++ return -1; ++} ++ ++/* Initialize the random number generator based on the given seed. If the ++ type is the trivial no-state-information type, just remember the seed. ++ Otherwise, initializes state[] based on the given "seed" via a linear ++ congruential generator. Then, the pointers are set to known locations ++ that are exactly rand_sep places apart. Lastly, it cycles the state ++ information a given number of times to get rid of any initial dependencies ++ introduced by the L.C.R.N.G. Note that the initialization of randtbl[] ++ for default usage relies on values produced by this routine. */ ++int srandom_r (unsigned int seed, struct random_data *buf) ++{ ++ int type; ++ int32_t *state; ++ long int i; ++ int32_t word; ++ int32_t *dst; ++ int kc; ++ ++ if (buf == NULL) ++ goto fail; ++ type = buf->rand_type; ++ if ((unsigned int) type >= MAX_TYPES) ++ goto fail; ++ ++ state = buf->state; ++ /* We must make sure the seed is not 0. Take arbitrarily 1 in this case. */ ++ if (seed == 0) ++ seed = 1; ++ state[0] = seed; ++ if (type == TYPE_0) ++ goto done; ++ ++ dst = state; ++ word = seed; ++ kc = buf->rand_deg; ++ for (i = 1; i < kc; ++i) ++ { ++ /* This does: ++ state[i] = (16807 * state[i - 1]) % 2147483647; ++ but avoids overflowing 31 bits. */ ++ long int hi = word / 127773; ++ long int lo = word % 127773; ++ word = 16807 * lo - 2836 * hi; ++ if (word < 0) ++ word += 2147483647; ++ *++dst = word; ++ } ++ ++ buf->fptr = &state[buf->rand_sep]; ++ buf->rptr = &state[0]; ++ kc *= 10; ++ while (--kc >= 0) ++ { ++ int32_t discard; ++ (void) random_r (buf, &discard); ++ } ++ ++ done: ++ return 0; ++ ++ fail: ++ return -1; ++} ++ ++/* Initialize the state information in the given array of N bytes for ++ future random number generation. Based on the number of bytes we ++ are given, and the break values for the different R.N.G.'s, we choose ++ the best (largest) one we can and set things up for it. srandom is ++ then called to initialize the state information. Note that on return ++ from srandom, we set state[-1] to be the type multiplexed with the current ++ value of the rear pointer; this is so successive calls to initstate won't ++ lose this information and will be able to restart with setstate. ++ Note: The first thing we do is save the current state, if any, just like ++ setstate so that it doesn't matter when initstate is called. ++ Returns 0 on success, non-zero on failure. */ ++int initstate_r (unsigned int seed, char *arg_state, size_t n, ++ struct random_data *buf) ++{ ++ if (buf == NULL) ++ goto fail; ++ ++ int32_t *old_state = buf->state; ++ if (old_state != NULL) ++ { ++ int old_type = buf->rand_type; ++ if (old_type == TYPE_0) ++ old_state[-1] = TYPE_0; ++ else ++ old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type; ++ } ++ ++ int type; ++ if (n >= BREAK_3) ++ type = n < BREAK_4 ? TYPE_3 : TYPE_4; ++ else if (n < BREAK_1) ++ { ++ if (n < BREAK_0) ++ goto fail; ++ ++ type = TYPE_0; ++ } ++ else ++ type = n < BREAK_2 ? TYPE_1 : TYPE_2; ++ ++ int degree = random_poly_info.degrees[type]; ++ int separation = random_poly_info.seps[type]; ++ ++ buf->rand_type = type; ++ buf->rand_sep = separation; ++ buf->rand_deg = degree; ++ int32_t *state = &((int32_t *) arg_state)[1]; /* First location. */ ++ /* Must set END_PTR before srandom. */ ++ buf->end_ptr = &state[degree]; ++ ++ buf->state = state; ++ ++ srandom_r (seed, buf); ++ ++ state[-1] = TYPE_0; ++ if (type != TYPE_0) ++ state[-1] = (buf->rptr - state) * MAX_TYPES + type; ++ ++ return 0; ++ ++ fail: ++ __set_errno (EINVAL); ++ return -1; ++} ++ ++/* Restore the state from the given state array. ++ Note: It is important that we also remember the locations of the pointers ++ in the current state information, and restore the locations of the pointers ++ from the old state information. This is done by multiplexing the pointer ++ location into the zeroth word of the state information. Note that due ++ to the order in which things are done, it is OK to call setstate with the ++ same state as the current state ++ Returns 0 on success, non-zero on failure. */ ++int setstate_r (char *arg_state, struct random_data *buf) ++{ ++ int32_t *new_state = 1 + (int32_t *) arg_state; ++ int type; ++ int old_type; ++ int32_t *old_state; ++ int degree; ++ int separation; ++ ++ if (arg_state == NULL || buf == NULL) ++ goto fail; ++ ++ old_type = buf->rand_type; ++ old_state = buf->state; ++ if (old_type == TYPE_0) ++ old_state[-1] = TYPE_0; ++ else ++ old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type; ++ ++ type = new_state[-1] % MAX_TYPES; ++ if (type < TYPE_0 || type > TYPE_4) ++ goto fail; ++ ++ buf->rand_deg = degree = random_poly_info.degrees[type]; ++ buf->rand_sep = separation = random_poly_info.seps[type]; ++ buf->rand_type = type; ++ ++ if (type != TYPE_0) ++ { ++ int rear = new_state[-1] / MAX_TYPES; ++ buf->rptr = &new_state[rear]; ++ buf->fptr = &new_state[(rear + separation) % degree]; ++ } ++ buf->state = new_state; ++ /* Set end_ptr too. */ ++ buf->end_ptr = &new_state[degree]; ++ ++ return 0; ++ ++ fail: ++ __set_errno (EINVAL); ++ return -1; ++} ++ + static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size; + + #define BOUNCE_RANDOM (1<<0) +-- +2.11.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc new file mode 100644 index 00000000..cd819f31 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc @@ -0,0 +1,51 @@ +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" +COMPATIBLE_HOST_libc-musl = "null" + +RDEPENDS_${PN} = "bash binutils" +RDEPENDS_kpatch-build = "bash glibc-utils" + +FILES_${PN} = " \ + ${sbindir}/kpatch \ + ${systemd_system_unitdir}/kpatch.service \ + ${mandir}/man1/kpatch.1.gz \ + ${sysconfdir}/init/kpatch.conf \ + " +FILES_kpatch-build = " \ + ${bindir}/kpatch-build \ + ${libexecdir}/* \ + ${datadir}/kpatch \ + ${mandir}/man1/kpatch-build.1.gz \ + " + +SYSTEMD_SERVICE_${PN} = "kpatch.service" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch new file mode 100644 index 00000000..ab3b1276 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch @@ -0,0 +1,101 @@ +From 70de3fecbc551907c4fd504cfff385c73be8db75 Mon Sep 17 00:00:00 2001 +From: Ruslan Bilovol +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 + +--- + 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 a76913f..4a011aa 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -197,7 +197,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" +@@ -392,12 +392,14 @@ usage() { + echo " -d, --debug Enable 'xtrace' and keep scratch files" >&2 + echo " in /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" + +@@ -455,6 +457,10 @@ while [[ $# -gt 0 ]]; do + echo "DEBUG mode enabled" + fi + ;; ++ --cross-compile) ++ KPATCH_CROSS_COMPILE="$2" ++ shift ++ ;; + --skip-cleanup) + echo "Skipping cleanup" + SKIPCLEANUP=1 +@@ -710,6 +716,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 + unset KPATCH_GCC_TEMPDIR +@@ -874,6 +882,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 2d56da1..59a4255 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=("$@") +@@ -82,4 +82,4 @@ elif [[ "$TOOLCHAINCMD" = "ld" ]] ; then + done + fi + +-exec "$TOOLCHAINCMD" "${args[@]}" ++exec ${KPATCH_CROSS_COMPILE}${TOOLCHAINCMD} "${args[@]}" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch new file mode 100644 index 00000000..13cdc6bf --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch @@ -0,0 +1,60 @@ +From 15838a86d5ea94fa05976ea32fd847b18261b403 Mon Sep 17 00:00:00 2001 +From: Ruslan Bilovol +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 + +--- + 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 4a011aa..eb6cd64 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -394,12 +394,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" + +@@ -461,6 +462,10 @@ while [[ $# -gt 0 ]]; do + KPATCH_CROSS_COMPILE="$2" + shift + ;; ++ --distro) ++ DISTRO="$2" ++ shift ++ ;; + --skip-cleanup) + echo "Skipping cleanup" + SKIPCLEANUP=1 +@@ -539,7 +544,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" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb new file mode 100644 index 00000000..024cca65 --- /dev/null +++ b/external/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 = "7f550f01bd308cf058ae782327d29c8916cc5602" + +PV = "0.6.1+git${SRCPV}" + +S = "${WORKDIR}/git" + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc b/external/meta-openembedded/meta-oe/recipes-kernel/linux/linux.inc new file mode 100644 index 00000000..9f14370c --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch b/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch new file mode 100644 index 00000000..a4780652 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch @@ -0,0 +1,132 @@ +From 8eeb1b15608ce1a9a1f0d5417938fd6da4504406 Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Thu, 21 Jul 2016 18:06:21 +0800 +Subject: [PATCH] makedumpfile: replace hardcode CFLAGS + +* Create alias for target such as powerpc as powerpc32 +* Remove hardcode CFLAGS +* Add CFLAGS_COMMON to instead of CFLAGS so can flexibly + customize CFLAGS and not hardcode the CFLAGS as previously +* Forcibly to link dynamic library as the poky build + system doesn't build static library by default + +Upstream-Status: Inappropriate[oe specific] + +Signed-off-by: Mingli Yu + +--- + Makefile | 46 +++++++++++++++++++++++----------------------- + 1 file changed, 23 insertions(+), 23 deletions(-) + +diff --git a/Makefile b/Makefile +index 612b9d0..f6d6265 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 tools.c + OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART)) +@@ -53,17 +53,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) +@@ -71,14 +71,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 +@@ -89,7 +89,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 diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch b/external/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 00000000..766f4fc7 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch @@ -0,0 +1,72 @@ +From ba123fa6b2aa0ac62d1b78f327339635ae87201a Mon Sep 17 00:00:00 2001 +From: Alexandru Moise +Date: Fri, 29 Apr 2016 07:40:46 +0000 +Subject: [PATCH] mem_section: Support only 46 bit for MAX_PHYSMEM_BITS on + PPC64 + +Related to change: +http://lists.infradead.org/pipermail/kexec/2013-January/007849.html + +Linux on PPC64 has supported only 46 bit MAX_PHYSMEM_BITS since commit: +048ee0993ec8360abb0b51bdf8f8721e9ed62ec4 + +Also remove set_ppc64_max_physmem_bits and set info->max_physmem_bits in +get_machdep_info_ppc64 instead. set_ppc64_max_physmem_bits is broken +for all kernels compiled with CONFIG_SPARSEMEM=n. makedumpfile is +unable to get mem_section field from powerpc kernel since commit: +fd59d231f81cb02870b9cf15f456a897f3669b4e + +Upstream-Status: Pending + +Signed-off-by: Alexandru Moise +Signed-off-by: Yi Zhao + +--- + arch/ppc64.c | 28 ++-------------------------- + 1 file changed, 2 insertions(+), 26 deletions(-) + +diff --git a/arch/ppc64.c b/arch/ppc64.c +index 8b6f7d5..458f06b 100644 +--- a/arch/ppc64.c ++++ b/arch/ppc64.c +@@ -462,38 +462,14 @@ ppc64_vtop_level4(unsigned long vaddr) + return paddr; + } + +-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) { diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.4.bb b/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.4.bb new file mode 100644 index 00000000..33194b85 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.4.bb @@ -0,0 +1,57 @@ +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 and aarch64 would compile but has never been tested upstream. mips would not compile. +# +COMPATIBLE_HOST = "(x86_64|i.86|powerpc|arm|aarch64).*-linux" + +PACKAGES =+ "${PN}-tools" +FILES_${PN}-tools = "${bindir}/*.pl" + +SRC_URI = "\ + ${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] = "7dfbca19f487604c271e2892ba07f4bd" +SRC_URI[sha256sum] = "7e06f72d5f291fcab9e92975f405a76e37d4f7fc8fa4172f199636398ae812b1" + +UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/makedumpfile/files/makedumpfile/" +UPSTREAM_CHECK_REGEX = "makedumpfile/(?P\d+(\.\d+)+)/" + +SECTION = "base" + +# If we do not specify TARGET, makedumpfile will build for the host but use the +# target gcc. +# +EXTRA_OEMAKE = "\ + LINKTYPE=static \ + TARGET=${TARGET_ARCH} \ +" + +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/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch b/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch new file mode 100644 index 00000000..ad255fae --- /dev/null +++ b/external/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 +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 +--- + 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/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init b/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.init new file mode 100644 index 00000000..9c96e315 --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service b/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/minicoredumper.service new file mode 100644 index 00000000..45d098f2 --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb b/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb new file mode 100644 index 00000000..bae5cf4f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb @@ -0,0 +1,47 @@ +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 = "1c0d5960b0bb4bac7566e6afe8bc9705399cc76b" + +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 \ + " + +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 +} + +# http://errors.yoctoproject.org/Errors/Details/186966/ +EXCLUDE_FROM_WORLD_libc-musl = "1" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc new file mode 100644 index 00000000..349e2bf5 --- /dev/null +++ b/external/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 \ +" +UPSTREAM_CHECK_REGEX = "oprofile-(?P\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/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Add-rmb-definition-for-NIOS2-architecture.patch new file mode 100644 index 00000000..ae8562a2 --- /dev/null +++ b/external/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 +Date: Tue, 9 Feb 2016 02:00:29 +0100 +Subject: [PATCH] Add rmb() definition for NIOS2 architecture + +Signed-off-by: Marek Vasut +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 + #define rmb() __insn_mf() +-- +2.7.0 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4 b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/acinclude.m4 new file mode 100644 index 00000000..95ecd91b --- /dev/null +++ b/external/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 ], +[ +#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 ], +[ +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 ], [], +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 + ], + [ + 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 + #include + ], + [ + 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 < +"%%%"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='' +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 + + + + +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/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/automake-foreign.patch new file mode 100644 index 00000000..b9bb6c57 --- /dev/null +++ b/external/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 + +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/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/musl.patch new file mode 100644 index 00000000..51db4084 --- /dev/null +++ b/external/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 + +--- 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/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch new file mode 100644 index 00000000..aefa9548 --- /dev/null +++ b/external/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 + +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/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/root-home-dir.patch new file mode 100644 index 00000000..3eaf6a79 --- /dev/null +++ b/external/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 + +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 @@ + must stop it in a controlled manner in order to process + the profile data it has collected. Use kill -SIGINT <operf-PID> + for this purpose. It is recommended that when running operf +- with this option, your current working directory should be /root or a subdirectory +- of /root to avoid storing sample data files in locations accessible by regular users. ++ with this option, your current working directory should be ~root or a subdirectory ++ of ~root to avoid storing sample data files in locations accessible by regular users. +

+ +
+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 @@ + must stop it in a controlled manner in order to process + the profile data it has collected. Use kill -SIGINT <operf-PID> + for this purpose. It is recommended that when running operf +- with this option, your current working directory should be /root or a subdirectory +- of /root to avoid storing sample data files in locations accessible by regular users. ++ with this option, your current working directory should be ~root or a subdirectory ++ of ~root to avoid storing sample data files in locations accessible by regular users. + + + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/run-ptest new file mode 100644 index 00000000..4814be65 --- /dev/null +++ b/external/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/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb new file mode 100644 index 00000000..1dc535ed --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb @@ -0,0 +1,10 @@ +require oprofile.inc + +DEPENDS += "virtual/kernel" +DEPENDS_append_powerpc64 = " libpfm4" + +SRC_URI[md5sum] = "bd998df5521ebedae31e71cd3fb6200b" +SRC_URI[sha256sum] = "95ded8bde1ec39922f0af015981a67aec63e025a501e4dc04cd65d38f73647e6" + +S = "${WORKDIR}/oprofile-${PV}" + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat/COPYING b/external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat/COPYING new file mode 100644 index 00000000..da4cb28f --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat/COPYING @@ -0,0 +1,18 @@ +The Linux Kernel is provided under: + + SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note + +Being under the terms of the GNU General Public License version 2 only, +according with: + + LICENSES/preferred/GPL-2.0 + +With an explicit syscall exception, as stated at: + + LICENSES/exceptions/Linux-syscall-note + +In addition, other licenses may also apply. Please see: + + Documentation/process/license-rules.rst + +for more details. diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb b/external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb new file mode 100644 index 00000000..dc3e78fe --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb @@ -0,0 +1,57 @@ +# +# Copyright (C) 2013 Wind River Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +SUMMARY = "Frequency and Idle power monitoring tools for Linux" + +DESCRIPTION = "The turbostat tool allows you to determine the actual \ +processor frequency and idle power saving state residency on supported \ +processors." + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://../COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" +COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' +COMPATIBLE_HOST_libc-musl = "null" + +SRC_URI += "\ + file://COPYING \ + " + +DEPENDS = "virtual/kernel" + +# This looks in S, so we better make sure there's +# something in the directory. +# +do_populate_lic[depends] = "${PN}:do_configure" + + +EXTRA_OEMAKE = '\ + CC="${CC}" \ + 'CFLAGS=-Wall -I${STAGING_KERNEL_DIR}/arch/x86/include/uapi ${LDFLAGS}' \ + ' + +# If we build under STAGING_KERNEL_DIR, source will not be put +# into the dbg rpm. STAGING_KERNEL_DIR will exist by the time +# do_configure() is invoked so we can safely copy from it. +# +do_configure_prepend() { + mkdir -p ${S} + cp -r ${STAGING_KERNEL_DIR}/arch/x86/include/asm/msr-index.h ${S} + cp -r ${STAGING_KERNEL_DIR}/arch/x86/include/asm/intel-family.h ${S} + cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S} + cp -r ${WORKDIR}/COPYING ${S} +} + +do_compile() { + sed -i 's#MSRHEADER#"msr-index.h"#' turbostat.c + sed -i 's#INTEL_FAMILY_HEADER#"intel-family.h"#' turbostat.c + sed -i 's#\$(CC) \$(CFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#\$(CC) \$(CFLAGS) \$(LDFLAGS) \$< -o \$(BUILD_OUTPUT)/\$@#' Makefile + oe_runmake STAGING_KERNEL_DIR=${STAGING_KERNEL_DIR} +} + +do_install() { + oe_runmake DESTDIR="${D}" install +} -- cgit 1.2.3-korg