diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-17 04:11:34 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-01-09 02:21:44 +0300 |
commit | 1a4b7ee28bf7413af6513fb45ad0d0736048f866 (patch) | |
tree | 79f6d8ea698cab8f2eaf4f54b793d2ca7a1451ce /meta-openembedded/meta-oe/recipes-kernel | |
parent | 5b9ede0403237c7dace972affa65cf64a1aadd0e (diff) | |
download | openbmc-1a4b7ee28bf7413af6513fb45ad0d0736048f866.tar.xz |
reset upstream subtrees to yocto 2.6
Reset the following subtrees on thud HEAD:
poky: 87e3a9739d
meta-openembedded: 6094ae18c8
meta-security: 31dc4e7532
meta-raspberrypi: a48743dc36
meta-xilinx: c42016e2e6
Also re-apply backports that didn't make it into thud:
poky:
17726d0 systemd-systemctl-native: handle Install wildcards
meta-openembedded:
4321a5d libtinyxml2: update to 7.0.1
042f0a3 libcereal: Add native and nativesdk classes
e23284f libcereal: Allow empty package
030e8d4 rsyslog: curl-less build with fmhttp PACKAGECONFIG
179a1b9 gtest: update to 1.8.1
Squashed OpenBMC subtree compatibility updates:
meta-aspeed:
Brad Bishop (1):
aspeed: add yocto 2.6 compatibility
meta-ibm:
Brad Bishop (1):
ibm: prepare for yocto 2.6
meta-ingrasys:
Brad Bishop (1):
ingrasys: set layer compatibility to yocto 2.6
meta-openpower:
Brad Bishop (1):
openpower: set layer compatibility to yocto 2.6
meta-phosphor:
Brad Bishop (3):
phosphor: set layer compatibility to thud
phosphor: libgpg-error: drop patches
phosphor: react to fitimage artifact rename
Ed Tanous (4):
Dropbear: upgrade options for latest upgrade
yocto2.6: update openssl options
busybox: remove upstream watchdog patch
systemd: Rebase CONFIG_CGROUP_BPF patch
Change-Id: I7b1fe71cca880d0372a82d94b5fd785323e3a9e7
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-kernel')
25 files changed, 875 insertions, 143 deletions
diff --git a/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb b/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb new file mode 100644 index 000000000..fd0653ab8 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb @@ -0,0 +1,31 @@ +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" + +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/meta-openembedded/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_git.bb b/meta-openembedded/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_git.bb new file mode 100644 index 000000000..8c474ecdc --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-kernel/broadcom-bt-firmware/broadcom-bt-firmware_git.bb @@ -0,0 +1,76 @@ +# Copyright (C) 2018 Krzysztof Kozlowski <krzk@kernel.org> +# 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/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb b/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb index 4abd273fa..4544f5b2e 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb +++ b/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb @@ -2,7 +2,7 @@ SUMMARY = "Shows and sets processor power related values" DESCRIPTION = "cpupower is a collection of tools to examine and tune power \ saving related features of your processor." LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" +LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" DEPENDS = "pciutils gettext-native" PROVIDES = "virtual/cpupower" diff --git a/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.0.bb b/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.4.bb index 9bea48e0d..c72b1a321 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.0.bb +++ b/meta-openembedded/meta-oe/recipes-kernel/crash/crash_7.2.4.bb @@ -25,12 +25,14 @@ SRC_URI = "https://github.com/crash-utility/${BPN}/archive/${PV}.tar.gz;download file://0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch \ file://0003-crash-detect-the-sysroot-s-glibc-header-file.patch \ " -SRC_URI[md5sum] = "48899de3118e04cfa40a2364f5618193" -SRC_URI[sha256sum] = "5d076e1fefb41aa178ad3e1cef6511670efc47de5cb04d4af9bdd4e8f2f18cbc" +SRC_URI[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" @@ -113,3 +115,6 @@ 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/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-Migrate-to-openssl-1.1.patch b/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-Migrate-to-openssl-1.1.patch new file mode 100644 index 000000000..394aa16ad --- /dev/null +++ b/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 <raj.khem@gmail.com> +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 <raj.khem@gmail.com> +--- + 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/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb b/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb index 9f73d2799..b7f1aa914 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb +++ b/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool_1.8.18.bb @@ -22,7 +22,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=9aa91e13d644326bf281924212862184" DEPENDS = "openssl readline ncurses" -SRC_URI = "${SOURCEFORGE_MIRROR}/ipmitool/ipmitool-${PV}.tar.bz2" +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" diff --git a/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb new file mode 100644 index 000000000..181e97cac --- /dev/null +++ b/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/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING b/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/COPYING new file mode 100644 index 000000000..da4cb28fe --- /dev/null +++ b/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/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest b/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/run-ptest new file mode 100755 index 000000000..d40b9576d --- /dev/null +++ b/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/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch b/meta-openembedded/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/userfaultfd.patch new file mode 100644 index 000000000..bed20510e --- /dev/null +++ b/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" <hongzhi.song@windriver.com> +Date: Fri, 13 Jul 2018 06:06:19 -0700 +Subject: [PATCH] vm: add some funtions to support musl libc + +Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> +--- + 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/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc index b1e73e954..cd819f31f 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc +++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc @@ -30,6 +30,7 @@ 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" @@ -38,6 +39,7 @@ FILES_${PN} = " \ ${sbindir}/kpatch \ ${systemd_system_unitdir}/kpatch.service \ ${mandir}/man1/kpatch.1.gz \ + ${sysconfdir}/init/kpatch.conf \ " FILES_kpatch-build = " \ ${bindir}/kpatch-build \ diff --git a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch index 459fb2197..ab3b12764 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch +++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0001-kpatch-build-add-cross-compilation-support.patch @@ -1,4 +1,4 @@ -From a9a80a1f4df65892a0269295ce8a64b06f2ff61d Mon Sep 17 00:00:00 2001 +From 70de3fecbc551907c4fd504cfff385c73be8db75 Mon Sep 17 00:00:00 2001 From: Ruslan Bilovol <rbilovol@cisco.com> Date: Tue, 19 Dec 2017 15:59:04 +0200 Subject: [PATCH] kpatch-build: add cross-compilation support @@ -17,16 +17,17 @@ possible to pass multy-component strings like Upstream-Status: Pending Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com> + --- kpatch-build/kpatch-build | 13 +++++++++++-- kpatch-build/kpatch-gcc | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build -index 166ecbd..af24cc4 100755 +index a76913f..4a011aa 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build -@@ -195,7 +195,7 @@ gcc_version_check() { +@@ -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" @@ -35,7 +36,7 @@ index 166ecbd..af24cc4 100755 gccver="$(gcc_version_from_file "$o")" kgccver="$(gcc_version_from_file "$VMLINUX")" rm -f "$c" "$o" -@@ -381,12 +381,14 @@ usage() { +@@ -392,12 +392,14 @@ usage() { echo " -d, --debug Enable 'xtrace' and keep scratch files" >&2 echo " in <CACHEDIR>/tmp" >&2 echo " (can be specified multiple times)" >&2 @@ -51,7 +52,7 @@ index 166ecbd..af24cc4 100755 eval set -- "$options" -@@ -444,6 +446,10 @@ while [[ $# -gt 0 ]]; do +@@ -455,6 +457,10 @@ while [[ $# -gt 0 ]]; do echo "DEBUG mode enabled" fi ;; @@ -62,7 +63,7 @@ index 166ecbd..af24cc4 100755 --skip-cleanup) echo "Skipping cleanup" SKIPCLEANUP=1 -@@ -691,6 +697,8 @@ if [[ $DEBUG -ge 4 ]]; then +@@ -710,6 +716,8 @@ if [[ $DEBUG -ge 4 ]]; then export KPATCH_GCC_DEBUG=1 fi @@ -70,8 +71,8 @@ index 166ecbd..af24cc4 100755 + echo "Building original kernel" ./scripts/setlocalversion --save-scmversion || die - make mrproper 2>&1 | logger || die -@@ -840,6 +848,7 @@ cd "$TEMPDIR/patch" || 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" \ @@ -80,7 +81,7 @@ index 166ecbd..af24cc4 100755 if ! "$KPATCH_MODULE"; then diff --git a/kpatch-build/kpatch-gcc b/kpatch-build/kpatch-gcc -index 6ba133c..3937948 100755 +index 2d56da1..59a4255 100755 --- a/kpatch-build/kpatch-gcc +++ b/kpatch-build/kpatch-gcc @@ -8,7 +8,7 @@ TOOLCHAINCMD="$1" @@ -92,12 +93,9 @@ index 6ba133c..3937948 100755 fi declare -a args=("$@") -@@ -80,4 +80,4 @@ elif [[ "$TOOLCHAINCMD" = "ld" ]] ; then +@@ -82,4 +82,4 @@ elif [[ "$TOOLCHAINCMD" = "ld" ]] ; then done fi -exec "$TOOLCHAINCMD" "${args[@]}" +exec ${KPATCH_CROSS_COMPILE}${TOOLCHAINCMD} "${args[@]}" --- -1.9.1 - diff --git a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch index a9d8a7f2c..13cdc6bfb 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch +++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch @@ -1,4 +1,4 @@ -From d418d716dae1e2a05131dfb42a19a4da2fc8a85d Mon Sep 17 00:00:00 2001 +From 15838a86d5ea94fa05976ea32fd847b18261b403 Mon Sep 17 00:00:00 2001 From: Ruslan Bilovol <rbilovol@cisco.com> Date: Tue, 2 Jan 2018 14:50:03 +0200 Subject: [PATCH] kpatch-build: allow overriding of distro name @@ -14,15 +14,16 @@ implements all needed functionality Upstream-Status: Pending Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com> + --- kpatch-build/kpatch-build | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build -index af24cc4..4f9f78d 100755 +index 4a011aa..eb6cd64 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build -@@ -383,12 +383,13 @@ usage() { +@@ -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 @@ -37,7 +38,7 @@ index af24cc4..4f9f78d 100755 eval set -- "$options" -@@ -450,6 +451,10 @@ while [[ $# -gt 0 ]]; do +@@ -461,6 +462,10 @@ while [[ $# -gt 0 ]]; do KPATCH_CROSS_COMPILE="$2" shift ;; @@ -48,7 +49,7 @@ index af24cc4..4f9f78d 100755 --skip-cleanup) echo "Skipping cleanup" SKIPCLEANUP=1 -@@ -526,7 +531,7 @@ fi +@@ -539,7 +544,7 @@ fi # Don't check external file. # shellcheck disable=SC1091 source /etc/os-release @@ -57,6 +58,3 @@ index af24cc4..4f9f78d 100755 if [[ "$DISTRO" = fedora ]] || [[ "$DISTRO" = rhel ]] || [[ "$DISTRO" = ol ]] || [[ "$DISTRO" = centos ]]; then [[ -z "$VMLINUX" ]] && VMLINUX="/usr/lib/debug/lib/modules/$ARCHVERSION/vmlinux" [[ -e "$VMLINUX" ]] || die "kernel-debuginfo-$ARCHVERSION not installed" --- -1.9.1 - diff --git a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb index e495e2882..024cca655 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb +++ b/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb @@ -2,9 +2,9 @@ require kpatch.inc LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRCREV = "db6efbb8c7e90d2b761272cf563047119072768f" +SRCREV = "7f550f01bd308cf058ae782327d29c8916cc5602" -PV = "0.5.0+git${SRCPV}" +PV = "0.6.1+git${SRCPV}" S = "${WORKDIR}/git" diff --git a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch index d599a9193..a47806526 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch +++ b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0001-makedumpfile-replace-hardcode-CFLAGS.patch @@ -1,4 +1,4 @@ -From 3c2f4ff583a156a7ed2fa0cc002a413c391d063d Mon Sep 17 00:00:00 2001 +From 8eeb1b15608ce1a9a1f0d5417938fd6da4504406 Mon Sep 17 00:00:00 2001 From: Mingli Yu <mingli.yu@windriver.com> Date: Thu, 21 Jul 2016 18:06:21 +0800 Subject: [PATCH] makedumpfile: replace hardcode CFLAGS @@ -13,12 +13,13 @@ Subject: [PATCH] makedumpfile: replace hardcode CFLAGS Upstream-Status: Inappropriate[oe specific] Signed-off-by: Mingli Yu <mingli.yu@windriver.com> + --- Makefile | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile -index 7dde3e4..c5286ac 100644 +index 612b9d0..f6d6265 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,6 @@ ifeq ($(strip $CC),) @@ -80,9 +81,9 @@ index 7dde3e4..c5286ac 100644 + -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 + 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)) -@@ -54,17 +54,17 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) +@@ -53,17 +53,17 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) LIBS = -ldw -lbz2 -lebl -ldl -lelf -lz ifneq ($(LINKTYPE), dynamic) @@ -103,7 +104,7 @@ index 7dde3e4..c5286ac 100644 endif LIBS := -lpthread $(LIBS) -@@ -72,14 +72,14 @@ LIBS := -lpthread $(LIBS) +@@ -71,14 +71,14 @@ LIBS := -lpthread $(LIBS) all: makedumpfile $(OBJ_PART): $(SRC_PART) @@ -120,7 +121,7 @@ index 7dde3e4..c5286ac 100644 echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8 grep -v "^.TH MAKEDUMPFILE 8" $(VPATH)makedumpfile.8 >> temp.8 mv temp.8 makedumpfile.8 -@@ -90,7 +90,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) +@@ -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 @@ -129,6 +130,3 @@ index 7dde3e4..c5286ac 100644 clean: rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8.gz makedumpfile.conf.5.gz --- -2.8.1 - diff --git a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch index e0c3d9af6..766f4fc76 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch +++ b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile/0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch @@ -1,4 +1,4 @@ -From 653fe8e724081d2f289c2245d1220d5f7170538d Mon Sep 17 00:00:00 2001 +From ba123fa6b2aa0ac62d1b78f327339635ae87201a Mon Sep 17 00:00:00 2001 From: Alexandru Moise <alexandru.moise@windriver.com> Date: Fri, 29 Apr 2016 07:40:46 +0000 Subject: [PATCH] mem_section: Support only 46 bit for MAX_PHYSMEM_BITS on @@ -20,18 +20,20 @@ Upstream-Status: Pending Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com> Signed-off-by: Yi Zhao <yi.zhao@windriver.com> + --- arch/ppc64.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/arch/ppc64.c b/arch/ppc64.c -index 89a7f05..6c928ab 100644 +index 8b6f7d5..458f06b 100644 --- a/arch/ppc64.c +++ b/arch/ppc64.c -@@ -302,37 +302,13 @@ ppc64_vtop_level4(unsigned long vaddr) +@@ -462,38 +462,14 @@ ppc64_vtop_level4(unsigned long vaddr) + return paddr; } - int +-int -set_ppc64_max_physmem_bits(void) -{ - long array_len = ARRAY_LENGTH(mem_section); @@ -53,7 +55,7 @@ index 89a7f05..6c928ab 100644 - return FALSE; -} - --int + int get_machdep_info_ppc64(void) { unsigned long vmlist, vmap_area_list, vmalloc_start; @@ -68,6 +70,3 @@ index 89a7f05..6c928ab 100644 info->page_offset = __PAGE_OFFSET; if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) { --- -2.5.0 - diff --git a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.4.bb index d6f2d807e..629e2518f 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.2.bb +++ b/meta-openembedded/meta-oe/recipes-kernel/makedumpfile/makedumpfile_1.6.4.bb @@ -25,8 +25,11 @@ SRC_URI = "\ file://0001-makedumpfile-replace-hardcode-CFLAGS.patch \ file://0002-mem_section-Support-only-46-bit-for-MAX_PHYSMEM_BITS.patch \ " -SRC_URI[md5sum] = "72be5bf973eed898c5127e3abc466583" -SRC_URI[sha256sum] = "ee3d21cb4032a60bd2c802d1d8b21b9f399710e1574f8de8ead5ab50cd821a6d" +SRC_URI[md5sum] = "7dfbca19f487604c271e2892ba07f4bd" +SRC_URI[sha256sum] = "7e06f72d5f291fcab9e92975f405a76e37d4f7fc8fa4172f199636398ae812b1" + +UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/makedumpfile/files/makedumpfile/" +UPSTREAM_CHECK_REGEX = "makedumpfile/(?P<pver>\d+(\.\d+)+)/" SECTION = "base" diff --git a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch deleted file mode 100644 index 6ba6ad481..000000000 --- a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/files/0001-fix-compile-error-on-arch-x32.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 883f53ee33eaef8aca1288a110857402ad362966 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Fri, 8 Sep 2017 15:03:03 -0700 -Subject: [PATCH] fix compile error on arch=x32 - -On the x32 architecture time_t is a "long long int". By - typecasting time_t to "long long", this should work correctly - for all architectures. - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- -Upstream-Status: Pending - - src/minicoredumper/corestripper.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c -index fd39bfb..07dc318 100644 ---- a/src/minicoredumper/corestripper.c -+++ b/src/minicoredumper/corestripper.c -@@ -1241,7 +1241,7 @@ static int dump_compressed_tar(struct dump_info *di) - snprintf(hdr.mode, sizeof(hdr.mode), "%07o", 0644); - snprintf(hdr.uid, sizeof(hdr.uid), "%07o", 0); - snprintf(hdr.gid, sizeof(hdr.gid), "%07o", 0); -- snprintf(hdr.mtime, sizeof(hdr.mtime), "%011lo", -+ snprintf(hdr.mtime, sizeof(hdr.mtime), "%011llo", - (long long)time(NULL)); - memset(hdr.checksum, ' ', sizeof(hdr.checksum)); - hdr.type = 'S'; --- -2.14.1 - diff --git a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb index 0d3c66b07..bae5cf4f9 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb +++ b/meta-openembedded/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.0.bb @@ -9,7 +9,7 @@ DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux json-c" inherit autotools pkgconfig systemd update-rc.d -SRCREV = "cdc1faf1212a51e89b477468876e229223fceb9a" +SRCREV = "1c0d5960b0bb4bac7566e6afe8bc9705399cc76b" PR .= "+git${SRCPV}" @@ -17,7 +17,6 @@ SRC_URI = "git://git.linuxfoundation.org/diamon/minicoredumper.git;protocol=http file://minicoredumper.service \ file://minicoredumper.init \ file://0001-minicoredumper-Initialize-pointer-to-config-struct-t.patch \ - file://0001-fix-compile-error-on-arch-x32.patch \ " S = "${WORKDIR}/git" @@ -43,3 +42,6 @@ do_install_append() { 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/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc index 4b01654fa..349e2bf54 100644 --- a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc +++ b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc @@ -25,12 +25,12 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ file://run-ptest \ file://root-home-dir.patch \ file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \ - file://0001-Fix-FTBFS-problem-with-GCC-6.patch \ " UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" -SRC_URI_append_libc-musl = " file://musl.patch" +SRC_URI_append_libc-musl = " file://musl.patch \ +" inherit autotools pkgconfig ptest diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch deleted file mode 100644 index d372fd527..000000000 --- a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Fix-FTBFS-problem-with-GCC-6.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 39d4d46a0bd504ac708ffe72df87bf74cd12ad30 Mon Sep 17 00:00:00 2001 -From: William Cohen <wcohen@redhat.com> -Date: Fri, 5 Feb 2016 17:30:19 -0500 -Subject: [PATCH] Fix FTBFS problem with GCC-6 - -GCC-6 is pickier about some of the type conversions causing the Fedora -24 mass rebuild the build of oprofile failed with: - -make[3]: Entering directory '/builddir/build/BUILD/oprofile-1.1.0/libutil++' -g++ -DHAVE_CONFIG_H -I. -I.. -I ../libutil -I ../libop -I ../libpp -W -Wall -fno-common -ftemplate-depth-50 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c -o op_bfd.o op_bfd.cpp -op_bfd.cpp: In member function 'void op_bfd::get_symbol_range(symbol_index_t, long long unsigned int&, long long unsigned int&) const': -op_bfd.cpp:538:47: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'const bool' in initialization - bool const verbose = cverb << (vbfd & vlevel1); - ^ -op_bfd.cpp:546:7: error: in argument to unary ! - if (!verbose) - ^~~~~~~ - -Avoid the intermediate bool type to make GCC-6 happy. - -Signed-off-by: William Cohen <wcohen@redhat.com> ---- -Upstream-Status: Backport - - libutil++/op_bfd.cpp | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/libutil++/op_bfd.cpp b/libutil++/op_bfd.cpp -index 389c920..f2eb42b 100644 ---- a/libutil++/op_bfd.cpp -+++ b/libutil++/op_bfd.cpp -@@ -535,15 +535,13 @@ void op_bfd::get_symbol_range(symbol_index_t sym_idx, - { - op_bfd_symbol const & sym = syms[sym_idx]; - -- bool const verbose = cverb << (vbfd & vlevel1); -- - if (anon_obj) - start = sym.vma(); - else - start = sym.filepos(); - end = start + sym.size(); - -- if (!verbose) -+ if (!(cverb << (vbfd & vlevel1))) - return; - - io_state state(cverb << (vbfd & vlevel1)); --- -1.9.1 - diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb deleted file mode 100644 index 92a94ad0d..000000000 --- a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.1.0.bb +++ /dev/null @@ -1,10 +0,0 @@ -require oprofile.inc - -DEPENDS += "virtual/kernel" -DEPENDS_append_powerpc64 = " libpfm4" - -SRC_URI[md5sum] = "248c4c069f9476f427fa7195563f9867" -SRC_URI[sha256sum] = "cf759a6de1a6033d5dfc93bda129a9f2e128aecc4238cc657feb0801d1b0366c" - -S = "${WORKDIR}/oprofile-${PV}" - diff --git a/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb b/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile_1.3.0.bb new file mode 100644 index 000000000..1dc535ed8 --- /dev/null +++ b/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/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat/COPYING b/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat/COPYING new file mode 100644 index 000000000..da4cb28fe --- /dev/null +++ b/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/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb b/meta-openembedded/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb new file mode 100644 index 000000000..dc3e78feb --- /dev/null +++ b/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 +} |