diff options
Diffstat (limited to 'poky/meta/classes')
-rw-r--r-- | poky/meta/classes/archiver.bbclass | 12 | ||||
-rw-r--r-- | poky/meta/classes/base.bbclass | 16 | ||||
-rw-r--r-- | poky/meta/classes/cve-check.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/classes/fontcache.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/classes/go-mod.bbclass | 20 | ||||
-rw-r--r-- | poky/meta/classes/go.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/classes/image_types.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/classes/image_types_wic.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/classes/insane.bbclass | 21 | ||||
-rw-r--r-- | poky/meta/classes/kernel.bbclass | 16 | ||||
-rw-r--r-- | poky/meta/classes/multilib.bbclass | 28 | ||||
-rw-r--r-- | poky/meta/classes/package.bbclass | 4 | ||||
-rw-r--r-- | poky/meta/classes/package_deb.bbclass | 5 | ||||
-rw-r--r-- | poky/meta/classes/package_ipk.bbclass | 2 | ||||
-rw-r--r-- | poky/meta/classes/package_rpm.bbclass | 26 | ||||
-rw-r--r-- | poky/meta/classes/sanity.bbclass | 6 |
16 files changed, 123 insertions, 43 deletions
diff --git a/poky/meta/classes/archiver.bbclass b/poky/meta/classes/archiver.bbclass index 48b4913a9f..780c562b68 100644 --- a/poky/meta/classes/archiver.bbclass +++ b/poky/meta/classes/archiver.bbclass @@ -193,7 +193,13 @@ python do_ar_original() { del decoded[5][param] encoded = bb.fetch2.encodeurl(decoded) urls[i] = encoded - fetch = bb.fetch2.Fetch(urls, d) + + # Cleanup SRC_URI before call bb.fetch2.Fetch() since now SRC_URI is in the + # variable "urls", otherwise there might be errors like: + # The SRCREV_FORMAT variable must be set when multiple SCMs are used + ld = bb.data.createCopy(d) + ld.setVar('SRC_URI', '') + fetch = bb.fetch2.Fetch(urls, ld) tarball_suffix = {} for url in fetch.urls: local = fetch.localpath(url).rstrip("/"); @@ -583,7 +589,9 @@ addtask do_ar_configured after do_unpack_and_patch addtask do_ar_mirror after do_fetch addtask do_dumpdata addtask do_ar_recipe -addtask do_deploy_archives before do_build +addtask do_deploy_archives +do_build[recrdeptask] += "do_deploy_archives" +do_populate_sdk[recrdeptask] += "do_deploy_archives" python () { # Add tasks in the correct order, specifically for linux-yocto to avoid race condition. diff --git a/poky/meta/classes/base.bbclass b/poky/meta/classes/base.bbclass index 45f9435fd8..4c681cc870 100644 --- a/poky/meta/classes/base.bbclass +++ b/poky/meta/classes/base.bbclass @@ -570,8 +570,7 @@ python () { if unskipped_pkgs: for pkg in skipped_pkgs: bb.debug(1, "Skipping the package %s at do_rootfs because of incompatible license(s): %s" % (pkg, ' '.join(skipped_pkgs[pkg]))) - mlprefix = d.getVar('MLPREFIX') - d.setVar('LICENSE_EXCLUSION-' + mlprefix + pkg, ' '.join(skipped_pkgs[pkg])) + d.setVar('LICENSE_EXCLUSION-' + pkg, ' '.join(skipped_pkgs[pkg])) for pkg in unskipped_pkgs: bb.debug(1, "Including the package %s" % pkg) else: @@ -584,19 +583,6 @@ python () { bb.debug(1, "Skipping recipe %s because of incompatible license(s): %s" % (pn, ' '.join(incompatible_lic))) raise bb.parse.SkipRecipe("it has incompatible license(s): %s" % ' '.join(incompatible_lic)) - # Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a - # superset of all per-package licenses. We do not do advanced (pattern) - # matching of license expressions - just check that all license strings - # in LICENSE_<pkg> are found in LICENSE. - license_set = oe.license.list_licenses(license) - for pkg in d.getVar('PACKAGES').split(): - pkg_license = d.getVar('LICENSE_' + pkg) - if pkg_license: - unlisted = oe.license.list_licenses(pkg_license) - license_set - if unlisted: - bb.warn("LICENSE_%s includes licenses (%s) that are not " - "listed in LICENSE" % (pkg, ' '.join(unlisted))) - needsrcrev = False srcuri = d.getVar('SRC_URI') for uri in srcuri.split(): diff --git a/poky/meta/classes/cve-check.bbclass b/poky/meta/classes/cve-check.bbclass index 2a530a0489..556ac6e67f 100644 --- a/poky/meta/classes/cve-check.bbclass +++ b/poky/meta/classes/cve-check.bbclass @@ -65,7 +65,7 @@ python do_cve_check () { } -addtask cve_check before do_build +addtask cve_check before do_build after do_fetch do_cve_check[depends] = "cve-update-db-native:do_populate_cve_db" do_cve_check[nostamp] = "1" diff --git a/poky/meta/classes/fontcache.bbclass b/poky/meta/classes/fontcache.bbclass index 97e7f17f00..624a420a0d 100644 --- a/poky/meta/classes/fontcache.bbclass +++ b/poky/meta/classes/fontcache.bbclass @@ -7,7 +7,7 @@ PACKAGE_WRITE_DEPS += "qemu-native" inherit qemu FONT_PACKAGES ??= "${PN}" -FONT_EXTRA_RDEPENDS ?= "fontconfig-utils" +FONT_EXTRA_RDEPENDS ?= "${MLPREFIX}fontconfig-utils" FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig" FONTCONFIG_CACHE_PARAMS ?= "-v" # You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues, diff --git a/poky/meta/classes/go-mod.bbclass b/poky/meta/classes/go-mod.bbclass new file mode 100644 index 0000000000..5871d02506 --- /dev/null +++ b/poky/meta/classes/go-mod.bbclass @@ -0,0 +1,20 @@ +# Handle Go Modules support +# +# When using Go Modules, the the current working directory MUST be at or below +# the location of the 'go.mod' file when the go tool is used, and there is no +# way to tell it to look elsewhere. It will automatically look upwards for the +# file, but not downwards. +# +# To support this use case, we provide the `GO_WORKDIR` variable, which defaults +# to `GO_IMPORT` but allows for easy override. +# +# Copyright 2020 (C) O.S. Systems Software LTDA. + +# The '-modcacherw' option ensures we have write access to the cached objects so +# we avoid errors during clean task as well as when removing the TMPDIR. +export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -modcacherw" + +inherit go + +GO_WORKDIR ?= "${GO_IMPORT}" +do_compile[dirs] += "${B}/src/${GO_WORKDIR}" diff --git a/poky/meta/classes/go.bbclass b/poky/meta/classes/go.bbclass index c99689ac59..a9e31b50ea 100644 --- a/poky/meta/classes/go.bbclass +++ b/poky/meta/classes/go.bbclass @@ -41,7 +41,7 @@ GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS GO_LINKMODE ?= "" GO_LINKMODE_class-nativesdk = "--linkmode=external" GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"' -export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}" +export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -trimpath" export GOPATH_OMIT_IN_ACTIONID ?= "1" export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c" export GOPTESTFLAGS ?= "" diff --git a/poky/meta/classes/image_types.bbclass b/poky/meta/classes/image_types.bbclass index f82f1d8862..ab05cc90ff 100644 --- a/poky/meta/classes/image_types.bbclass +++ b/poky/meta/classes/image_types.bbclass @@ -273,7 +273,7 @@ IMAGE_TYPES = " \ ubi ubifs multiubi \ tar tar.gz tar.bz2 tar.xz tar.lz4 tar.zst \ cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \ - wic wic.gz wic.bz2 wic.lzma \ + wic wic.gz wic.bz2 wic.lzma wic.zst \ container \ f2fs \ " diff --git a/poky/meta/classes/image_types_wic.bbclass b/poky/meta/classes/image_types_wic.bbclass index 96ed0473ee..7b1db50a28 100644 --- a/poky/meta/classes/image_types_wic.bbclass +++ b/poky/meta/classes/image_types_wic.bbclass @@ -142,7 +142,7 @@ python do_rootfs_wicenv () { depdir = d.getVar('IMGDEPLOYDIR') bb.utils.copyfile(os.path.join(outdir, basename) + '.env', os.path.join(depdir, basename) + '.env') } -addtask do_flush_pseudodb after do_image before do_image_wic +addtask do_flush_pseudodb after do_rootfs before do_image do_image_qa addtask do_rootfs_wicenv after do_image before do_image_wic do_rootfs_wicenv[vardeps] += "${WICVARS}" do_rootfs_wicenv[prefuncs] = 'set_image_size' diff --git a/poky/meta/classes/insane.bbclass b/poky/meta/classes/insane.bbclass index 8b19f445f9..b7c613880b 100644 --- a/poky/meta/classes/insane.bbclass +++ b/poky/meta/classes/insane.bbclass @@ -26,7 +26,7 @@ WARN_QA ?= " libdir xorg-driver-abi \ textrel incompatible-license files-invalid \ infodir build-deps src-uri-bad symlink-to-sysroot multilib \ invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ - mime mime-xdg \ + mime mime-xdg unlisted-pkg-lics \ " ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ perms dep-cmp pkgvarcheck perm-config perm-line perm-link \ @@ -898,6 +898,25 @@ def package_qa_check_expanded_d(package, d, messages): sane = False return sane +QAPKGTEST[unlisted-pkg-lics] = "package_qa_check_unlisted_pkg_lics" +def package_qa_check_unlisted_pkg_lics(package, d, messages): + """ + Check that all licenses for a package are among the licenses for the recipe. + """ + pkg_lics = d.getVar('LICENSE_' + package) + if not pkg_lics: + return True + + recipe_lics_set = oe.license.list_licenses(d.getVar('LICENSE')) + unlisted = oe.license.list_licenses(pkg_lics) - recipe_lics_set + if not unlisted: + return True + + package_qa_add_message(messages, "unlisted-pkg-lics", + "LICENSE_%s includes licenses (%s) that are not " + "listed in LICENSE" % (package, ' '.join(unlisted))) + return False + def package_qa_check_encoding(keys, encode, d): def check_encoding(key, enc): sane = True diff --git a/poky/meta/classes/kernel.bbclass b/poky/meta/classes/kernel.bbclass index 6846d6040d..20a0135fc9 100644 --- a/poky/meta/classes/kernel.bbclass +++ b/poky/meta/classes/kernel.bbclass @@ -331,6 +331,21 @@ kernel_do_compile() { do_compile_kernelmodules() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE + if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then + # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not + # be set.... + if [ "${SOURCE_DATE_EPOCH}" = "" -o "${SOURCE_DATE_EPOCH}" = "0" ]; then + # The source directory is not necessarily a git repository, so we + # specify the git-dir to ensure that git does not query a + # repository in any parent directory. + SOURCE_DATE_EPOCH=`git --git-dir="${S}/.git" log -1 --pretty=%ct 2>/dev/null || echo "${REPRODUCIBLE_TIMESTAMP_ROOTFS}"` + fi + + ts=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH` + export KBUILD_BUILD_TIMESTAMP="$ts" + export KCONFIG_NOTIMESTAMP=1 + bbnote "KBUILD_BUILD_TIMESTAMP: $ts" + fi if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then cc_extra=$(get_cc_option) oe_runmake -C ${B} ${PARALLEL_MAKE} modules CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} @@ -696,6 +711,7 @@ kernel_do_deploy() { else TAR_ARGS="" fi + TAR_ARGS="$TAR_ARGS --owner=0 --group=0" tar $TAR_ARGS -cv -C ${D}${root_prefix} lib | gzip -9n > $deployDir/modules-${MODULE_TARBALL_NAME}.tgz ln -sf modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz diff --git a/poky/meta/classes/multilib.bbclass b/poky/meta/classes/multilib.bbclass index ee677da1e2..9f726e4537 100644 --- a/poky/meta/classes/multilib.bbclass +++ b/poky/meta/classes/multilib.bbclass @@ -91,13 +91,12 @@ addhandler multilib_virtclass_handler multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" python __anonymous () { - variant = d.getVar("BBEXTENDVARIANT") - - import oe.classextend + if bb.data.inherits_class('image', d): + variant = d.getVar("BBEXTENDVARIANT") + import oe.classextend - clsextend = oe.classextend.ClassExtender(variant, d) + clsextend = oe.classextend.ClassExtender(variant, d) - if bb.data.inherits_class('image', d): clsextend.map_depends_variable("PACKAGE_INSTALL") clsextend.map_depends_variable("LINGUAS_INSTALL") clsextend.map_depends_variable("RDEPENDS") @@ -109,6 +108,22 @@ python __anonymous () { bb.build.deltask('do_populate_sdk', d) bb.build.deltask('do_populate_sdk_ext', d) return +} + +python multilib_virtclass_handler_postkeyexp () { + cls = d.getVar("BBEXTENDCURR") + variant = d.getVar("BBEXTENDVARIANT") + if cls != "multilib" or not variant: + return + + variant = d.getVar("BBEXTENDVARIANT") + + import oe.classextend + + clsextend = oe.classextend.ClassExtender(variant, d) + + if bb.data.inherits_class('image', d): + return clsextend.map_depends_variable("DEPENDS") clsextend.map_variable("PROVIDES") @@ -129,6 +144,9 @@ python __anonymous () { reset_alternative_priority(d) } +addhandler multilib_virtclass_handler_postkeyexp +multilib_virtclass_handler_postkeyexp[eventmask] = "bb.event.RecipePostKeyExpansion" + def reset_alternative_priority(d): if not bb.data.inherits_class('update-alternatives', d): return diff --git a/poky/meta/classes/package.bbclass b/poky/meta/classes/package.bbclass index 0b5cf47749..0af5f66733 100644 --- a/poky/meta/classes/package.bbclass +++ b/poky/meta/classes/package.bbclass @@ -1508,7 +1508,7 @@ EXPORT_FUNCTIONS package_name_hook PKGDESTWORK = "${WORKDIR}/pkgdata" -PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS RPROVIDES RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS SECTION PKG ALLOW_EMPTY FILES CONFFILES FILES_INFO pkg_postinst pkg_postrm pkg_preinst pkg_prerm" +PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS RPROVIDES RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS SECTION PKG ALLOW_EMPTY FILES CONFFILES FILES_INFO PACKAGE_ADD_METADATA pkg_postinst pkg_postrm pkg_preinst pkg_prerm" python emit_pkgdata() { from glob import glob @@ -2263,7 +2263,7 @@ python package_depchains() { # Since bitbake can't determine which variables are accessed during package # iteration, we need to list them here: -PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm pkg_postinst_ontarget INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE SKIP_FILEDEPS PRIVATE_LIBS" +PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm pkg_postinst_ontarget INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE SKIP_FILEDEPS PRIVATE_LIBS PACKAGE_ADD_METADATA" def gen_packagevar(d, pkgvars="PACKAGEVARS"): ret = [] diff --git a/poky/meta/classes/package_deb.bbclass b/poky/meta/classes/package_deb.bbclass index 790b26aef2..cb723fc1d6 100644 --- a/poky/meta/classes/package_deb.bbclass +++ b/poky/meta/classes/package_deb.bbclass @@ -283,8 +283,9 @@ def deb_write_pkg(pkg, d): # Otherwise allarch packages may change depending on override configuration deb_write_pkg[vardepsexclude] = "OVERRIDES" -# Indirect references to these vars -do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE" +# Have to list any variables referenced as X_<pkg> that aren't in pkgdata here +DEBEXTRAVARS = "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE PACKAGE_ADD_METADATA_DEB" +do_package_write_deb[vardeps] += "${@gen_packagevar(d, 'DEBEXTRAVARS')}" SSTATETASKS += "do_package_write_deb" do_package_write_deb[sstate-inputdirs] = "${PKGWRITEDIRDEB}" diff --git a/poky/meta/classes/package_ipk.bbclass b/poky/meta/classes/package_ipk.bbclass index c008559e4a..79cb36c513 100644 --- a/poky/meta/classes/package_ipk.bbclass +++ b/poky/meta/classes/package_ipk.bbclass @@ -238,7 +238,7 @@ def ipk_write_pkg(pkg, d): bb.utils.unlockfile(lf) # Have to list any variables referenced as X_<pkg> that aren't in pkgdata here -IPKEXTRAVARS = "PRIORITY MAINTAINER PACKAGE_ARCH HOMEPAGE" +IPKEXTRAVARS = "PRIORITY MAINTAINER PACKAGE_ARCH HOMEPAGE PACKAGE_ADD_METADATA_IPK" ipk_write_pkg[vardeps] += "${@gen_packagevar(d, 'IPKEXTRAVARS')}" # Otherwise allarch packages may change depending on override configuration diff --git a/poky/meta/classes/package_rpm.bbclass b/poky/meta/classes/package_rpm.bbclass index 9145717f98..519c22be47 100644 --- a/poky/meta/classes/package_rpm.bbclass +++ b/poky/meta/classes/package_rpm.bbclass @@ -286,16 +286,18 @@ python write_specfile () { # Construct the SPEC file... srcname = d.getVar('PN') - srcsummary = (d.getVar('SUMMARY') or d.getVar('DESCRIPTION') or ".") - srcversion = d.getVar('PKGV').replace('-', '+') - srcrelease = d.getVar('PKGR') - srcepoch = (d.getVar('PKGE') or "") - srclicense = d.getVar('LICENSE') - srcsection = d.getVar('SECTION') - srcmaintainer = d.getVar('MAINTAINER') - srchomepage = d.getVar('HOMEPAGE') - srcdescription = d.getVar('DESCRIPTION') or "." - srccustomtagschunk = get_package_additional_metadata("rpm", d) + localdata = bb.data.createCopy(d) + localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + srcname) + srcsummary = (localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or ".") + srcversion = localdata.getVar('PKGV').replace('-', '+') + srcrelease = localdata.getVar('PKGR') + srcepoch = (localdata.getVar('PKGE') or "") + srclicense = localdata.getVar('LICENSE') + srcsection = localdata.getVar('SECTION') + srcmaintainer = localdata.getVar('MAINTAINER') + srchomepage = localdata.getVar('HOMEPAGE') + srcdescription = localdata.getVar('DESCRIPTION') or "." + srccustomtagschunk = get_package_additional_metadata("rpm", localdata) srcdepends = d.getVar('DEPENDS') srcrdepends = [] @@ -621,6 +623,10 @@ python write_specfile () { # Otherwise allarch packages may change depending on override configuration write_specfile[vardepsexclude] = "OVERRIDES" +# Have to list any variables referenced as X_<pkg> that aren't in pkgdata here +RPMEXTRAVARS = "PACKAGE_ADD_METADATA_RPM" +write_specfile[vardeps] += "${@gen_packagevar(d, 'RPMEXTRAVARS')}" + python do_package_rpm () { workdir = d.getVar('WORKDIR') tmpdir = d.getVar('TMPDIR') diff --git a/poky/meta/classes/sanity.bbclass b/poky/meta/classes/sanity.bbclass index 292c5591dd..e021b9d240 100644 --- a/poky/meta/classes/sanity.bbclass +++ b/poky/meta/classes/sanity.bbclass @@ -784,6 +784,12 @@ def check_sanity_everybuild(status, d): if "." in paths or "./" in paths or "" in paths: status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") + # Check whether 'inherit' directive is found (used for a class to inherit) + # in conf file it's supposed to be uppercase INHERIT + inherit = d.getVar('inherit') + if inherit: + status.addresult("Please don't use inherit directive in your local.conf. The directive is supposed to be used in classes and recipes only to inherit of bbclasses. Here INHERIT should be used.\n") + # Check that the DISTRO is valid, if set # need to take into account DISTRO renaming DISTRO distro = d.getVar('DISTRO') |