diff options
Diffstat (limited to 'poky/meta')
32 files changed, 247 insertions, 763 deletions
diff --git a/poky/meta/classes/go.bbclass b/poky/meta/classes/go.bbclass index b6d9372c56..e05a5c641c 100644 --- a/poky/meta/classes/go.bbclass +++ b/poky/meta/classes/go.bbclass @@ -7,6 +7,7 @@ GOROOT_class-nativesdk = "${STAGING_DIR_TARGET}${libdir}/go" GOROOT = "${STAGING_LIBDIR}/go" export GOROOT export GOROOT_FINAL = "${libdir}/go" +export GOCACHE = "${B}/.cache" export GOARCH = "${TARGET_GOARCH}" export GOOS = "${TARGET_GOOS}" diff --git a/poky/meta/classes/update-rc.d.bbclass b/poky/meta/classes/update-rc.d.bbclass index 265c4be9d1..1366fee653 100644 --- a/poky/meta/classes/update-rc.d.bbclass +++ b/poky/meta/classes/update-rc.d.bbclass @@ -20,28 +20,14 @@ def use_updatercd(d): return '[ -n "$D" -o ! -d /run/systemd/system ]' return 'true' -updatercd_preinst() { -if ${@use_updatercd(d)} && [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then - ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || : -fi -if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then - if [ -n "$D" ]; then - OPT="-f -r $D" - else - OPT="-f" - fi - update-rc.d $OPT ${INITSCRIPT_NAME} remove -fi -} - PACKAGE_WRITE_DEPS += "update-rc.d-native" updatercd_postinst() { if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then if [ -n "$D" ]; then - OPT="-f -r $D" + OPT="-r $D" else - OPT="-f -s" + OPT="-s" fi update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS} fi @@ -79,7 +65,7 @@ python __anonymous() { PACKAGESPLITFUNCS_prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}" PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd " -populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst" +populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_postinst" populate_packages_updatercd[vardepsexclude] += "OVERRIDES" python populate_packages_updatercd () { @@ -95,7 +81,7 @@ python populate_packages_updatercd () { d.appendVar('RDEPENDS_' + pkg, ' %sinitd-functions' % (mlprefix)) def update_rcd_package(pkg): - bb.debug(1, 'adding update-rc.d calls to preinst/postinst/prerm/postrm for %s' % pkg) + bb.debug(1, 'adding update-rc.d calls to postinst/prerm/postrm for %s' % pkg) localdata = bb.data.createCopy(d) overrides = localdata.getVar("OVERRIDES") @@ -103,12 +89,6 @@ python populate_packages_updatercd () { update_rcd_auto_depend(pkg) - preinst = d.getVar('pkg_preinst_%s' % pkg) - if not preinst: - preinst = '#!/bin/sh\n' - preinst += localdata.getVar('updatercd_preinst') - d.setVar('pkg_preinst_%s' % pkg, preinst) - postinst = d.getVar('pkg_postinst_%s' % pkg) if not postinst: postinst = '#!/bin/sh\n' diff --git a/poky/meta/conf/distro/include/ptest-packagelists.inc b/poky/meta/conf/distro/include/ptest-packagelists.inc index 17deaa762a..0dc085091f 100644 --- a/poky/meta/conf/distro/include/ptest-packagelists.inc +++ b/poky/meta/conf/distro/include/ptest-packagelists.inc @@ -24,6 +24,7 @@ PTESTS_FAST = "\ kbd-ptest \ libconvert-asn1-perl-ptest \ liberror-perl-ptest \ + libmodule-build-perl-ptest \ libpcre-ptest \ libtimedate-perl-ptest \ libtest-needs-perl-ptest \ diff --git a/poky/meta/lib/oeqa/core/case.py b/poky/meta/lib/oeqa/core/case.py index 54977c809f..aca144e9dc 100644 --- a/poky/meta/lib/oeqa/core/case.py +++ b/poky/meta/lib/oeqa/core/case.py @@ -32,6 +32,8 @@ class OETestCase(unittest.TestCase): @classmethod def _oeSetUpClass(clss): _validate_td_vars(clss.td, clss.td_vars, "class") + if hasattr(clss, 'setUpHooker') and callable(getattr(clss, 'setUpHooker')): + clss.setUpHooker() clss.setUpClassMethod() @classmethod diff --git a/poky/meta/lib/oeqa/core/context.py b/poky/meta/lib/oeqa/core/context.py index 58244895af..68819cc338 100644 --- a/poky/meta/lib/oeqa/core/context.py +++ b/poky/meta/lib/oeqa/core/context.py @@ -50,10 +50,18 @@ class OETestContext(object): def func(): raise unittest.SkipTest(skipmsg) return func + class_ids = {} for test in self.suites: + if test.__class__ not in class_ids: + class_ids[test.__class__] = '.'.join(test.id().split('.')[:-1]) for skip in skips: - if test.id().startswith(skip): + if (test.id()+'.').startswith(skip+'.'): setattr(test, 'setUp', skipfuncgen('Skip by the command line argument "%s"' % skip)) + for tclass in class_ids: + cid = class_ids[tclass] + for skip in skips: + if (cid + '.').startswith(skip + '.'): + setattr(tclass, 'setUpHooker', skipfuncgen('Skip by the command line argument "%s"' % skip)) def loadTests(self, module_paths, modules=[], tests=[], modules_manifest="", modules_required=[], filters={}): diff --git a/poky/meta/recipes-bsp/opensbi/opensbi-payloads.inc b/poky/meta/recipes-bsp/opensbi/opensbi-payloads.inc index 7df168325a..7828599ce4 100644 --- a/poky/meta/recipes-bsp/opensbi/opensbi-payloads.inc +++ b/poky/meta/recipes-bsp/opensbi/opensbi-payloads.inc @@ -31,7 +31,7 @@ def riscv_get_do_compile_depends(d): if 'linux' in sbi_payload or 'Image' in sbi_payload: return "virtual/kernel:do_deploy" - if 'u-boot' in sbi_payload: + if 'u-boot.bin' in sbi_payload: return "virtual/bootloader:do_deploy" return "" diff --git a/poky/meta/recipes-core/dropbear/dropbear.inc b/poky/meta/recipes-core/dropbear/dropbear.inc index b74d186cd4..dcbda741c3 100644 --- a/poky/meta/recipes-core/dropbear/dropbear.inc +++ b/poky/meta/recipes-core/dropbear/dropbear.inc @@ -20,7 +20,8 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ file://dropbear@.service \ file://dropbear.socket \ file://dropbear.default \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} " + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} " PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ file://0006-dropbear-configuration-file.patch \ @@ -46,8 +47,9 @@ SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" BINCOMMANDS = "dbclient ssh scp" EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' -PACKAGECONFIG ?= "" +PACKAGECONFIG ?= "disable-weak-ciphers" PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" +PACKAGECONFIG[disable-weak-ciphers] = "" EXTRA_OECONF += "\ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" diff --git a/poky/meta/recipes-core/dropbear/dropbear/dropbear-disable-weak-ciphers.patch b/poky/meta/recipes-core/dropbear/dropbear/dropbear-disable-weak-ciphers.patch new file mode 100644 index 0000000000..e48a34bac0 --- /dev/null +++ b/poky/meta/recipes-core/dropbear/dropbear/dropbear-disable-weak-ciphers.patch @@ -0,0 +1,44 @@ +This feature disables all CBC, SHA1, and diffie-hellman group1 ciphers +in the dropbear ssh server and client since they're considered weak ciphers +and we want to support the stong algorithms. + +Upstream-Status: Inappropriate [configuration] +Signed-off-by: Joseph Reynolds <joseph.reynolds1@ibm.com> + +Index: dropbear-2019.78/default_options.h +=================================================================== +--- dropbear-2019.78.orig/default_options.h ++++ dropbear-2019.78/default_options.h +@@ -91,7 +91,7 @@ IMPORTANT: Some options will require "ma + + /* Enable CBC mode for ciphers. This has security issues though + * is the most compatible with older SSH implementations */ +-#define DROPBEAR_ENABLE_CBC_MODE 1 ++#define DROPBEAR_ENABLE_CBC_MODE 0 + + /* Enable "Counter Mode" for ciphers. This is more secure than + * CBC mode against certain attacks. It is recommended for security +@@ -101,7 +101,7 @@ IMPORTANT: Some options will require "ma + /* Message integrity. sha2-256 is recommended as a default, + sha1 for compatibility */ + #define DROPBEAR_SHA1_HMAC 1 +-#define DROPBEAR_SHA1_96_HMAC 1 ++#define DROPBEAR_SHA1_96_HMAC 0 + #define DROPBEAR_SHA2_256_HMAC 1 + + /* Hostkey/public key algorithms - at least one required, these are used +@@ -149,12 +149,12 @@ IMPORTANT: Some options will require "ma + * Small systems should generally include either curve25519 or ecdh for performance. + * curve25519 is less widely supported but is faster + */ +-#define DROPBEAR_DH_GROUP14_SHA1 1 ++#define DROPBEAR_DH_GROUP14_SHA1 0 + #define DROPBEAR_DH_GROUP14_SHA256 1 + #define DROPBEAR_DH_GROUP16 0 + #define DROPBEAR_CURVE25519 1 + #define DROPBEAR_ECDH 1 +-#define DROPBEAR_DH_GROUP1 1 ++#define DROPBEAR_DH_GROUP1 0 + + /* When group1 is enabled it will only be allowed by Dropbear client + not as a server, due to concerns over its strength. Set to 0 to allow diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-12450.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-12450.patch new file mode 100644 index 0000000000..59e49195cc --- /dev/null +++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-12450.patch @@ -0,0 +1,62 @@ +glib-2.0: fix CVE-2019-12450 + +Not in release 2.61.1. + +CVE: CVE-2019-12450 + +Upstream-Status: Backport [github.com/GNOME/glib.git] +Signed-off-by: Joe Slater <joe.slater@windrivere.com> +--- +From d8f8f4d637ce43f8699ba94c9b7648beda0ca174 Mon Sep 17 00:00:00 2001 +From: Ondrej Holy <oholy@redhat.com> +Date: Thu, 23 May 2019 10:41:53 +0200 +Subject: [PATCH] gfile: Limit access to files when copying + +file_copy_fallback creates new files with default permissions and +set the correct permissions after the operation is finished. This +might cause that the files can be accessible by more users during +the operation than expected. Use G_FILE_CREATE_PRIVATE for the new +files to limit access to those files. +--- + gio/gfile.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/gio/gfile.c b/gio/gfile.c +index 24b136d80..74b58047c 100644 +--- a/gio/gfile.c ++++ b/gio/gfile.c +@@ -3284,12 +3284,12 @@ file_copy_fallback (GFile *source, + out = (GOutputStream*)_g_local_file_output_stream_replace (_g_local_file_get_filename (G_LOCAL_FILE (destination)), + FALSE, NULL, + flags & G_FILE_COPY_BACKUP, +- G_FILE_CREATE_REPLACE_DESTINATION, +- info, ++ G_FILE_CREATE_REPLACE_DESTINATION | ++ G_FILE_CREATE_PRIVATE, info, + cancellable, error); + else + out = (GOutputStream*)_g_local_file_output_stream_create (_g_local_file_get_filename (G_LOCAL_FILE (destination)), +- FALSE, 0, info, ++ FALSE, G_FILE_CREATE_PRIVATE, info, + cancellable, error); + } + else if (flags & G_FILE_COPY_OVERWRITE) +@@ -3297,12 +3297,13 @@ file_copy_fallback (GFile *source, + out = (GOutputStream *)g_file_replace (destination, + NULL, + flags & G_FILE_COPY_BACKUP, +- G_FILE_CREATE_REPLACE_DESTINATION, ++ G_FILE_CREATE_REPLACE_DESTINATION | ++ G_FILE_CREATE_PRIVATE, + cancellable, error); + } + else + { +- out = (GOutputStream *)g_file_create (destination, 0, cancellable, error); ++ out = (GOutputStream *)g_file_create (destination, G_FILE_CREATE_PRIVATE, cancellable, error); + } + + if (!out) +-- +2.17.1 + diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0_2.60.3.bb b/poky/meta/recipes-core/glib-2.0/glib-2.0_2.60.3.bb index bb77294e1e..5942241de5 100644 --- a/poky/meta/recipes-core/glib-2.0/glib-2.0_2.60.3.bb +++ b/poky/meta/recipes-core/glib-2.0/glib-2.0_2.60.3.bb @@ -16,6 +16,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ file://0001-Do-not-write-bindir-into-pkg-config-files.patch \ file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \ file://0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch \ + file://CVE-2019-12450.patch \ " SRC_URI_append_class-native = " file://relocate-modules.patch" diff --git a/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb b/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb index baa21aeae1..75632d9434 100644 --- a/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb +++ b/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb @@ -4,10 +4,10 @@ DESCRIPTION = "update-rc.d is a utility that allows the management of symlinks t SECTION = "base" LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=148a48321b10eb37c1fa3ee02b940a75" +LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=d40a07c27f535425934bb5001f2037d9" SRC_URI = "git://git.yoctoproject.org/update-rc.d" -SRCREV = "22e0692898c3e7ceedc8eb5ff4ec8e0b9c340b2d" +SRCREV = "4b150b25b38de688d25cde2b2d22c268ed65a748" UPSTREAM_CHECK_COMMITS = "1" diff --git a/poky/meta/recipes-devtools/gcc/gcc-runtime.inc b/poky/meta/recipes-devtools/gcc/gcc-runtime.inc index ba767e1a38..a5c2600d7f 100644 --- a/poky/meta/recipes-devtools/gcc/gcc-runtime.inc +++ b/poky/meta/recipes-devtools/gcc/gcc-runtime.inc @@ -114,7 +114,7 @@ do_install_append_class-target () { ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux fi elif [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then - mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-linux + mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS} ln -s ../${TARGET_SYS}/bits ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/bits ln -s ../${TARGET_SYS}/ext ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/ext fi diff --git a/poky/meta/recipes-devtools/go/go-cross.inc b/poky/meta/recipes-devtools/go/go-cross.inc index 29ce7f6e84..3d344a74d3 100644 --- a/poky/meta/recipes-devtools/go/go-cross.inc +++ b/poky/meta/recipes-devtools/go/go-cross.inc @@ -14,6 +14,7 @@ export GO386 = "${TARGET_GO386}" export GOMIPS = "${TARGET_GOMIPS}" export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" export GOROOT_FINAL = "${libdir}/go" +export GOCACHE = "${B}/.cache" CC = "${@d.getVar('BUILD_CC').strip()}" do_configure[noexec] = "1" diff --git a/poky/meta/recipes-devtools/go/go-runtime.inc b/poky/meta/recipes-devtools/go/go-runtime.inc index c219aa3789..e282195619 100644 --- a/poky/meta/recipes-devtools/go/go-runtime.inc +++ b/poky/meta/recipes-devtools/go/go-runtime.inc @@ -15,6 +15,7 @@ export CGO_CFLAGS = "${CFLAGS}" export CGO_CPPFLAGS = "${CPPFLAGS}" export CGO_CXXFLAGS = "${CXXFLAGS}" export CGO_LDFLAGS = "${LDFLAGS}" +export GOCACHE = "${B}/.cache" GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}" GO_SHLIB_LDFLAGS ?= '-ldflags="--linkmode=external -extldflags '${GO_EXTLDFLAGS}'"' diff --git a/poky/meta/recipes-devtools/go/go-target.inc b/poky/meta/recipes-devtools/go/go-target.inc index 379f87b498..91efd3e977 100644 --- a/poky/meta/recipes-devtools/go/go-target.inc +++ b/poky/meta/recipes-devtools/go/go-target.inc @@ -10,6 +10,7 @@ export GO386 = "${TARGET_GO386}" export GOMIPS = "${TARGET_GOMIPS}" export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" export GOROOT_FINAL = "${libdir}/go" +export GOCACHE = "${B}/.cache" GO_LDFLAGS = "" GO_LDFLAGS_class-nativesdk = "-linkmode external" export GO_LDFLAGS diff --git a/poky/meta/recipes-devtools/perl/files/0001-enc2xs-Add-environment-variable-to-suppress-comments.patch b/poky/meta/recipes-devtools/perl/files/0001-enc2xs-Add-environment-variable-to-suppress-comments.patch new file mode 100644 index 0000000000..07f153162b --- /dev/null +++ b/poky/meta/recipes-devtools/perl/files/0001-enc2xs-Add-environment-variable-to-suppress-comments.patch @@ -0,0 +1,30 @@ +From 31a2c5555f9ef32f35d7d5ce1fd09a010ba5f5c6 Mon Sep 17 00:00:00 2001 +From: Joshua Watt <JPEWhacker@gmail.com> +Date: Mon, 17 Jun 2019 10:47:15 -0500 +Subject: [PATCH 1/2] enc2xs: Add environment variable to suppress comments + +Comment generation in enc2xs can now be suppressed by setting the +ENC2XS_NO_COMMENTS environment variable. This allows enc2xs to produce +reproducible output by omitting the name of the generating program. + +Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> +Upstream-status: Accepted [https://github.com/dankogai/p5-encode/pull/145] +--- + cpan/Encode/bin/enc2xs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs +index 619b64b757..bfce9ee735 100644 +--- a/cpan/Encode/bin/enc2xs ++++ b/cpan/Encode/bin/enc2xs +@@ -144,6 +144,7 @@ getopts('CM:SQqOo:f:n:v',\%opt); + $opt{M} and make_makefile_pl($opt{M}, @ARGV); + $opt{C} and make_configlocal_pm($opt{C}, @ARGV); + $opt{v} ||= $ENV{ENC2XS_VERBOSE}; ++$opt{q} ||= $ENV{ENC2XS_NO_COMMENTS}; + + sub verbose { + print STDERR @_ if $opt{v}; +-- +2.21.0 + diff --git a/poky/meta/recipes-devtools/perl/files/0002-Constant-Fix-up-shebang.patch b/poky/meta/recipes-devtools/perl/files/0002-Constant-Fix-up-shebang.patch new file mode 100644 index 0000000000..e70ff67f72 --- /dev/null +++ b/poky/meta/recipes-devtools/perl/files/0002-Constant-Fix-up-shebang.patch @@ -0,0 +1,32 @@ +From 260ebd15e16cd86b9b58e5c5f3a496b3853ca46d Mon Sep 17 00:00:00 2001 +From: Joshua Watt <JPEWhacker@gmail.com> +Date: Mon, 17 Jun 2019 10:47:23 -0500 +Subject: [PATCH 2/2] Constant: Fix up shebang + +The instructions indicate that the script should be explicitly passed to +"perl -x", so automatically setting the #! to be ^X is unnecessary and +makes the file non-reproducible when building because ^X could be the +absolute path to miniperl. + +Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> +Upstream-status: Submitted [https://rt.cpan.org/Public/Bug/Display.html?id=129866] +--- + cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm +index 14eb809714..d4d074e121 100644 +--- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm ++++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm +@@ -219,7 +219,7 @@ sub dogfood { + Regenerate these constant functions by feeding this entire source file to + perl -x + +-#!$^X -w ++#!/usr/bin/env perl -x -w + use ExtUtils::Constant qw (constant_types C_constant XS_constant); + + EOT +-- +2.21.0 + diff --git a/poky/meta/recipes-devtools/perl/perl-ptest.inc b/poky/meta/recipes-devtools/perl/perl-ptest.inc index 9dd9b7da57..7152057762 100644 --- a/poky/meta/recipes-devtools/perl/perl-ptest.inc +++ b/poky/meta/recipes-devtools/perl/perl-ptest.inc @@ -2,6 +2,9 @@ inherit ptest SRC_URI += "file://run-ptest \ " + +DEBUG_PREFIX_MAP_REGEX = "${@'\\|'.join(d.getVar('DEBUG_PREFIX_MAP').split())}" + do_install_ptest () { mkdir -p ${D}${PTEST_PATH} sed -e "s:\/usr\/local:${bindir}:g" -i cpan/version/t/* @@ -13,7 +16,7 @@ do_install_ptest () { --exclude='win32/config.*' --exclude=plan9 --exclude=README.plan9 --exclude=perlplan9.pod --exclude=Configure \ --exclude=veryclean.sh --exclude=realclean.sh --exclude=getioctlsizes \ --exclude=dl_aix.xs --exclude=sdbm.3 --exclude='cflags.SH' --exclude=makefile.old \ - --exclude=miniperl --exclude=generate_uudmap --exclude=patches * | ( cd ${D}${PTEST_PATH} && tar -x ) + --exclude=miniperl --exclude=generate_uudmap --exclude=patches --exclude='config.log' * | ( cd ${D}${PTEST_PATH} && tar -x ) ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl @@ -21,12 +24,12 @@ do_install_ptest () { find "${D}${PTEST_PATH}" \ \( -name '*.PL' -o -name 'myconfig' -o -name 'cflags' -o -name '*.pl' -o -name '*.sh' -o -name '*.pm' \ -o -name 'h2xs' -o -name 'h2ph' \ - -o -name '*.h' -o -name 'config.sh-*' -o -name 'pod2man' -o -name 'pod2text' \) \ + -o -name '*.h' -o -name 'config.sh-*' -o -name 'pod2man' -o -name 'pod2text' -o -name 'Makefile.config' \) \ -type f -exec sed -i \ -e "s,${D},,g" \ -e "s,--sysroot=${STAGING_DIR_HOST},,g" \ -e "s,-isystem${STAGING_INCDIR} ,,g" \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's^${DEBUG_PREFIX_MAP_REGEX}^^g' \ -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \ -e "s,${STAGING_LIBDIR},${libdir},g" \ -e "s,${STAGING_BINDIR},${bindir},g" \ diff --git a/poky/meta/recipes-devtools/perl/perl_5.30.0.bb b/poky/meta/recipes-devtools/perl/perl_5.30.0.bb index b18a6b6913..e3664290e3 100644 --- a/poky/meta/recipes-devtools/perl/perl_5.30.0.bb +++ b/poky/meta/recipes-devtools/perl/perl_5.30.0.bb @@ -19,6 +19,8 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ file://perl-dynloader.patch \ file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \ file://fix-setgroup.patch \ + file://0001-enc2xs-Add-environment-variable-to-suppress-comments.patch \ + file://0002-Constant-Fix-up-shebang.patch \ " SRC_URI_append_class-native = " \ file://perl-configpm-switch.patch \ @@ -37,6 +39,9 @@ DEPENDS += "db gdbm zlib virtual/crypt" PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0" +# Don't generate comments in enc2xs output files. They are not reproducible +export ENC2XS_NO_COMMENTS = "1" + do_unpack_append() { bb.build.exec_func('do_copy_perlcross', d) } diff --git a/poky/meta/recipes-devtools/python/python3/reformat_sysconfig.py b/poky/meta/recipes-devtools/python/python3/reformat_sysconfig.py new file mode 100644 index 0000000000..c4164313e8 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/reformat_sysconfig.py @@ -0,0 +1,21 @@ +#! /usr/bin/env python3 +# +# SPDX-License-Identifier: MIT +# +# Copyright 2019 by Garmin Ltd. or its subsidiaries +# +# A script to reformat python sysconfig + +import sys +import pprint +l = {} +g = {} +with open(sys.argv[1], 'r') as f: + exec(f.read(), g, l) + +with open(sys.argv[1], 'w') as f: + for k in sorted(l.keys()): + f.write('%s = ' % k) + pprint.pprint(l[k], stream=f, width=sys.maxsize) + f.write('\n') + diff --git a/poky/meta/recipes-devtools/python/python3_3.7.3.bb b/poky/meta/recipes-devtools/python/python3_3.7.3.bb index 8e77dbe959..3409d94ba0 100644 --- a/poky/meta/recipes-devtools/python/python3_3.7.3.bb +++ b/poky/meta/recipes-devtools/python/python3_3.7.3.bb @@ -25,6 +25,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \ file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \ file://crosspythonpath.patch \ + file://reformat_sysconfig.py \ " SRC_URI_append_class-native = " \ @@ -165,6 +166,12 @@ py_package_preprocess () { ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \ ${PKGD}/${bindir}/python${PYTHON_BINABI}-config + # Reformat _sysconfigdata after modifying it so that it remains + # reproducible + for c in ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do + python3 ${WORKDIR}/reformat_sysconfig.py $c + done + # Recompile _sysconfigdata after modifying it cd ${PKGD} sysconfigfile=`find . -name _sysconfigdata_*.py` diff --git a/poky/meta/recipes-extended/bash/bash.inc b/poky/meta/recipes-extended/bash/bash.inc index c91cc8ada8..039b8687a2 100644 --- a/poky/meta/recipes-extended/bash/bash.inc +++ b/poky/meta/recipes-extended/bash/bash.inc @@ -39,6 +39,12 @@ RDEPENDS_${PN}-ptest_append_libc-glibc = " \ CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}" +do_compile_prepend() { + # Remove any leftover .build files. This ensures that bash always has the + # same version number and keeps builds reproducible + rm -f ${B}/.build +} + do_compile_ptest () { oe_runmake buildtest } diff --git a/poky/meta/recipes-extended/pigz/pigz_2.4.bb b/poky/meta/recipes-extended/pigz/pigz_2.4.bb index 6d62ce6cc5..8c65ec34f0 100644 --- a/poky/meta/recipes-extended/pigz/pigz_2.4.bb +++ b/poky/meta/recipes-extended/pigz/pigz_2.4.bb @@ -38,7 +38,7 @@ do_install_append_class-native() { ln -nsf gzip ${D}${bindir}/zcat } -ALTERNATIVE_PRIORITY = "80" +ALTERNATIVE_PRIORITY = "110" ALTERNATIVE_${PN} = "gunzip gzip zcat" ALTERNATIVE_${PN}_class-nativesdk = "" ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip" diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch deleted file mode 100644 index df18dc842b..0000000000 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7244eac44be929fabd6ed1333f96929ef8da564f Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Tue, 19 Mar 2019 17:56:49 +0000 -Subject: [PATCH] fix: tests: link libpause_consumer on liblttng-ctl - -This preload test library uses symbols from liblttng-ctl which are -resolved when preloaded by GLIBC but not by MUSL. - -Upstream-Status: Accepted [f667fbd7f8b9512f9943edb2597c226fcc424ee9] -Backported to 2.11 and 2.10. - -Signed-off-by: Michael Jeanson <mjeanson@efficios.com> ---- - tests/regression/tools/notification/Makefile.am | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/tests/regression/tools/notification/Makefile.am b/tests/regression/tools/notification/Makefile.am -index 41adc69..a352bb8 100644 ---- a/tests/regression/tools/notification/Makefile.am -+++ b/tests/regression/tools/notification/Makefile.am -@@ -20,7 +20,10 @@ FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ - -rpath $(abs_builddir) - - libpause_consumer_la_SOURCES = consumer_testpoints.c --libpause_consumer_la_LIBADD = $(top_builddir)/src/common/libcommon.la $(DL_LIBS) -+libpause_consumer_la_LIBADD = \ -+ $(top_builddir)/src/common/libcommon.la \ -+ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ -+ $(DL_LIBS) - libpause_consumer_la_LDFLAGS = $(FORCE_SHARED_LIB_OPTIONS) - noinst_LTLIBRARIES = libpause_consumer.la - --- -2.17.1 - diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0004-Skip-when-testapp-is-not-present.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0001-Skip-when-testapp-is-not-present.patch index 6c9f7e462c..6c9f7e462c 100644 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0004-Skip-when-testapp-is-not-present.patch +++ b/poky/meta/recipes-kernel/lttng/lttng-tools/0001-Skip-when-testapp-is-not-present.patch diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0008-Fix-check-for-lttng-modules-presence-before-testing.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-check-for-lttng-modules-presence-before-testing.patch index 784a07940a..784a07940a 100644 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0008-Fix-check-for-lttng-modules-presence-before-testing.patch +++ b/poky/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-check-for-lttng-modules-presence-before-testing.patch diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch deleted file mode 100644 index 5bb88d21e5..0000000000 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch +++ /dev/null @@ -1,52 +0,0 @@ -From e7db27668a9d7fd279d45bc43f3a2d5847374e7b Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Tue, 12 Mar 2019 12:04:58 -0400 -Subject: [PATCH lttng-tools 1/2] Fix: test: skip test_getcpu_override on - single thread system - -There is no value in performing this test on single thread system -since the only valid value for the cpu field is 0. - -This test currently fails on single thread system (i.e yocto runquemu) -on the test_getcpu_override_fail test case. - -Upstream-Status: Accepted [f87d0ca370c17b597762f5ee218f0e821ed2452d] -Backported to 2.11 and 2.10 - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - .../ust/getcpu-override/test_getcpu_override | 16 +++++++++++----- - 1 file changed, 11 insertions(+), 5 deletions(-) - -diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override -index 4ca385aeb..ee3e31953 100755 ---- a/tests/regression/ust/getcpu-override/test_getcpu_override -+++ b/tests/regression/ust/getcpu-override/test_getcpu_override -@@ -157,13 +157,19 @@ plan_tests $NUM_TESTS - - print_test_banner "$TEST_DESC" - --if [ -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then -- foundobj=1 --else -- foundobj=0 -+if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then -+ skip 0 "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0 -+fi -+ -+if [ "$num_cpus" -eq "1" ]; then -+ # Skip the test since we cannot perform it as designed since N mod 1 -+ # is always equals to zero. There is no point testing this on a system -+ # with a single thread. LTTng-UST limits the get_cpu function to return -+ # value inside the [0, NUM_CPU - 1] range for a valid event (present in -+ # trace). -+ skip 0 "Test system only have a single thread. Skipping all tests." $NUM_TESTS && exit 0 - fi - --skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0 - - TESTS=( - test_getcpu_override_fail --- -2.17.1 - diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch deleted file mode 100644 index 822b26a367..0000000000 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 83d165442d1c3658b6bafa28ddade8ffee7092ad Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Wed, 6 Mar 2019 16:46:49 -0500 -Subject: [PATCH lttng-tools 2/2] Fix: test: unit: the tree origin can be a - symlink itself - -Problem: - -The base tree is defined as "/tmp/.....XXXXXX". -On systems where "/tmp/" is itself a symlink utils_expand_path will -expand the tree origin itself. - -For example on a base core-image-minimal Yocto build /tmp is a symlink -to "/var/tmp", which is a symlink to "/var/volatile". - -utils_expand_path will return something like this for the symlink test: -"/var/volative/.....XXXXXX/...." which is the valid result. - -Solution: - -Simply use realpath on the tree_origin and use this path to perform the -test validation. - -This work was performed in the effort to support yocto fully and be able -to run the test suite to detect problem as early as possible. - - -Upstream-Status: Accepted [f66e964a2e0c75f5e1a55fbcc963b1c5e2b4519d] -Backported to 2.11 and 2.10 - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - tests/unit/test_utils_expand_path.c | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) - -diff --git a/tests/unit/test_utils_expand_path.c b/tests/unit/test_utils_expand_path.c -index d5cab002e..d047c207d 100644 ---- a/tests/unit/test_utils_expand_path.c -+++ b/tests/unit/test_utils_expand_path.c -@@ -281,8 +281,8 @@ error: - static void test_utils_expand_path(void) - { - char *result; -- char name[100], tmppath[PATH_MAX]; -- int i; -+ char name[100], tmppath[PATH_MAX], real_tree_origin[PATH_MAX]; -+ int i, treelen; - - /* Test valid cases */ - for (i = 0; i < num_valid_tests; i++) { -@@ -295,14 +295,24 @@ static void test_utils_expand_path(void) - free(result); - } - -+ /* -+ * Get the realpath for the tree_origin since it can itself be a -+ * symlink. -+ */ -+ result = realpath(tree_origin, real_tree_origin); -+ if (!result) { -+ fail("realpath failed."); -+ return; -+ } -+ - /* Test symlink tree cases */ -- int treelen = strlen(tree_origin) + 1; -+ treelen = strlen(real_tree_origin) + 1; - for (i = 0; i < num_symlink_tests; i++) { - sprintf(name, "symlink tree test case: [tmppath/]%s", - symlink_tests_inputs[i].input); - - snprintf(tmppath, PATH_MAX, "%s/%s", -- tree_origin, symlink_tests_inputs[i].input); -+ real_tree_origin, symlink_tests_inputs[i].input); - result = utils_expand_path(tmppath); - ok(result != NULL && strcmp(result + treelen, - symlink_tests_inputs[i].expected_result) == 0, name); --- -2.17.1 - diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch deleted file mode 100644 index 16df3e610a..0000000000 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 9bc81a446d0a3ea9a884739eee48d3f14db3283c Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Wed, 28 Mar 2018 15:21:26 -0400 -Subject: [PATCH lttng-tools] Tests: use modprobe to test for the presence of - lttng-modules -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Upstream-Status: Backport [28702730192ae1ded06105c54c5dc] - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> ---- - tests/regression/tools/regen-metadata/test_kernel | 8 ++------ - tests/regression/tools/regen-statedump/test_kernel | 7 +------ - tests/regression/tools/snapshots/test_kernel | 9 +++------ - tests/regression/tools/snapshots/test_kernel_streaming | 8 ++------ - tests/regression/tools/streaming/test_kernel | 8 ++------ - tests/utils/utils.sh | 10 ++++++++++ - 6 files changed, 20 insertions(+), 30 deletions(-) - -diff --git a/tests/regression/tools/regen-metadata/test_kernel b/tests/regression/tools/regen-metadata/test_kernel -index fd139aeef..1849b9cd0 100755 ---- a/tests/regression/tools/regen-metadata/test_kernel -+++ b/tests/regression/tools/regen-metadata/test_kernel -@@ -28,12 +28,6 @@ NUM_TESTS=18 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function lttng_create_session_uri - { - # Create session with default path -@@ -91,6 +85,8 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present -+ - start_lttng_relayd "-o $TRACE_PATH" - start_lttng_sessiond - modprobe lttng-test -diff --git a/tests/regression/tools/regen-statedump/test_kernel b/tests/regression/tools/regen-statedump/test_kernel -index 85afe76a1..50054eb07 100755 ---- a/tests/regression/tools/regen-statedump/test_kernel -+++ b/tests/regression/tools/regen-statedump/test_kernel -@@ -29,12 +29,6 @@ NUM_TESTS=11 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function test_kernel_local () - { - diag "Test kernel local with statedump regeneration" -@@ -64,6 +58,7 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present - start_lttng_sessiond - modprobe lttng-test - -diff --git a/tests/regression/tools/snapshots/test_kernel b/tests/regression/tools/snapshots/test_kernel -index 886c4557a..ff563100b 100755 ---- a/tests/regression/tools/snapshots/test_kernel -+++ b/tests/regression/tools/snapshots/test_kernel -@@ -29,12 +29,6 @@ NUM_TESTS=2060 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function test_kernel_local_snapshot () - { - diag "Test local kernel snapshots" -@@ -241,6 +235,9 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel snapshot tests." $NUM_TESTS || - { -+ -+ validate_lttng_modules_present -+ - start_lttng_sessiond - - #tests=( test_kernel_1000_local_snapshots ) -diff --git a/tests/regression/tools/snapshots/test_kernel_streaming b/tests/regression/tools/snapshots/test_kernel_streaming -index 7b96ef270..1d97519aa 100755 ---- a/tests/regression/tools/snapshots/test_kernel_streaming -+++ b/tests/regression/tools/snapshots/test_kernel_streaming -@@ -29,12 +29,6 @@ NUM_TESTS=61 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function snapshot_add_output () - { - local sess_name=$1 -@@ -169,6 +163,8 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present -+ - start_lttng_relayd "-o $TRACE_PATH" - start_lttng_sessiond - -diff --git a/tests/regression/tools/streaming/test_kernel b/tests/regression/tools/streaming/test_kernel -index d54bcedf5..6bb23d9f5 100755 ---- a/tests/regression/tools/streaming/test_kernel -+++ b/tests/regression/tools/streaming/test_kernel -@@ -28,12 +28,6 @@ NUM_TESTS=10 - - source $TESTDIR/utils/utils.sh - --# LTTng kernel modules check --out=`ls /lib/modules/$(uname -r)/extra | grep lttng` --if [ -z "$out" ]; then -- BAIL_OUT "LTTng modules not detected." --fi -- - function lttng_create_session_uri - { - # Create session with default path -@@ -80,6 +74,8 @@ fi - - skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || - { -+ validate_lttng_modules_present -+ - start_lttng_relayd "-o $TRACE_PATH" - start_lttng_sessiond - -diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh -index af63824ce..26e59e383 100644 ---- a/tests/utils/utils.sh -+++ b/tests/utils/utils.sh -@@ -125,6 +125,16 @@ function conf_proc_count() - echo - } - -+# Check if base lttng-modules are present. -+# Bail out on failure -+function validate_lttng_modules_present () -+{ -+ modprobe -n lttng-tracer 2>/dev/null -+ if [ $? -ne 0 ]; then -+ BAIL_OUT "LTTng modules not detected." -+ fi -+} -+ - function enable_kernel_lttng_event - { - local withtap="$1" --- -2.17.1 - diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0006-Tests-check-for-lttng-modules-presence.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0006-Tests-check-for-lttng-modules-presence.patch deleted file mode 100644 index 30aa66b2c8..0000000000 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0006-Tests-check-for-lttng-modules-presence.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 92f93238f1df005aadc98e105c0dd0e04a5955a7 Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Mon, 25 Mar 2019 14:24:51 -0400 -Subject: [2/2] tests: check for lttng-modules presence - -Upstream-Status: Accepted [5da3fc8579a9f93ea4767729a107784bf2d034ae] -Backported to 2.11 and 2.10 - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> ---- - tests/regression/tools/notification/test_notification_kernel | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/regression/tools/notification/test_notification_kernel b/tests/regression/tools/notification/test_notification_kernel -index 6d7f256ae..e7368df26 100755 ---- a/tests/regression/tools/notification/test_notification_kernel -+++ b/tests/regression/tools/notification/test_notification_kernel -@@ -108,6 +108,7 @@ function kernel_test - } - - if [ "$(id -u)" == "0" ]; then -+ validate_lttng_modules_present - kernel_test - else - # Kernel tests are skipped. --- -2.17.1 - diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch deleted file mode 100644 index a3362ea247..0000000000 --- a/poky/meta/recipes-kernel/lttng/lttng-tools/0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch +++ /dev/null @@ -1,347 +0,0 @@ -From 10e8001ad876d8cb3b5a17c7492e713bbc047975 Mon Sep 17 00:00:00 2001 -From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> -Date: Thu, 28 Mar 2019 18:31:29 -0400 -Subject: [PATCH] Fix: getgrnam is not MT-Safe, use getgrnam_r - -Running the test suite under a Yocto musl build resulted in musl -coredump due to double freeing. - -We get the following backtraces: - -0 a_crash () at ./arch/x86_64/atomic_arch.h:108 -1 unmap_chunk (self=<optimized out>) at src/malloc/malloc.c:515 -2 free (p=<optimized out>) at src/malloc/malloc.c:526 -3 0x00007f46d9dc3849 in __getgrent_a (f=f@entry=0x7f46d9d1f7e0, gr=gr@entry=0x7f46d9e24460 <gr>, line=line@entry=0x7f46d9e26058 <line>, size=size@entry=0x7f46d92db550, mem=mem@entry=0x7f46d9e26050 <mem>, nmem=nmem@entry=0x7f46d92db558, res=0x7f46d92db548) at src/passwd/getgrent_a.c:45 -4 0x00007f46d9dc2e6b in __getgr_a (name=0x487242 "tracing", gid=gid@entry=0, gr=gr@entry=0x7f46d9e24460 <gr>, buf=buf@entry=0x7f46d9e26058 <line>, size=size@entry=0x7f46d92db550, mem=mem@entry=0x7f46d9e26050 <mem>, nmem=0x7f46d92db558, res=0x7f46d92db548) at src/passwd/getgr_a.c:30 -5 0x00007f46d9dc3733 in getgrnam (name=<optimized out>) at src/passwd/getgrent.c:37 -6 0x0000000000460b29 in utils_get_group_id (name=<optimized out>) at ../../../lttng-tools-2.10.6/src/common/utils.c:1241 -7 0x000000000044ee69 in thread_manage_health (data=<optimized out>) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/main.c:4115 -8 0x00007f46d9de1541 in start (p=<optimized out>) at src/thread/pthread_create.c:195 -9 0x00007f46d9dee661 in __clone () at src/thread/x86_64/clone.s:22 - -From another run: - -0 a_crash () at ./arch/x86_64/atomic_arch.h:108 -1 unmap_chunk (self=<optimized out>) at src/malloc/malloc.c:515 -2 free (p=<optimized out>) at src/malloc/malloc.c:526 -3 0x00007f5abc210849 in __getgrent_a (f=f@entry=0x7f5abc2733e0, gr=gr@entry=0x7f5abc271460 <gr>, line=line@entry=0x7f5abc273058 <line>, size=size@entry=0x7f5abaef5510, mem=mem@entry=0x7f5abc273050 <mem>, nmem=nmem@entry=0x7f5abaef5518, res=0x7f5abaef5508) at src/passwd/getgrent_a.c:45 -4 0x00007f5abc20fe6b in __getgr_a (name=0x487242 "tracing", gid=gid@entry=0, gr=gr@entry=0x7f5abc271460 <gr>, buf=buf@entry=0x7f5abc273058 <line>, size=size@entry=0x7f5abaef5510, mem=mem@entry=0x7f5abc273050 <mem>, nmem=0x7f5abaef5518, res=0x7f5abaef5508) at src/passwd/getgr_a.c:30 -5 0x00007f5abc210733 in getgrnam (name=<optimized out>) at src/passwd/getgrent.c:37 -6 0x0000000000460b29 in utils_get_group_id (name=<optimized out>) at ../../../lttng-tools-2.10.6/src/common/utils.c:1241 -7 0x000000000042dee4 in notification_channel_socket_create () at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:238 -8 init_thread_state (state=0x7f5abaef5560, handle=0x7f5abbf9be40) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:375 -9 thread_notification (data=0x7f5abbf9be40) at ../../../../lttng-tools-2.10.6/src/bin/lttng-sessiond/notification-thread.c:495 -10 0x00007f5abc22e541 in start (p=<optimized out>) at src/thread/pthread_create.c:195 -11 0x00007f5abc23b661 in __clone () at src/thread/x86_64/clone.s:22 - -The problem was easily reproducible (~6 crash on ~300 runs). A prototype fix -using mutex around the getgrnam yielded no crash in over 1000 runs. This -patch yielded the same results as the prototype fix. - -Unfortunately we cannot rely on a mutex in liblttng-ctl since we cannot -enforce the locking for the application using the lib. - -Use getgrnam_r instead. - -The previous implementation of utils_get_group_id returned the gid of -the root group (0) on error/not found. lttng_check_tracing_group needs -to know if an error/not found occured, returning the root group is not -enough. We now return the gid via the passed parameter. The caller is -responsible for either defaulting to the root group or propagating the -error. - -We also do not want to warn when used in liblttng-ctl context. We might -want to move the warning elsewhere in the future. For now, pass a bool -if we need to warn or not. - -Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> - -Upstream-Status: Submitted [https://patchwork.lttng.org/patch/2314703] ---- - src/bin/lttng-consumerd/health-consumerd.c | 10 ++- - src/bin/lttng-relayd/health-relayd.c | 20 ++++-- - src/bin/lttng-sessiond/main.c | 24 +++++-- - src/bin/lttng-sessiond/notification-thread.c | 10 ++- - src/common/utils.c | 75 +++++++++++++++++--- - src/common/utils.h | 4 +- - src/lib/lttng-ctl/lttng-ctl.c | 8 +-- - 7 files changed, 122 insertions(+), 29 deletions(-) - -diff --git a/src/bin/lttng-consumerd/health-consumerd.c b/src/bin/lttng-consumerd/health-consumerd.c -index 1e2f31e4..6045401a 100644 ---- a/src/bin/lttng-consumerd/health-consumerd.c -+++ b/src/bin/lttng-consumerd/health-consumerd.c -@@ -184,8 +184,14 @@ void *thread_manage_health(void *data) - is_root = !getuid(); - if (is_root) { - /* lttng health client socket path permissions */ -- ret = chown(health_unix_sock_path, 0, -- utils_get_group_id(tracing_group_name)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(tracing_group_name, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group. */ -+ } -+ -+ ret = chown(health_unix_sock_path, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", health_unix_sock_path); - PERROR("chown"); -diff --git a/src/bin/lttng-relayd/health-relayd.c b/src/bin/lttng-relayd/health-relayd.c -index ba996621..962e88c4 100644 ---- a/src/bin/lttng-relayd/health-relayd.c -+++ b/src/bin/lttng-relayd/health-relayd.c -@@ -105,8 +105,14 @@ static int create_lttng_rundir_with_perm(const char *rundir) - int is_root = !getuid(); - - if (is_root) { -- ret = chown(rundir, 0, -- utils_get_group_id(tracing_group_name)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(tracing_group_name, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group.*/ -+ } -+ -+ ret = chown(rundir, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", rundir); - PERROR("chown"); -@@ -256,8 +262,14 @@ void *thread_manage_health(void *data) - is_root = !getuid(); - if (is_root) { - /* lttng health client socket path permissions */ -- ret = chown(health_unix_sock_path, 0, -- utils_get_group_id(tracing_group_name)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(tracing_group_name, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } -+ -+ ret = chown(health_unix_sock_path, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", health_unix_sock_path); - PERROR("chown"); -diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c -index fa6fa483..49307064 100644 ---- a/src/bin/lttng-sessiond/main.c -+++ b/src/bin/lttng-sessiond/main.c -@@ -4112,8 +4112,14 @@ static void *thread_manage_health(void *data) - - if (is_root) { - /* lttng health client socket path permissions */ -- ret = chown(config.health_unix_sock_path.value, 0, -- utils_get_group_id(config.tracing_group_name.value)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } -+ -+ ret = chown(config.health_unix_sock_path.value, 0, &gid); - if (ret < 0) { - ERR("Unable to set group on %s", config.health_unix_sock_path.value); - PERROR("chown"); -@@ -5238,7 +5244,10 @@ static int set_permissions(char *rundir) - int ret; - gid_t gid; - -- gid = utils_get_group_id(config.tracing_group_name.value); -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } - - /* Set lttng run dir */ - ret = chown(rundir, 0, gid); -@@ -5349,7 +5358,14 @@ static int set_consumer_sockets(struct consumer_data *consumer_data) - goto error; - } - if (is_root) { -- ret = chown(path, 0, utils_get_group_id(config.tracing_group_name.value)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group */ -+ } -+ -+ ret = chown(path, 0, gid); - if (ret < 0) { - ERR("Unable to set group on %s", path); - PERROR("chown"); -diff --git a/src/bin/lttng-sessiond/notification-thread.c b/src/bin/lttng-sessiond/notification-thread.c -index 92ac597f..18a264d9 100644 ---- a/src/bin/lttng-sessiond/notification-thread.c -+++ b/src/bin/lttng-sessiond/notification-thread.c -@@ -235,8 +235,14 @@ int notification_channel_socket_create(void) - } - - if (getuid() == 0) { -- ret = chown(sock_path, 0, -- utils_get_group_id(config.tracing_group_name.value)); -+ gid_t gid; -+ -+ ret = utils_get_group_id(config.tracing_group_name.value, true, &gid); -+ if (ret) { -+ gid = 0; /* Default to root group. */ -+ } -+ -+ ret = chown(sock_path, 0, gid); - if (ret) { - ERR("Failed to set the notification channel socket's group"); - ret = -1; -diff --git a/src/common/utils.c b/src/common/utils.c -index c0bb031e..778bc00f 100644 ---- a/src/common/utils.c -+++ b/src/common/utils.c -@@ -1231,24 +1231,77 @@ size_t utils_get_current_time_str(const char *format, char *dst, size_t len) - } - - /* -- * Return the group ID matching name, else 0 if it cannot be found. -+ * Return 0 on success and set *gid to the group_ID matching the passed name. -+ * Else -1 if it cannot be found or an error occurred. - */ - LTTNG_HIDDEN --gid_t utils_get_group_id(const char *name) -+int utils_get_group_id(const char *name, bool warn, gid_t *gid) - { -- struct group *grp; -+ static volatile int warn_once; - -- grp = getgrnam(name); -- if (!grp) { -- static volatile int warn_once; -+ int ret; -+ long sys_len; -+ size_t len; -+ struct group grp; -+ struct group *result; -+ char *buffer = NULL; - -- if (!warn_once) { -- WARN("No tracing group detected"); -- warn_once = 1; -+ /* Get the system limit if it exists */ -+ sys_len = sysconf(_SC_GETGR_R_SIZE_MAX); -+ if (sys_len == -1) { -+ len = 1024; -+ } else { -+ len = (size_t) sys_len; -+ } -+ -+ buffer = malloc(len); -+ if (!buffer) { -+ PERROR("getgrnam_r malloc"); -+ ret = -1; -+ goto error; -+ } -+ -+ while ((ret = getgrnam_r(name, &grp, buffer, len, &result)) == ERANGE) -+ { -+ /* Buffer is not big enough, increase its size. */ -+ size_t new_len = 2 * len; -+ char *new_buffer = NULL; -+ if (new_len < len) { -+ ERR("getgrnam_r buffer size overflow"); -+ ret = -1; -+ goto error; -+ } -+ len = new_len; -+ new_buffer = realloc(buffer, len); -+ if (!new_buffer) { -+ PERROR("getgrnam_r realloc"); -+ ret = -1; -+ goto error; - } -- return 0; -+ buffer = new_buffer; -+ } -+ if (ret != 0) { -+ PERROR("getgrnam_r"); -+ ret = -1; -+ goto error; -+ } -+ -+ /* Group not found. */ -+ if (!result) { -+ ret = -1; -+ goto error; -+ } -+ -+ *gid = result->gr_gid; -+ ret = 0; -+ -+error: -+ free(buffer); -+ if (ret && warn && !warn_once) { -+ WARN("No tracing group detected"); -+ warn_once = 1; - } -- return grp->gr_gid; -+ return ret; - } - - /* -diff --git a/src/common/utils.h b/src/common/utils.h -index 18f19ef1..9c72431d 100644 ---- a/src/common/utils.h -+++ b/src/common/utils.h -@@ -22,6 +22,8 @@ - #include <unistd.h> - #include <stdint.h> - #include <getopt.h> -+#include <stdbool.h> -+#include <sys/types.h> - - #define KIBI_LOG2 10 - #define MEBI_LOG2 20 -@@ -52,7 +54,7 @@ int utils_get_count_order_u64(uint64_t x); - char *utils_get_home_dir(void); - char *utils_get_user_home_dir(uid_t uid); - size_t utils_get_current_time_str(const char *format, char *dst, size_t len); --gid_t utils_get_group_id(const char *name); -+int utils_get_group_id(const char *name, bool warn, gid_t *gid); - char *utils_generate_optstring(const struct option *long_options, - size_t opt_count); - int utils_create_lock_file(const char *filepath); -diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c -index 2d84aad9..561b0bcf 100644 ---- a/src/lib/lttng-ctl/lttng-ctl.c -+++ b/src/lib/lttng-ctl/lttng-ctl.c -@@ -208,15 +208,13 @@ end: - LTTNG_HIDDEN - int lttng_check_tracing_group(void) - { -- struct group *grp_tracing; /* no free(). See getgrnam(3) */ -- gid_t *grp_list; -+ gid_t *grp_list, tracing_gid; - int grp_list_size, grp_id, i; - int ret = -1; - const char *grp_name = tracing_group; - - /* Get GID of group 'tracing' */ -- grp_tracing = getgrnam(grp_name); -- if (!grp_tracing) { -+ if (utils_get_group_id(grp_name, false, &tracing_gid)) { - /* If grp_tracing is NULL, the group does not exist. */ - goto end; - } -@@ -241,7 +239,7 @@ int lttng_check_tracing_group(void) - } - - for (i = 0; i < grp_list_size; i++) { -- if (grp_list[i] == grp_tracing->gr_gid) { -+ if (grp_list[i] == tracing_gid) { - ret = 1; - break; - } --- -2.17.1 - diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb b/poky/meta/recipes-kernel/lttng/lttng-tools_2.10.7.bb index 58c7864c30..469ad111c4 100644 --- a/poky/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb +++ b/poky/meta/recipes-kernel/lttng/lttng-tools_2.10.7.bb @@ -32,18 +32,12 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ file://x32.patch \ file://run-ptest \ file://lttng-sessiond.service \ - file://0001-Fix-tests-link-libpause_consumer-on-liblttng-ctl.patch \ - file://0002-Fix-test-skip-test_getcpu_override-on-single-thread-.patch \ - file://0003-Fix-test-unit-the-tree-origin-can-be-a-symlink-itsel.patch \ - file://0004-Skip-when-testapp-is-not-present.patch\ - file://0005-Tests-use-modprobe-to-test-for-the-presence-of-lttng.patch \ - file://0006-Tests-check-for-lttng-modules-presence.patch \ - file://0007-Fix-getgrnam-is-not-MT-Safe-use-getgrnam_r.patch \ - file://0008-Fix-check-for-lttng-modules-presence-before-testing.patch \ + file://0001-Skip-when-testapp-is-not-present.patch \ + file://0002-Fix-check-for-lttng-modules-presence-before-testing.patch \ " -SRC_URI[md5sum] = "e88c521b5da6bb48a8187af633336ecc" -SRC_URI[sha256sum] = "f05df52bbebf8ce88d1b29e9e98cfc957d2ed738a345118018237ebdb581537c" +SRC_URI[md5sum] = "e7804d10e4cade381e241601f6047373" +SRC_URI[sha256sum] = "ed71ebe00c5d985c74f30e97b614e909573cbd9276c85e05d9557a0b817a1312" inherit autotools ptest pkgconfig useradd python3-dir manpages systemd |