diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-openembedded/meta-oe/recipes-kernel | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-kernel')
33 files changed, 1264 insertions, 116 deletions
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_1.97.bb index 8e370f96..2eb19206 100644 --- 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_1.97.bb @@ -8,8 +8,7 @@ SECTION = "devel" EXTRA_OEMAKE = "'CC=${CC}'" -SRCREV = "e6c9d3d996bd55e7ab14dbd74deb7841e0c3a4f1" -PV = "1.96+git${SRCPV}" +SRCREV = "468fe4c31e6c62c9bbb328b06ba71eaf7be0b76a" SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git;protocol=git \ file://0001-Makefile-Add-LDFLAGS-variable.patch \ diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb b/external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb index dd7eaa2a..6683eccf 100644 --- a/external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb +++ b/external/meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb @@ -2,7 +2,6 @@ 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" @@ -10,7 +9,9 @@ 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}" +EXTRA_OEMAKE = "V=1 -C ${S}/tools/bpf/bpftool O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}" + +SECURITY_CFLAGS = "" do_configure[depends] += "virtual/kernel:do_shared_workdir" @@ -27,7 +28,8 @@ do_install() { PACKAGE_ARCH = "${MACHINE_ARCH}" python do_package_prepend() { - d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0]) + d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) } B = "${WORKDIR}/${BPN}-${PV}" +PNBLACKLIST[bpftool] = "Needs forward porting to kernel 5.2+" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb b/external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb index dd465036..cf70eb2c 100644 --- a/external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb +++ b/external/meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb @@ -5,7 +5,7 @@ LICENSE = "GPLv2" DEPENDS = "pciutils gettext-native" PROVIDES = "virtual/cpupower" -inherit kernelsrc kernel-arch +inherit kernelsrc kernel-arch bash-completion do_populate_lic[depends] += "virtual/kernel:do_patch" @@ -29,7 +29,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" RDEPENDS_${PN} = "bash" python do_package_prepend() { - d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0]) + d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) } B = "${WORKDIR}/${BPN}-${PV}" 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.8.bb index c72b1a32..834c92cc 100644 --- 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.8.bb @@ -10,10 +10,11 @@ SECTION = "devel" LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://COPYING3;md5=d32239bcb673463ab874e80d47fae504" -DEPENDS = "zlib readline coreutils-native" +DEPENDS = "zlib readline coreutils-native ncurses-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} \ +S = "${WORKDIR}/git" +SRC_URI = "git://github.com/crash-utility/${BPN}.git \ + ${GNU_MIRROR}/gdb/gdb-7.6.tar.gz;name=gdb;subdir=git \ file://7001force_define_architecture.patch \ file://7003cross_ranlib.patch \ file://0001-cross_add_configure_option.patch \ @@ -25,8 +26,7 @@ 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] = "4f66eb0e9a82ff83de06ac2b37501f5c" -SRC_URI[sha256sum] = "85ca2e93f1ee628ef2499ab9c78623f8b04500bdf7378c09de19283f6a7a698f" +SRCREV = "24f4801f8c8871a2e3e660fe9fa8fdd86bb29876" SRC_URI[gdb.md5sum] = "a9836707337e5f7bf76a009a8904f470" SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36" @@ -38,8 +38,12 @@ inherit gettext BBCLASSEXTEND = "native cross" TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}" -# crash 7.1.3 and before don't support mips64 -COMPATIBLE_HOST = "^(?!mips64).*" +# crash 7.1.3 and before don't support mips64/riscv64 +COMPATIBLE_HOST_riscv64 = "null" +COMPATIBLE_HOST_riscv32 = "null" +COMPATIBLE_HOST_mipsarchn64 = "null" +COMPATIBLE_HOST_mipsarchn32 = "null" + EXTRA_OEMAKE = 'RPMPKG="${PV}" \ GDB_TARGET="${TARGET_SYS}" \ @@ -49,9 +53,7 @@ EXTRA_OEMAKE = 'RPMPKG="${PV}" \ ' EXTRA_OEMAKE_class-cross = 'RPMPKG="${PV}" \ - GDB_TARGET="${BUILD_SYS} \ - \${GDB_CONF_FLAGS} \ - --target=${TARGET_SYS}" \ + GDB_TARGET="${BUILD_SYS} --target=${TARGET_SYS}" \ GDB_HOST="${BUILD_SYS}" \ GDB_MAKE_JOBS="${PARALLEL_MAKE}" \ ' @@ -59,10 +61,6 @@ EXTRA_OEMAKE_class-cross = 'RPMPKG="${PV}" \ 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() { : } @@ -79,7 +77,7 @@ do_compile_prepend() { esac sed -i s/FORCE_DEFINE_ARCH/"${ARCH}"/g ${S}/configure.c - ${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 sed -i 's/>/>/g' ${S}/Makefile } @@ -117,4 +115,4 @@ RDEPENDS_${PN}_class-cross = "" ARM_INSTRUCTION_SET = "arm" # http://errors.yoctoproject.org/Errors/Details/186964/ -EXCLUDE_FROM_WORLD_libc-musl = "1" +COMPATIBLE_HOST_libc-musl = 'null' diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-fru-Fix-buffer-overflow-in-ipmi_spd_print_fru.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-fru-Fix-buffer-overflow-in-ipmi_spd_print_fru.patch new file mode 100644 index 00000000..eadfb7ea --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-fru-Fix-buffer-overflow-in-ipmi_spd_print_fru.patch @@ -0,0 +1,53 @@ +From 24aed93efb30a8f557aedc2f03b6ccec758ccbf4 Mon Sep 17 00:00:00 2001 +From: Chrostoper Ertl <chertl@microsoft.com> +Date: Thu, 28 Nov 2019 16:44:18 +0000 +Subject: [PATCH 1/5] fru: Fix buffer overflow in ipmi_spd_print_fru + +Partial fix for CVE-2020-5208, see +https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp + +The `ipmi_spd_print_fru` function has a similar issue as the one fixed +by the previous commit in `read_fru_area_section`. An initial request is +made to get the `fru.size`, which is used as the size for the allocation +of `spd_data`. Inside a loop, further requests are performed to get the +copy sizes which are not checked before being used as the size for a +copy into the buffer. + +Upstream-Status: Backport[https://github.com/ipmitool/ipmitool/commit/840fb1cbb4fb365cb9797300e3374d4faefcdb10] +CVE: CVE-2020-5208 + +Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> +--- + lib/dimm_spd.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/lib/dimm_spd.c b/lib/dimm_spd.c +index 91ae117..4c9c21d 100644 +--- a/lib/dimm_spd.c ++++ b/lib/dimm_spd.c +@@ -1014,7 +1014,7 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id) + struct ipmi_rq req; + struct fru_info fru; + uint8_t *spd_data, msg_data[4]; +- int len, offset; ++ uint32_t len, offset; + + msg_data[0] = id; + +@@ -1091,6 +1091,13 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id) + } + + len = rsp->data[0]; ++ if(rsp->data_len < 1 ++ || len > rsp->data_len - 1 ++ || len > fru.size - offset) ++ { ++ printf(" Not enough buffer size"); ++ return -1; ++ } + memcpy(&spd_data[offset], rsp->data + 1, len); + offset += len; + } while (offset < fru.size); +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-fru-Fix-buffer-overflow-vulnerabilities.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-fru-Fix-buffer-overflow-vulnerabilities.patch new file mode 100644 index 00000000..b65e3ef1 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0001-fru-Fix-buffer-overflow-vulnerabilities.patch @@ -0,0 +1,133 @@ +From e824c23316ae50beb7f7488f2055ac65e8b341f2 Mon Sep 17 00:00:00 2001 +From: Chrostoper Ertl <chertl@microsoft.com> +Date: Thu, 28 Nov 2019 16:33:59 +0000 +Subject: [PATCH] fru: Fix buffer overflow vulnerabilities + +Partial fix for CVE-2020-5208, see +https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp + +The `read_fru_area_section` function only performs size validation of +requested read size, and falsely assumes that the IPMI message will not +respond with more than the requested amount of data; it uses the +unvalidated response size to copy into `frubuf`. If the response is +larger than the request, this can result in overflowing the buffer. + +The same issue affects the `read_fru_area` function. + +Upstream-Status: Backport[https://github.com/ipmitool/ipmitool/commit/e824c23316ae50beb7f7488f2055ac65e8b341f2] +CVE: CVE-2020-5208 + +Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> +--- + lib/ipmi_fru.c | 33 +++++++++++++++++++++++++++++++-- + 1 file changed, 31 insertions(+), 2 deletions(-) + +diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c +index c2a139d..2e323ff 100644 +--- a/lib/ipmi_fru.c ++++ b/lib/ipmi_fru.c +@@ -663,7 +663,10 @@ int + read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + uint32_t offset, uint32_t length, uint8_t *frubuf) + { +- uint32_t off = offset, tmp, finish; ++ uint32_t off = offset; ++ uint32_t tmp; ++ uint32_t finish; ++ uint32_t size_left_in_buffer; + struct ipmi_rs * rsp; + struct ipmi_rq req; + uint8_t msg_data[4]; +@@ -676,10 +679,12 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + + finish = offset + length; + if (finish > fru->size) { ++ memset(frubuf + fru->size, 0, length - fru->size); + finish = fru->size; + lprintf(LOG_NOTICE, "Read FRU Area length %d too large, " + "Adjusting to %d", + offset + length, finish - offset); ++ length = finish - offset; + } + + memset(&req, 0, sizeof(req)); +@@ -715,6 +720,7 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + } + } + ++ size_left_in_buffer = length; + do { + tmp = fru->access ? off >> 1 : off; + msg_data[0] = id; +@@ -756,9 +762,18 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + } + + tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0]; ++ if(rsp->data_len < 1 ++ || tmp > rsp->data_len - 1 ++ || tmp > size_left_in_buffer) ++ { ++ printf(" Not enough buffer size"); ++ return -1; ++ } ++ + memcpy(frubuf, rsp->data + 1, tmp); + off += tmp; + frubuf += tmp; ++ size_left_in_buffer -= tmp; + /* sometimes the size returned in the Info command + * is too large. return 0 so higher level function + * still attempts to parse what was returned */ +@@ -791,7 +806,9 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + uint32_t offset, uint32_t length, uint8_t *frubuf) + { + static uint32_t fru_data_rqst_size = 20; +- uint32_t off = offset, tmp, finish; ++ uint32_t off = offset; ++ uint32_t tmp, finish; ++ uint32_t size_left_in_buffer; + struct ipmi_rs * rsp; + struct ipmi_rq req; + uint8_t msg_data[4]; +@@ -804,10 +821,12 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + + finish = offset + length; + if (finish > fru->size) { ++ memset(frubuf + fru->size, 0, length - fru->size); + finish = fru->size; + lprintf(LOG_NOTICE, "Read FRU Area length %d too large, " + "Adjusting to %d", + offset + length, finish - offset); ++ length = finish - offset; + } + + memset(&req, 0, sizeof(req)); +@@ -822,6 +841,8 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + if (fru->access && fru_data_rqst_size > 16) + #endif + fru_data_rqst_size = 16; ++ ++ size_left_in_buffer = length; + do { + tmp = fru->access ? off >> 1 : off; + msg_data[0] = id; +@@ -853,8 +874,16 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, + } + + tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0]; ++ if(rsp->data_len < 1 ++ || tmp > rsp->data_len - 1 ++ || tmp > size_left_in_buffer) ++ { ++ printf(" Not enough buffer size"); ++ return -1; ++ } + memcpy((frubuf + off)-offset, rsp->data + 1, tmp); + off += tmp; ++ size_left_in_buffer -= tmp; + + /* sometimes the size returned in the Info command + * is too large. return 0 so higher level function +-- +2.17.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0002-session-Fix-buffer-overflow-in-ipmi_get_session_info.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0002-session-Fix-buffer-overflow-in-ipmi_get_session_info.patch new file mode 100644 index 00000000..b8742b1a --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0002-session-Fix-buffer-overflow-in-ipmi_get_session_info.patch @@ -0,0 +1,53 @@ +From 81144cfba131b4ddbfcf9c530274b23bfc7e0ea8 Mon Sep 17 00:00:00 2001 +From: Chrostoper Ertl <chertl@microsoft.com> +Date: Thu, 28 Nov 2019 16:51:49 +0000 +Subject: [PATCH 2/5] session: Fix buffer overflow in ipmi_get_session_info + +Partial fix for CVE-2020-5208, see +https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp + +The `ipmi_get_session_info` function does not properly check the +response `data_len`, which is used as a copy size, allowing stack buffer +overflow. + +Upstream-Status: Backport[https://github.com/ipmitool/ipmitool/commit/41d7026946fafbd4d1ec0bcaca3ea30a6e8eed22] +CVE: CVE-2020-5208 + +Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> +--- + lib/ipmi_session.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/lib/ipmi_session.c b/lib/ipmi_session.c +index 4855bc4..71bef4c 100644 +--- a/lib/ipmi_session.c ++++ b/lib/ipmi_session.c +@@ -319,8 +319,10 @@ ipmi_get_session_info(struct ipmi_intf * intf, + } + else + { +- memcpy(&session_info, rsp->data, rsp->data_len); +- print_session_info(&session_info, rsp->data_len); ++ memcpy(&session_info, rsp->data, ++ __min(rsp->data_len, sizeof(session_info))); ++ print_session_info(&session_info, ++ __min(rsp->data_len, sizeof(session_info))); + } + break; + +@@ -351,8 +353,10 @@ ipmi_get_session_info(struct ipmi_intf * intf, + break; + } + +- memcpy(&session_info, rsp->data, rsp->data_len); +- print_session_info(&session_info, rsp->data_len); ++ memcpy(&session_info, rsp->data, ++ __min(rsp->data_len, sizeof(session_info))); ++ print_session_info(&session_info, ++ __min(rsp->data_len, sizeof(session_info))); + + } while (i <= session_info.session_slot_count); + break; +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0003-channel-Fix-buffer-overflow.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0003-channel-Fix-buffer-overflow.patch new file mode 100644 index 00000000..deebd356 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0003-channel-Fix-buffer-overflow.patch @@ -0,0 +1,69 @@ +From 5057761e30e3a7682edab60f98f631616392ddc6 Mon Sep 17 00:00:00 2001 +From: Chrostoper Ertl <chertl@microsoft.com> +Date: Thu, 28 Nov 2019 16:56:38 +0000 +Subject: [PATCH 3/3] channel: Fix buffer overflow +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Partial fix for CVE-2020-5208, see +https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp + +The `ipmi_get_channel_cipher_suites` function does not properly check +the final response’s `data_len`, which can lead to stack buffer overflow +on the final copy. + +Upstream-Status: Backport[https://github.com/ipmitool/ipmitool/commit/9452be87181a6e83cfcc768b3ed8321763db50e4] +CVE: CVE-2020-5208 + +[Make some changes to apply it] +Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> +--- + include/ipmitool/ipmi_channel.h | 2 ++ + lib/ipmi_channel.c | 10 ++++++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/include/ipmitool/ipmi_channel.h b/include/ipmitool/ipmi_channel.h +index b138c26..d7cce5e 100644 +--- a/include/ipmitool/ipmi_channel.h ++++ b/include/ipmitool/ipmi_channel.h +@@ -77,6 +77,8 @@ struct channel_access_t { + uint8_t user_level_auth; + }; + ++#define MAX_CIPHER_SUITE_DATA_LEN 0x10 ++ + /* + * The Get Authentication Capabilities response structure + * From table 22-15 of the IPMI v2.0 spec +diff --git a/lib/ipmi_channel.c b/lib/ipmi_channel.c +index fab2e54..76ecdcd 100644 +--- a/lib/ipmi_channel.c ++++ b/lib/ipmi_channel.c +@@ -378,7 +378,10 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf *intf, const char *payload_type, + lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites"); + return -1; + } +- if (rsp->ccode > 0) { ++ if (rsp->ccode ++ || rsp->data_len < 1 ++ || rsp->data_len > sizeof(uint8_t) + MAX_CIPHER_SUITE_DATA_LEN) ++ { + lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s", + val2str(rsp->ccode, completion_code_vals)); + return -1; +@@ -413,7 +416,10 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf *intf, const char *payload_type, + lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites"); + return -1; + } +- if (rsp->ccode > 0) { ++ if (rsp->ccode ++ || rsp->data_len < 1 ++ || rsp->data_len > sizeof(uint8_t) + MAX_CIPHER_SUITE_DATA_LEN) ++ { + lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s", + val2str(rsp->ccode, completion_code_vals)); + return -1; +-- +2.18.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0004-lanp-Fix-buffer-overflows-in-get_lan_param_select.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0004-lanp-Fix-buffer-overflows-in-get_lan_param_select.patch new file mode 100644 index 00000000..b5ce9e92 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0004-lanp-Fix-buffer-overflows-in-get_lan_param_select.patch @@ -0,0 +1,94 @@ +From e6aa6076f65e71544bd6450d20d943d7baaccb9f Mon Sep 17 00:00:00 2001 +From: Chrostoper Ertl <chertl@microsoft.com> +Date: Thu, 28 Nov 2019 17:06:39 +0000 +Subject: [PATCH 4/5] lanp: Fix buffer overflows in get_lan_param_select +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Partial fix for CVE-2020-5208, see +https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp + +The `get_lan_param_select` function is missing a validation check on the +response’s `data_len`, which it then returns to caller functions, where +stack buffer overflow can occur. + +Upstream-Status: Backport[https://github.com/ipmitool/ipmitool/commit/d45572d71e70840e0d4c50bf48218492b79c1a10] +CVE: CVE-2020-5208 + +[Make some changes to apply it] +Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> +--- + lib/ipmi_lanp.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c +index 060e753..dee21ee 100644 +--- a/lib/ipmi_lanp.c ++++ b/lib/ipmi_lanp.c +@@ -1917,7 +1917,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, + if (p == NULL) { + return (-1); + } +- memcpy(data, p->data, p->data_len); ++ memcpy(data, p->data, __min(p->data_len, sizeof(data))); + /* set new ipaddr */ + memcpy(data+3, temp, 4); + printf("Setting LAN Alert %d IP Address to %d.%d.%d.%d\n", alert, +@@ -1932,7 +1932,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, + if (p == NULL) { + return (-1); + } +- memcpy(data, p->data, p->data_len); ++ memcpy(data, p->data, __min(p->data_len, sizeof(data))); + /* set new macaddr */ + memcpy(data+7, temp, 6); + printf("Setting LAN Alert %d MAC Address to " +@@ -1947,7 +1947,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, + if (p == NULL) { + return (-1); + } +- memcpy(data, p->data, p->data_len); ++ memcpy(data, p->data, __min(p->data_len, sizeof(data))); + + if (strncasecmp(argv[1], "def", 3) == 0 || + strncasecmp(argv[1], "default", 7) == 0) { +@@ -1973,7 +1973,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, + if (p == NULL) { + return (-1); + } +- memcpy(data, p->data, p->data_len); ++ memcpy(data, p->data, __min(p->data_len, sizeof(data))); + + if (strncasecmp(argv[1], "on", 2) == 0 || + strncasecmp(argv[1], "yes", 3) == 0) { +@@ -1998,7 +1998,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, + if (p == NULL) { + return (-1); + } +- memcpy(data, p->data, p->data_len); ++ memcpy(data, p->data, __min(p->data_len, sizeof(data))); + + if (strncasecmp(argv[1], "pet", 3) == 0) { + printf("Setting LAN Alert %d destination to PET Trap\n", alert); +@@ -2026,7 +2026,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, + if (p == NULL) { + return (-1); + } +- memcpy(data, p->data, p->data_len); ++ memcpy(data, p->data, __min(p->data_len, sizeof(data))); + + if (str2uchar(argv[1], &data[2]) != 0) { + lprintf(LOG_ERR, "Invalid time: %s", argv[1]); +@@ -2042,7 +2042,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, + if (p == NULL) { + return (-1); + } +- memcpy(data, p->data, p->data_len); ++ memcpy(data, p->data, __min(p->data_len, sizeof(data))); + + if (str2uchar(argv[1], &data[3]) != 0) { + lprintf(LOG_ERR, "Invalid retry: %s", argv[1]); +-- +1.9.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0005-fru-sdr-Fix-id_string-buffer-overflows.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0005-fru-sdr-Fix-id_string-buffer-overflows.patch new file mode 100644 index 00000000..cf8b9254 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmitool/ipmitool/0005-fru-sdr-Fix-id_string-buffer-overflows.patch @@ -0,0 +1,142 @@ +From 26e64ca78ae844c5ceedde89531e2924d7d4594c Mon Sep 17 00:00:00 2001 +From: Chrostoper Ertl <chertl@microsoft.com> +Date: Thu, 28 Nov 2019 17:13:45 +0000 +Subject: [PATCH 5/5] fru, sdr: Fix id_string buffer overflows + +Final part of the fixes for CVE-2020-5208, see +https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp + +9 variants of stack buffer overflow when parsing `id_string` field of +SDR records returned from `CMD_GET_SDR` command. + +SDR record structs have an `id_code` field, and an `id_string` `char` +array. + +The length of `id_string` is calculated as `(id_code & 0x1f) + 1`, +which can be larger than expected 16 characters (if `id_code = 0xff`, +then length will be `(0xff & 0x1f) + 1 = 32`). + +In numerous places, this can cause stack buffer overflow when copying +into fixed buffer of size `17` bytes from this calculated length. + +Upstream-Status: Backport[https://github.com/ipmitool/ipmitool/commit/7ccea283dd62a05a320c1921e3d8d71a87772637] +CVE: CVE-2020-5208 + +Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> +--- + lib/ipmi_fru.c | 2 +- + lib/ipmi_sdr.c | 40 ++++++++++++++++++++++++---------------- + 2 files changed, 25 insertions(+), 17 deletions(-) + +diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c +index b71ea23..1decea2 100644 +--- a/lib/ipmi_fru.c ++++ b/lib/ipmi_fru.c +@@ -3038,7 +3038,7 @@ ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru) + return 0; + + memset(desc, 0, sizeof(desc)); +- memcpy(desc, fru->id_string, fru->id_code & 0x01f); ++ memcpy(desc, fru->id_string, __min(fru->id_code & 0x01f, sizeof(desc))); + desc[fru->id_code & 0x01f] = 0; + printf("FRU Device Description : %s (ID %d)\n", desc, fru->device_id); + +diff --git a/lib/ipmi_sdr.c b/lib/ipmi_sdr.c +index fa7b082..175a86f 100644 +--- a/lib/ipmi_sdr.c ++++ b/lib/ipmi_sdr.c +@@ -2113,7 +2113,7 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf, + return -1; + + memset(desc, 0, sizeof (desc)); +- snprintf(desc, (sensor->id_code & 0x1f) + 1, "%s", sensor->id_string); ++ snprintf(desc, sizeof(desc), "%.*s", (sensor->id_code & 0x1f) + 1, sensor->id_string); + + if (verbose) { + printf("Sensor ID : %s (0x%x)\n", +@@ -2164,7 +2164,7 @@ ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf, + return -1; + + memset(desc, 0, sizeof (desc)); +- snprintf(desc, (mc->id_code & 0x1f) + 1, "%s", mc->id_string); ++ snprintf(desc, sizeof(desc), "%.*s", (mc->id_code & 0x1f) + 1, mc->id_string); + + if (verbose == 0) { + if (csv_output) +@@ -2257,7 +2257,7 @@ ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf, + char desc[17]; + + memset(desc, 0, sizeof (desc)); +- snprintf(desc, (dev->id_code & 0x1f) + 1, "%s", dev->id_string); ++ snprintf(desc, sizeof(desc), "%.*s", (dev->id_code & 0x1f) + 1, dev->id_string); + + if (!verbose) { + if (csv_output) +@@ -2314,7 +2314,7 @@ ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf, + char desc[17]; + + memset(desc, 0, sizeof (desc)); +- snprintf(desc, (fru->id_code & 0x1f) + 1, "%s", fru->id_string); ++ snprintf(desc, sizeof(desc), "%.*s", (fru->id_code & 0x1f) + 1, fru->id_string); + + if (!verbose) { + if (csv_output) +@@ -2518,35 +2518,43 @@ ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf,uint16_t id, + + int rc =0; + char desc[17]; ++ const char *id_string; ++ uint8_t id_code; + memset(desc, ' ', sizeof (desc)); + + switch ( type) { + case SDR_RECORD_TYPE_FULL_SENSOR: + record.full = (struct sdr_record_full_sensor *) raw; +- snprintf(desc, (record.full->id_code & 0x1f) +1, "%s", +- (const char *)record.full->id_string); ++ id_code = record.full->id_code; ++ id_string = record.full->id_string; + break; ++ + case SDR_RECORD_TYPE_COMPACT_SENSOR: + record.compact = (struct sdr_record_compact_sensor *) raw ; +- snprintf(desc, (record.compact->id_code & 0x1f) +1, "%s", +- (const char *)record.compact->id_string); ++ id_code = record.compact->id_code; ++ id_string = record.compact->id_string; + break; ++ + case SDR_RECORD_TYPE_EVENTONLY_SENSOR: + record.eventonly = (struct sdr_record_eventonly_sensor *) raw ; +- snprintf(desc, (record.eventonly->id_code & 0x1f) +1, "%s", +- (const char *)record.eventonly->id_string); +- break; ++ id_code = record.eventonly->id_code; ++ id_string = record.eventonly->id_string; ++ break; ++ + case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR: + record.mcloc = (struct sdr_record_mc_locator *) raw ; +- snprintf(desc, (record.mcloc->id_code & 0x1f) +1, "%s", +- (const char *)record.mcloc->id_string); ++ id_code = record.mcloc->id_code; ++ id_string = record.mcloc->id_string; + break; ++ + default: + rc = -1; +- break; +- } ++ } ++ if (!rc) { ++ snprintf(desc, sizeof(desc), "%.*s", (id_code & 0x1f) + 1, id_string); ++ } + +- lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc); ++ lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc); + return rc; + } + +-- +1.9.1 + 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 index b7f1aa91..3de9a92a 100644 --- 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 @@ -24,6 +24,12 @@ DEPENDS = "openssl readline ncurses" SRC_URI = "${SOURCEFORGE_MIRROR}/ipmitool/ipmitool-${PV}.tar.bz2 \ file://0001-Migrate-to-openssl-1.1.patch \ + file://0001-fru-Fix-buffer-overflow-vulnerabilities.patch \ + file://0001-fru-Fix-buffer-overflow-in-ipmi_spd_print_fru.patch \ + file://0002-session-Fix-buffer-overflow-in-ipmi_get_session_info.patch \ + file://0003-channel-Fix-buffer-overflow.patch \ + file://0004-lanp-Fix-buffer-overflows-in-get_lan_param_select.patch \ + file://0005-fru-sdr-Fix-id_string-buffer-overflows.patch \ " SRC_URI[md5sum] = "bab7ea104c7b85529c3ef65c54427aa3" SRC_URI[sha256sum] = "0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/0001-Prevent-access-times-from-changing-resulting-gzip-md.patch b/external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/0001-Prevent-access-times-from-changing-resulting-gzip-md.patch new file mode 100644 index 00000000..78c05ef3 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/ipmiutil/ipmiutil/0001-Prevent-access-times-from-changing-resulting-gzip-md.patch @@ -0,0 +1,25 @@ +From da668e5bf1a721797361ab866d09913ee8e157c4 Mon Sep 17 00:00:00 2001 +From: Jeremy Puhlman <jpuhlman@mvista.com> +Date: Sat, 22 Feb 2020 04:37:04 +0000 +Subject: [PATCH] Prevent access times from changing resulting gzip md5sum + +Upstream-Status: Pending +https://github.com/ipmitool/ipmitool/pull/186 +--- + doc/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index b792762..2c52ce6 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -59,5 +59,5 @@ install: + ${INSTALL_DATA_SH} iuser.8 ${manto} + ${INSTALL_DATA_SH} iseltime.8 ${manto} + ${INSTALL_DATA_SH} bmclanpet.mib ${datato} +- cd ${manto}; gzip -f *.8 ++ cd ${manto}; gzip -nf *.8 + +-- +2.13.3 + 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.1.5.bb index 338cafd5..d0f3688a 100644 --- 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.1.5.bb @@ -21,9 +21,10 @@ PARALLEL_MAKE = "" SRC_URI = "${SOURCEFORGE_MIRROR}/ipmiutil/ipmiutil-${PV}.tar.gz \ file://fix_systemd_path.patch \ + file://0001-Prevent-access-times-from-changing-resulting-gzip-md.patch \ " -SRC_URI[md5sum] = "5feaf6a827205792e057bb4ff5c4e842" -SRC_URI[sha256sum] = "b2d7f72535131c7832ba4be13dc33c81513fc3ee43fe797b4b52014600ecee5e" +SRC_URI[md5sum] = "292d6df25cad678bb27e5c8cdc6748f9" +SRC_URI[sha256sum] = "58ccdbd5755d7dd72478756715af09e9c73330dfad2b91dbf03d2ac504b301a3" inherit autotools-brokensep pkgconfig systemd 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 index 181e97ca..3687c267 100644 --- 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 @@ -18,11 +18,16 @@ SRC_URI += "file://run-ptest \ # 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 ??= "bpf firmware vm" PACKAGECONFIG_remove_x86 = "bpf" PACKAGECONFIG_remove_arm = "bpf" +# host ptrace.h is used to compile BPF target but mips ptrace.h is needed +# progs/loop1.c:21:9: error: incomplete definition of type 'struct user_pt_regs' +# m = PT_REGS_RC(ctx); +PACKAGECONFIG_remove_qemumips = "bpf" PACKAGECONFIG[bpf] = ",,elfutils libcap libcap-ng rsync-native," +PACKAGECONFIG[firmware] = ",,libcap, bash" PACKAGECONFIG[vm] = ",,libcap,libgcc bash" do_patch[depends] += "virtual/kernel:do_shared_workdir" @@ -32,13 +37,15 @@ inherit linux-kernel-base kernel-arch ptest S = "${WORKDIR}/${BP}" TEST_LIST = "\ - ${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \ + ${@bb.utils.filter('PACKAGECONFIG', 'bpf firmware vm', d)} \ + rtc \ " EXTRA_OEMAKE = '\ CROSS_COMPILE=${TARGET_PREFIX} \ ARCH=${ARCH} \ CC="${CC}" \ + CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS}" \ AR="${AR}" \ LD="${LD}" \ DESTDIR="${D}" \ @@ -52,20 +59,14 @@ KERNEL_SELFTEST_SRC ?= "Makefile \ 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" + if [ ${@bb.utils.contains('PACKAGECONFIG', 'bpf', 'True', 'False', d)} = 'True' ]; then + if [ ${@bb.utils.contains('DEPENDS', 'clang-native', 'True', 'False', d)} = 'False' ]; then + 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" + fi + fi + for i in ${TEST_LIST} do oe_runmake -C ${S}/tools/testing/selftests/${i} @@ -121,3 +122,11 @@ 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" + +SECURITY_CFLAGS = "" +COMPATIBLE_HOST_libc-musl = 'null' + +# It has native clang/llvm dependency, poky distro is reluctant to include them as deps +# this helps with world builds on AB +EXCLUDE_FROM_WORLD = "1" + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc index cd819f31..1f70f720 100644 --- a/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc +++ b/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch.inc @@ -15,7 +15,9 @@ EXTRA_OEMAKE = " \ LIBDIR=${D}${libdir} \ MANDIR=${D}${mandir}/man1 \ SYSTEMDDIR=${D}${systemd_system_unitdir} \ + UPSTARTDIR=${D}${sysconfdir}/init \ DESTDIR=${D} \ + ARCH=${TARGET_ARCH} \ BUILDMOD=no \ CC='${CC}' \ " 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 index ab3b1276..348d82ac 100644 --- 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 @@ -1,6 +1,6 @@ -From 70de3fecbc551907c4fd504cfff385c73be8db75 Mon Sep 17 00:00:00 2001 -From: Ruslan Bilovol <rbilovol@cisco.com> -Date: Tue, 19 Dec 2017 15:59:04 +0200 +From 21909e3f9096fa8e4825df8c65114ee92ab3d532 Mon Sep 17 00:00:00 2001 +From: Zang Ruochen <zangrc.fnst@cn.fujitsu.com> +Date: Wed, 7 Aug 2019 02:57:35 +0900 Subject: [PATCH] kpatch-build: add cross-compilation support This patch introduces new option for kpatch-build @@ -17,44 +17,45 @@ 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 a76913f..4a011aa 100755 +index 9ef3809..463dab1 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build -@@ -197,7 +197,7 @@ gcc_version_check() { +@@ -198,7 +198,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 <CACHEDIR>/tmp" >&2 + if [[ -n "$OOT_MODULE" ]]; then + kgccver="$(gcc_version_from_file "$OOT_MODULE")" +@@ -411,6 +411,8 @@ usage() { echo " (can be specified multiple times)" >&2 + echo " -e, --oot-module Enable patching out-of-tree module," >&2 + echo " specify current version of module" >&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 " --skip-gcc-check Skip gcc version matching check" >&2 + echo " (not recommended)" >&2 +@@ -416,7 +418,7 @@ usage() { 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" +-options="$(getopt -o ha:r:s:c:v:j:t:n:o:de: -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,debug,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed" ++options="$(getopt -o ha:r:s:c:v:j:t:n:o:de: -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,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 +@@ -479,6 +481,10 @@ while [[ $# -gt 0 ]]; do + OOT_MODULE="$(readlink -f "$2")" + shift ;; + --cross-compile) + KPATCH_CROSS_COMPILE="$2" @@ -63,17 +64,17 @@ index a76913f..4a011aa 100755 --skip-cleanup) echo "Skipping cleanup" SKIPCLEANUP=1 -@@ -710,6 +716,8 @@ if [[ $DEBUG -ge 4 ]]; then +@@ -757,6 +763,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 + echo "Building original source" + [[ -n "$OOT_MODULE" ]] || ./scripts/setlocalversion --save-scmversion || die unset KPATCH_GCC_TEMPDIR -@@ -874,6 +882,7 @@ cd "$TEMPDIR/patch" || die - KPATCH_BUILD="$SRCDIR" KPATCH_NAME="$MODNAME" \ +@@ -940,6 +948,7 @@ fi + KPATCH_BUILD="$KPATCH_BUILD" KPATCH_NAME="$MODNAME" \ KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS" \ KPATCH_LDFLAGS="$KPATCH_LDFLAGS" \ +CROSS_COMPILE="$KPATCH_CROSS_COMPILE" \ @@ -81,7 +82,7 @@ index a76913f..4a011aa 100755 if ! "$KPATCH_MODULE"; then diff --git a/kpatch-build/kpatch-gcc b/kpatch-build/kpatch-gcc -index 2d56da1..59a4255 100755 +index 9663290..56e6c8f 100755 --- a/kpatch-build/kpatch-gcc +++ b/kpatch-build/kpatch-gcc @@ -8,7 +8,7 @@ TOOLCHAINCMD="$1" @@ -93,9 +94,12 @@ index 2d56da1..59a4255 100755 fi declare -a args=("$@") -@@ -82,4 +82,4 @@ elif [[ "$TOOLCHAINCMD" = "ld" ]] ; then +@@ -84,4 +84,4 @@ elif [[ "$TOOLCHAINCMD" = "ld" ]] ; then done fi -exec "$TOOLCHAINCMD" "${args[@]}" +exec ${KPATCH_CROSS_COMPILE}${TOOLCHAINCMD} "${args[@]}" +-- +2.7.4 + 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 index 13cdc6bf..0cc36841 100644 --- 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 @@ -1,6 +1,6 @@ -From 15838a86d5ea94fa05976ea32fd847b18261b403 Mon Sep 17 00:00:00 2001 -From: Ruslan Bilovol <rbilovol@cisco.com> -Date: Tue, 2 Jan 2018 14:50:03 +0200 +From 4143fa0092fe4cafee10b24a97d3ad0b41ab7a30 Mon Sep 17 00:00:00 2001 +From: Zang Ruochen <zangrc.fnst@cn.fujitsu.com> +Date: Wed, 7 Aug 2019 03:24:39 +0900 Subject: [PATCH] kpatch-build: allow overriding of distro name It is sometimes useful to have ability to override @@ -14,17 +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 4a011aa..eb6cd64 100755 +index 39933fc..c0258a2 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build -@@ -394,12 +394,13 @@ usage() { - echo " (can be specified multiple times)" >&2 +@@ -413,12 +413,13 @@ usage() { + echo " specify current version of module" >&2 echo " --cross-compile Specify the prefix used for all executables" >&2 echo " used during compilation" >&2 + echo " --distro Override distro name" >&2 @@ -33,12 +32,12 @@ index 4a011aa..eb6cd64 100755 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" +-options="$(getopt -o ha:r:s:c:v:j:t:n:o:de: -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,debug,cross-compile:,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed" ++options="$(getopt -o ha:r:s:c:v:j:t:n:o:de: -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,debug,cross-compile:,distro:,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed" eval set -- "$options" -@@ -461,6 +462,10 @@ while [[ $# -gt 0 ]]; do +@@ -485,6 +486,10 @@ while [[ $# -gt 0 ]]; do KPATCH_CROSS_COMPILE="$2" shift ;; @@ -49,12 +48,15 @@ index 4a011aa..eb6cd64 100755 --skip-cleanup) echo "Skipping cleanup" SKIPCLEANUP=1 -@@ -539,7 +544,7 @@ fi +@@ -613,7 +613,7 @@ fi # Don't check external file. - # shellcheck disable=SC1091 - source /etc/os-release + # shellcheck disable=SC1090 + [[ -f "$RELEASE_FILE" ]] && source "$RELEASE_FILE" -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" +-- +2.7.4 + 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 index 024cca65..ba3983e6 100644 --- a/external/meta-openembedded/meta-oe/recipes-kernel/kpatch/kpatch_git.bb +++ b/external/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 = "7f550f01bd308cf058ae782327d29c8916cc5602" +SRCREV = "0c3c21930895f6582a5c9d9d797f7e11ff41ffb2" -PV = "0.6.1+git${SRCPV}" +PV = "0.9.1" S = "${WORKDIR}/git" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/libpfm/libpfm4/0001-Include-poll.h-instead-of-sys-poll.h.patch b/external/meta-openembedded/meta-oe/recipes-kernel/libpfm/libpfm4/0001-Include-poll.h-instead-of-sys-poll.h.patch new file mode 100644 index 00000000..fe13df2b --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/libpfm/libpfm4/0001-Include-poll.h-instead-of-sys-poll.h.patch @@ -0,0 +1,86 @@ +From f62b629c1e1e968f90aafbc0cf9116b49eea9d8e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 15 Dec 2019 16:24:37 -0800 +Subject: [PATCH] Include poll.h instead of sys/poll.h + +Fixes +error: redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror,-W#warnings] + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + perf_examples/branch_smpl.c | 2 +- + perf_examples/syst_smpl.c | 2 +- + perf_examples/task_attach_timeout.c | 2 +- + perf_examples/task_smpl.c | 2 +- + perf_examples/x86/bts_smpl.c | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/perf_examples/branch_smpl.c b/perf_examples/branch_smpl.c +index 87cd303..4d16b04 100644 +--- a/perf_examples/branch_smpl.c ++++ b/perf_examples/branch_smpl.c +@@ -32,7 +32,7 @@ + #include <getopt.h> + #include <setjmp.h> + #include <sys/wait.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <sys/mman.h> + #include <locale.h> + #include <sys/ioctl.h> +diff --git a/perf_examples/syst_smpl.c b/perf_examples/syst_smpl.c +index 04580fd..d059c08 100755 +--- a/perf_examples/syst_smpl.c ++++ b/perf_examples/syst_smpl.c +@@ -33,7 +33,7 @@ + #include <setjmp.h> + #include <sys/ptrace.h> + #include <sys/wait.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <sys/ioctl.h> + #include <sys/mman.h> + #include <fcntl.h> +diff --git a/perf_examples/task_attach_timeout.c b/perf_examples/task_attach_timeout.c +index 7fc5524..a0367c8 100644 +--- a/perf_examples/task_attach_timeout.c ++++ b/perf_examples/task_attach_timeout.c +@@ -36,7 +36,7 @@ + #include <stdarg.h> + #include <sys/wait.h> + #include <err.h> +-#include <sys/poll.h> ++#include <poll.h> + + #include "perf_util.h" + +diff --git a/perf_examples/task_smpl.c b/perf_examples/task_smpl.c +index dcb7481..95c432c 100644 +--- a/perf_examples/task_smpl.c ++++ b/perf_examples/task_smpl.c +@@ -37,7 +37,7 @@ + #include <getopt.h> + #include <setjmp.h> + #include <sys/wait.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <sys/mman.h> + #include <locale.h> + #include <sys/ioctl.h> +diff --git a/perf_examples/x86/bts_smpl.c b/perf_examples/x86/bts_smpl.c +index 6498776..d66d5e6 100644 +--- a/perf_examples/x86/bts_smpl.c ++++ b/perf_examples/x86/bts_smpl.c +@@ -41,7 +41,7 @@ + #include <sys/time.h> + #include <sys/ptrace.h> + #include <sys/wait.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <sys/mman.h> + #include <sys/resource.h> + #include <err.h> +-- +2.24.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/libpfm/libpfm4_4.10.1.bb b/external/meta-openembedded/meta-oe/recipes-kernel/libpfm/libpfm4_4.10.1.bb new file mode 100644 index 00000000..ff56d480 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/libpfm/libpfm4_4.10.1.bb @@ -0,0 +1,32 @@ +SUMMARY = "Monitoring tools exploiting the performance monitoring events" +DESCRIPTION = "This package provides a library, called libpfm4 which is used to develop \ +monitoring tools exploiting the performance monitoring events such as those \ +provided by the Performance Monitoring Unit (PMU) of modern processors." +HOMEPAGE = "http://perfmon2.sourceforge.net/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=144822&atid=759953&source=navbar" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=0de488f3bd4424e308e2e399cb99c788" + +SECTION = "devel" + +COMPATIBLE_HOST = "powerpc64" + +SRC_URI = "${SOURCEFORGE_MIRROR}/perfmon2/${BPN}/libpfm-${PV}.tar.gz \ + file://0001-Include-poll.h-instead-of-sys-poll.h.patch \ + " +SRC_URI[md5sum] = "d8f66cb9bfa7e1434434e0de6409db5b" +SRC_URI[sha256sum] = "c61c575378b5c17ccfc5806761e4038828610de76e2e34fac9f7fa73ba844b49" + +UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/perfmon2/files/libpfm4/" + +EXTRA_OEMAKE = "DESTDIR=\"${D}\" PREFIX=\"${prefix}\" LIBDIR=\"${libdir}\" LDCONFIG=\"true\"" +EXTRA_OEMAKE_append_powerpc = " ARCH=\"powerpc\"" +EXTRA_OEMAKE_append_powerpc64 = " ARCH=\"powerpc\" BITMODE=\"64\"" +EXTRA_OEMAKE_append_powerpc64le = " ARCH=\"powerpc\" BITMODE=\"64\"" + +S = "${WORKDIR}/libpfm-${PV}" + +do_install () { + oe_runmake install +} 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 index a4780652..ff093a72 100644 --- 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 @@ -1,4 +1,4 @@ -From 8eeb1b15608ce1a9a1f0d5417938fd6da4504406 Mon Sep 17 00:00:00 2001 +From af97e2ad643334b4c7c3d66f971ce9ebb2b596af 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,30 +13,28 @@ 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(-) + Makefile | 45 +++++++++++++++++++++++---------------------- + 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile -index 612b9d0..f6d6265 100644 +index 1fdb628..5dce589 100644 --- a/Makefile +++ b/Makefile -@@ -8,13 +8,6 @@ ifeq ($(strip $CC),) +@@ -8,12 +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 +-CFLAGS_BASE := $(CFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ +- -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE +-CFLAGS := $(CFLAGS_BASE) -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"' +-CFLAGS_ARCH := $(CFLAGS_BASE) -# 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)),) +@@ -21,29 +15,36 @@ ifeq ($(strip($TARGET)),) TARGET := $(HOST_ARCH) endif @@ -72,20 +70,20 @@ index 612b9d0..f6d6265 100644 endif +CFLAGS_ARCH += $(CFLAGS) \ -+ -D_FILE_OFFSET_BITS=64 \ -+ -D_LARGEFILE_SOURCE \ -+ -D_LARGEFILE64_SOURCE ++ -D_FILE_OFFSET_BITS=64 \ ++ -D_LARGEFILE_SOURCE \ ++ -D_LARGEFILE64_SOURCE + +CFLAGS_COMMON = $(CFLAGS_ARCH) \ -+ -DVERSION='"$(VERSION)"' \ -+ -DRELEASE_DATE='"$(DATE)"' ++ -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)) +@@ -52,17 +53,17 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) - LIBS = -ldw -lbz2 -lebl -ldl -lelf -lz + LIBS = -ldw -lbz2 -ldl -lelf -lz ifneq ($(LINKTYPE), dynamic) -LIBS := -static $(LIBS) +LIBS := $(LIBS) @@ -104,7 +102,7 @@ index 612b9d0..f6d6265 100644 endif LIBS := -lpthread $(LIBS) -@@ -71,14 +71,14 @@ LIBS := -lpthread $(LIBS) +@@ -87,14 +88,14 @@ LIBS := $(LIBS) $(call try-run,\ all: makedumpfile $(OBJ_PART): $(SRC_PART) @@ -121,7 +119,7 @@ index 612b9d0..f6d6265 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 -@@ -89,7 +89,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) +@@ -105,7 +106,7 @@ makedumpfile: $(SRC_BASE) $(OBJ_PART) $(OBJ_ARCH) gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz eppic_makedumpfile.so: extension_eppic.c @@ -130,3 +128,6 @@ index 612b9d0..f6d6265 100644 clean: rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8.gz makedumpfile.conf.5.gz +-- +2.21.0 + 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 index 766f4fc7..1707df3e 100644 --- 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 @@ -1,4 +1,4 @@ -From ba123fa6b2aa0ac62d1b78f327339635ae87201a Mon Sep 17 00:00:00 2001 +From 9045b72bdb703bf58a6586d77461eea8f59f50f7 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 @@ -21,15 +21,18 @@ Upstream-Status: Pending Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com> Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +[hqBai: adjusted patch for context, no logical change] +Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> --- - arch/ppc64.c | 28 ++-------------------------- - 1 file changed, 2 insertions(+), 26 deletions(-) + arch/ppc64.c | 38 ++------------------------------------ + 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/arch/ppc64.c b/arch/ppc64.c -index 8b6f7d5..458f06b 100644 +index 9d8f252..6f4860f 100644 --- a/arch/ppc64.c +++ b/arch/ppc64.c -@@ -462,38 +462,14 @@ ppc64_vtop_level4(unsigned long vaddr) +@@ -462,48 +462,14 @@ ppc64_vtop_level4(unsigned long vaddr) return paddr; } @@ -52,6 +55,16 @@ index 8b6f7d5..458f06b 100644 - || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) - return TRUE; - +- info->max_physmem_bits = _MAX_PHYSMEM_BITS_4_19; +- 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_4_20; +- if ((array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT_EXTREME())) +- || (array_len == (NR_MEM_SECTIONS() / _SECTIONS_PER_ROOT()))) +- return TRUE; +- - return FALSE; -} - @@ -70,3 +83,6 @@ index 8b6f7d5..458f06b 100644 info->page_offset = __PAGE_OFFSET; if (SYMBOL(_stext) == NOT_FOUND_SYMBOL) { +-- +2.21.0 + 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.7.bb index 33194b85..8d1676a4 100644 --- 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.7.bb @@ -25,8 +25,8 @@ 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] = "7dfbca19f487604c271e2892ba07f4bd" -SRC_URI[sha256sum] = "7e06f72d5f291fcab9e92975f405a76e37d4f7fc8fa4172f199636398ae812b1" +SRC_URI[md5sum] = "808ef840ca49ca6bfde77c097cf429f5" +SRC_URI[sha256sum] = "e702fbdf62b4cd829a76e46f3e24eb3fc7501918b85ebdcd8baef4f53d6ee2c8" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/makedumpfile/files/makedumpfile/" UPSTREAM_CHECK_REGEX = "makedumpfile/(?P<pver>\d+(\.\d+)+)/" 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.1.bb index bae5cf4f..051656b5 100644 --- 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.1.bb @@ -1,7 +1,7 @@ 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 \ +LIC_FILES_CHKSUM = "file://COPYING;md5=71827c617ec7b45a0dd23658347cc1e9 \ file://COPYING.BSD;md5=b915ac80d5236d6aa659cb986daf00e5 \ file://COPYING.LGPLv2.1;md5=321bf41f280cf805086dd5a720b37785 \ " @@ -9,14 +9,13 @@ DEPENDS = "elfutils dbus dbus-glib-native glib-2.0 dbus-glib util-linux json-c" inherit autotools pkgconfig systemd update-rc.d -SRCREV = "1c0d5960b0bb4bac7566e6afe8bc9705399cc76b" +SRCREV = "16a0d44f1725eaa93096eaa0e086f42ef4c2712c" 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" @@ -44,4 +43,4 @@ do_install_append() { } # http://errors.yoctoproject.org/Errors/Details/186966/ -EXCLUDE_FROM_WORLD_libc-musl = "1" +COMPATIBLE_HOST_libc-musl = 'null' diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc index 349e2bf5..0e1e2ed8 100644 --- a/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc +++ b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile.inc @@ -12,7 +12,6 @@ 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" @@ -25,6 +24,8 @@ 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-replace-sym_iterator-0-with-sym_iterator.patch \ + file://0001-Use-new-bfd-APIs-from-2.34.patch \ " UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch new file mode 100644 index 00000000..faf56d11 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch @@ -0,0 +1,79 @@ +From 34745fb066a266ae6bbb15d08466d4d2cb6a2110 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 20 Feb 2020 08:11:04 -0800 +Subject: [PATCH] Use new bfd APIs from 2.34+ + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libutil++/bfd_support.cpp | 10 +++++----- + opjitconv/create_bfd.c | 6 +++--- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/libutil++/bfd_support.cpp b/libutil++/bfd_support.cpp +index fa904839..e53a1530 100644 +--- a/libutil++/bfd_support.cpp ++++ b/libutil++/bfd_support.cpp +@@ -137,7 +137,7 @@ static bool get_build_id(bfd * ibfd, unsigned char * build_id) + } + } + +- bfd_size_type buildid_sect_size = bfd_section_size(ibfd, sect); ++ bfd_size_type buildid_sect_size = bfd_section_size(sect); + char * contents = (char *) xmalloc(buildid_sect_size); + errno = 0; + if (!bfd_get_section_contents(ibfd, sect, +@@ -188,7 +188,7 @@ bool get_debug_link_info(bfd * ibfd, string & filename, unsigned long & crc32) + if (sect == NULL) + return false; + +- bfd_size_type debuglink_size = bfd_section_size(ibfd, sect); ++ bfd_size_type debuglink_size = bfd_section_size(sect); + char * contents = (char *) xmalloc(debuglink_size); + cverb << vbfd + << ".gnu_debuglink section has size " << debuglink_size << endl; +@@ -346,7 +346,7 @@ void fixup_linenr(bfd * abfd, asection * section, asymbol ** syms, + // first restrict the search on a sensible range of vma, 16 is + // an intuitive value based on epilog code look + size_t max_search = 16; +- size_t section_size = bfd_section_size(abfd, section); ++ size_t section_size = bfd_section_size(section); + if (pc + max_search > section_size) + max_search = section_size - pc; + +@@ -819,10 +819,10 @@ find_nearest_line(bfd_info const & b, op_bfd_symbol const & sym, + else + pc = (sym.value() + offset) - sym.filepos(); + +- if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) ++ if ((bfd_section_flags(section) & SEC_ALLOC) == 0) + goto fail; + +- if (pc >= bfd_section_size(abfd, section)) ++ if (pc >= bfd_section_size(section)) + goto fail; + + ret = bfd_find_nearest_line(abfd, section, syms, pc, &cfilename, +diff --git a/opjitconv/create_bfd.c b/opjitconv/create_bfd.c +index 48db143b..5c0e9152 100644 +--- a/opjitconv/create_bfd.c ++++ b/opjitconv/create_bfd.c +@@ -86,12 +86,12 @@ asection * create_section(bfd * abfd, char const * section_name, + bfd_perror("bfd_make_section"); + goto error; + } +- bfd_set_section_vma(abfd, section, vma); +- if (bfd_set_section_size(abfd, section, size) == FALSE) { ++ bfd_set_section_vma(section, vma); ++ if (bfd_set_section_size(section, size) == FALSE) { + bfd_perror("bfd_set_section_size"); + goto error; + } +- if (bfd_set_section_flags(abfd, section, flags) == FALSE) { ++ if (bfd_set_section_flags(section, flags) == FALSE) { + bfd_perror("bfd_set_section_flags"); + goto error; + } +-- +2.25.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch new file mode 100644 index 00000000..5fd23f80 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/oprofile/oprofile/0001-replace-sym_iterator-0-with-sym_iterator.patch @@ -0,0 +1,131 @@ +From b7c1a2e2b0f4657fe291324ca409224f3321c9ff Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 12 Feb 2019 11:58:34 -0800 +Subject: [PATCH] replace (sym_iterator)0 with sym_iterator() + +clang/libc++ find this error + +libpp/xml_utils.cpp:409:43: error: calling a private constructor of class 'std::__1::__wrap_iter<const sym +bol_entry *const *>' +| { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;} +| ^ +| + +default constructed iterator isn't supposed to be used for anything + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libpp/xml_utils.cpp | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/libpp/xml_utils.cpp b/libpp/xml_utils.cpp +index 3de41e5..f45d3ae 100644 +--- a/libpp/xml_utils.cpp ++++ b/libpp/xml_utils.cpp +@@ -73,7 +73,7 @@ void dump_symbol(string const & prefix, sym_iterator it, bool want_nl = true) + + void dump_symbols(string const & prefix, sym_iterator b, sym_iterator e) + { +- if (b == (sym_iterator)0) ++ if (b == sym_iterator()) + return; + + for (sym_iterator it = b; it != e; ++it) +@@ -167,7 +167,7 @@ string xml_utils::get_profile_header(string cpu_name, double const speed) + } + + str << init_attr(CPU_NAME, cpu_type) << endl; +- if (processor.size() > 0) ++ if (processor.size() > 0) + str << init_attr(PROCESSOR, string(processor)) << endl; + if (nr_cpus > 1) str << init_attr(SEPARATED_CPUS, nr_cpus) << endl; + str << init_attr(MHZ, speed) << endl; +@@ -320,11 +320,11 @@ void xml_utils::build_subclasses(ostream & out) + (*sc_ptr)[new_index].subclass_name = subclass_name; + out << open_element(CLASS, true); + out << init_attr(NAME, subclass_name); +- if (nr_cpus > 1) ++ if (nr_cpus > 1) + out << init_attr(CPU_NUM, pclass.ptemplate.cpu); +- if (nr_events > 1) ++ if (nr_events > 1) + out << init_attr(EVENT_NUM, event); +- if (has_nonzero_masks) ++ if (has_nonzero_masks) + out << init_attr(EVENT_MASK, pclass.ptemplate.unitmask); + out << close_element(); + } +@@ -406,7 +406,7 @@ xml_utils::output_summary_data(ostream & out, count_array_t const & summary, siz + class module_info { + public: + module_info() +- { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;} ++ { lo = hi = 0; name = ""; begin = end = sym_iterator();} + void dump(); + void build_module(string const & n, sym_iterator it, + size_t l, size_t h); +@@ -540,21 +540,21 @@ void module_info::add_to_summary(count_array_t const & counts) + + void module_info::set_begin(sym_iterator b) + { +- if (begin == (sym_iterator)0) ++ if (begin == sym_iterator()) + begin = b; + } + + + void module_info::set_end(sym_iterator e) + { +- if (end == (sym_iterator)0) ++ if (end == sym_iterator()) + end = e; + } + + + bool module_info::is_closed(string const & n) + { +- return (name == n) && end != (sym_iterator)0; ++ return (name == n) && end != sym_iterator(); + } + + +@@ -585,7 +585,7 @@ void module_info::output_summary(ostream & out) + + void module_info::output_symbols(ostream & out, bool is_module) + { +- if (begin == (sym_iterator)0) ++ if (begin == sym_iterator()) + return; + + for (sym_iterator it = begin; it != end; ++it) +@@ -606,7 +606,7 @@ void binary_info::close_binary(sym_iterator it) + void binary_info::dump() + { + cverb << vxml << "app_name=" << name << endl; +- if (begin != (sym_iterator)0) ++ if (begin != sym_iterator()) + dump_symbols(" ", begin, end); + + for (size_t i = 0; i < nr_modules; ++i) +@@ -648,7 +648,7 @@ add_module_symbol(string const & module, string const & app, + // mark end of enclosing binary symbols if there have been any + // NOTE: it is possible for the binary's symbols to follow its + // module symbols +- if (begin != (sym_iterator)0 && end == (sym_iterator)0) ++ if (begin != sym_iterator() && end == sym_iterator()) + set_end(it); + + // build the new module +@@ -718,7 +718,7 @@ summarize_processes(extra_images const & extra_found_images) + { + // add modules to the appropriate threads in the process hierarchy + for (sym_iterator it = symbols_begin ; it != symbols_end; ++it) { +- string binary = get_image_name((*it)->app_name, ++ string binary = get_image_name((*it)->app_name, + image_name_storage::int_filename, extra_found_images); + string module = get_image_name((*it)->image_name, + image_name_storage::int_filename, extra_found_images); +-- +2.20.1 + 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 index 1dc535ed..8242a835 100644 --- 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 @@ -1,7 +1,10 @@ require oprofile.inc -DEPENDS += "virtual/kernel" +COMPATIBLE_HOST_riscv64 = "null" +COMPATIBLE_HOST_riscv32 = "null" + DEPENDS_append_powerpc64 = " libpfm4" +DEPENDS_append_powerpc64le = " libpfm4" SRC_URI[md5sum] = "bd998df5521ebedae31e71cd3fb6200b" SRC_URI[sha256sum] = "95ded8bde1ec39922f0af015981a67aec63e025a501e4dc04cd65d38f73647e6" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-Makefile-fix-multilib-build-failure.patch b/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-Makefile-fix-multilib-build-failure.patch new file mode 100644 index 00000000..56981d96 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-Makefile-fix-multilib-build-failure.patch @@ -0,0 +1,89 @@ +From 50cea8fd3c07ab27da6edce865a49339f16f3b57 Mon Sep 17 00:00:00 2001 +From: Naveen Saini <naveen.kumar.saini@intel.com> +Date: Tue, 18 Jun 2019 17:10:15 +0800 +Subject: [PATCH] Makefile: fix multilib build failure + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> +--- + Makefile | 50 +++++++++++++++++++++++++++----------------------- + 1 file changed, 27 insertions(+), 23 deletions(-) + +diff --git a/Makefile b/Makefile +index 8455415..4aa0786 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,30 +1,34 @@ + # SPDX-License-Identifier: GPL-2.0 + PREFIX ?= /usr + DESTDIR ?= ++BASELIB ?= + + all: + @echo "Nothing to build" + ++clean: ++ @echo "Nothing to clean" ++ + install : uninstall +- install -d $(DESTDIR)$(PREFIX)/lib/pm-graph +- install sleepgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph +- install bootgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph +- install -d $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/cgskip.txt $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/freeze-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/freeze.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/freeze-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/standby-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/standby.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/standby-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/suspend-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/suspend.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/suspend-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config +- install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config ++ install -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph ++ install sleepgraph.py $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph ++ install bootgraph.py $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph ++ install -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/cgskip.txt $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/freeze-callgraph.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/freeze.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/freeze-dev.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/standby-callgraph.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/standby.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/standby-dev.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/suspend-callgraph.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/suspend.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/suspend-dev.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ++ install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config + + install -d $(DESTDIR)$(PREFIX)/bin +- ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph +- ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph ++ ln -s ../$(BASELIB)/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph ++ ln -s ../$(BASELIB)/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph + + install -d $(DESTDIR)$(PREFIX)/share/man/man8 + install bootgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8 +@@ -37,11 +41,11 @@ uninstall : + rm -f $(DESTDIR)$(PREFIX)/bin/bootgraph + rm -f $(DESTDIR)$(PREFIX)/bin/sleepgraph + +- rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/config/* +- if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph/config ] ; then \ +- rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph/config; \ ++ rm -f $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config/* ++ if [ -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config ] ; then \ ++ rmdir $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/config; \ + fi; +- rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/* +- if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph ] ; then \ +- rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph; \ ++ rm -f $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph/* ++ if [ -d $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph ] ; then \ ++ rmdir $(DESTDIR)$(PREFIX)/$(BASELIB)/pm-graph; \ + fi; +-- +2.17.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-use-python3.patch b/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-use-python3.patch new file mode 100644 index 00000000..25c87093 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph/0001-sleepgraph.py-use-python3.patch @@ -0,0 +1,39 @@ +From 22ce65d997f99606a3bb9d2a660ead42eecc234a Mon Sep 17 00:00:00 2001 +From: Naveen Saini <naveen.kumar.saini@intel.com> +Date: Wed, 11 Sep 2019 11:31:07 +0800 +Subject: [PATCH] sleepgraph.py: use python3 + +Already compatible with Python 3. +Same goes for bootgraph.py + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> +--- + bootgraph.py | 2 +- + sleepgraph.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/bootgraph.py b/bootgraph.py +index d3b99a1..efb5714 100755 +--- a/bootgraph.py ++++ b/bootgraph.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + # SPDX-License-Identifier: GPL-2.0-only + # + # Tool for analyzing boot timing +diff --git a/sleepgraph.py b/sleepgraph.py +index 1794c79..cfed8e0 100755 +--- a/sleepgraph.py ++++ b/sleepgraph.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + # SPDX-License-Identifier: GPL-2.0-only + # + # Tool for analyzing suspend/resume timing +-- +2.17.1 + diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb b/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb new file mode 100644 index 00000000..a1378866 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/pm-graph/pm-graph_5.5.bb @@ -0,0 +1,33 @@ +SUMMARY = "Timing analysis tools for suspend/resume/boot" +DESCRIPTION = "This tool suite is designed to assist kernel and OS developers \ +in optimizing their linux stack's suspend/resume & boot time." +HOMEPAGE = "https://01.org/pm-graph" +LICENSE = "GPL-2" +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" + +SRCREV = "cf59527dc24fdd2f314ae4dcaeb3d68a117988f6" +SRC_URI = "git://github.com/intel/pm-graph.git \ + file://0001-Makefile-fix-multilib-build-failure.patch \ + file://0001-sleepgraph.py-use-python3.patch \ +" +S = "${WORKDIR}/git" + +# Apart from the listed RDEPENDS, analyze-suspend depends on some features +# provided by the kernel. These options are: +# - CONFIG_PM_DEBUG=y +# - CONFIG_PM_SLEEP_DEBUG=y +# - CONFIG_FTRACE=y +# - CONFIG_FUNCTION_TRACER=y +# - CONFIG_FUNCTION_GRAPH_TRACER=y + +COMPATIBLE_HOST='(i.86|x86_64).*' +EXTRA_OEMAKE = "PREFIX=${prefix} DESTDIR=${D} BASELIB=${baselib}" + +do_install() { + oe_runmake install + install -Dm 0755 ${S}/analyze_suspend.py ${D}${bindir}/analyze_suspend.py +} + +RDEPENDS_${PN} += "python3-core python3-threading python3-datetime python3-compression" +RPROVIDES_${PN} = "analyze-suspend" +BBCLASSEXTEND = "native nativesdk" diff --git a/external/meta-openembedded/meta-oe/recipes-kernel/spidev-test/spidev-test.bb b/external/meta-openembedded/meta-oe/recipes-kernel/spidev-test/spidev-test.bb new file mode 100644 index 00000000..66263029 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-kernel/spidev-test/spidev-test.bb @@ -0,0 +1,29 @@ +SUMMARY = "Test SPI devices" +DESCRIPTION = "SPI testing utility using the spidev driver" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" +PROVIDES = "virtual/spidev-test" + +inherit bash-completion kernelsrc kernel-arch + +do_populate_lic[depends] += "virtual/kernel:do_patch" + +EXTRA_OEMAKE = "-C ${S}/tools/spi 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/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 index dc3e78fe..48c72140 100644 --- 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 @@ -20,7 +20,8 @@ SRC_URI += "\ file://COPYING \ " -DEPENDS = "virtual/kernel" +PACKAGE_ARCH = "${MACHINE_ARCH}" +DEPENDS = "libcap" # This looks in S, so we better make sure there's # something in the directory. @@ -29,23 +30,40 @@ do_populate_lic[depends] = "${PN}:do_configure" EXTRA_OEMAKE = '\ - CC="${CC}" \ - 'CFLAGS=-Wall -I${STAGING_KERNEL_DIR}/arch/x86/include/uapi ${LDFLAGS}' \ + CC="${CC}" 'CFLAGS=-Wall ${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[depends] += "virtual/kernel:do_shared_workdir" 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} + if [ -f "${STAGING_KERNEL_DIR}/include/vdso/bits.h" ]; then + cp -r ${STAGING_KERNEL_DIR}/include/vdso/bits.h ${S} + cp -r ${STAGING_KERNEL_DIR}/include/vdso/const.h ${S} + else + cp -r ${STAGING_KERNEL_DIR}/include/linux/bits.h ${S} + cp -r ${STAGING_KERNEL_DIR}/include/linux/const.h ${S} + fi cp -r ${STAGING_KERNEL_DIR}/tools/power/x86/turbostat/* ${S} cp -r ${WORKDIR}/COPYING ${S} } + do_compile() { + sed -i 's#<linux/bits.h>#"bits.h"#' msr-index.h + 'TMPCHECK='grep "<vdso/const.h>" bits.h'' || true + if [ -n $TMPCHECK ]; then + sed -i 's#<vdso/const.h>#"const.h"#' bits.h + sed -i 's#<uapi/linux/const.h>#<linux/const.h>#' const.h + else + sed -i 's#<linux/const.h>#"const.h"#' bits.h + sed -i -e 's#<uapi/linux/const.h>#<linux/const.h>#' -e 's#_LINUX_CONST_H#_LINUX_CONST_H_KERNEL#' const.h + fi 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 |