diff options
Diffstat (limited to 'meta/recipes-core/meta')
19 files changed, 495 insertions, 101 deletions
diff --git a/meta/recipes-core/meta/build-sysroots.bb b/meta/recipes-core/meta/build-sysroots.bb new file mode 100644 index 0000000000..7a712e2f38 --- /dev/null +++ b/meta/recipes-core/meta/build-sysroots.bb @@ -0,0 +1,38 @@ +INHIBIT_DEFAULT_DEPS = "1" +LICENSE = "MIT" + +STANDALONE_SYSROOT = "${STAGING_DIR}/${MACHINE}" +STANDALONE_SYSROOT_NATIVE = "${STAGING_DIR}/${BUILD_ARCH}" +PACKAGE_ARCH = "${MACHINE_ARCH}" +EXCLUDE_FROM_WORLD = "1" + +inherit nopackages +deltask fetch +deltask unpack +deltask patch +deltask prepare_recipe_sysroot +deltask populate_lic +deltask configure +deltask compile +deltask install +deltask populate_sysroot + +python do_build_native_sysroot () { + targetsysroot = d.getVar("STANDALONE_SYSROOT") + nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE") + staging_populate_sysroot_dir(targetsysroot, nativesysroot, True, d) +} +do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}" +do_build_native_sysroot[nostamp] = "1" +addtask do_build_native_sysroot before do_build + +python do_build_target_sysroot () { + targetsysroot = d.getVar("STANDALONE_SYSROOT") + nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE") + staging_populate_sysroot_dir(targetsysroot, nativesysroot, False, d) +} +do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}" +do_build_target_sysroot[nostamp] = "1" +addtask do_build_target_sysroot before do_build + +do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}" diff --git a/meta/recipes-core/meta/buildtools-tarball.bb b/meta/recipes-core/meta/buildtools-tarball.bb index 5808c95d81..9c5c2cc8d6 100644 --- a/meta/recipes-core/meta/buildtools-tarball.bb +++ b/meta/recipes-core/meta/buildtools-tarball.bb @@ -2,8 +2,6 @@ DESCRIPTION = "SDK type target for building a standalone tarball containing pyth tarball can be used to run bitbake builds on systems which don't meet the usual version requirements." SUMMARY = "Standalone tarball for running builds on systems with inadequate software" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" TOOLCHAIN_TARGET_TASK ?= "" @@ -12,6 +10,8 @@ TOOLCHAIN_HOST_TASK ?= "\ nativesdk-python3-modules \ nativesdk-python3-misc \ nativesdk-python3-git \ + nativesdk-python3-testtools \ + nativesdk-python3-subunit \ nativesdk-ncurses-terminfo-base \ nativesdk-chrpath \ nativesdk-tar \ @@ -23,7 +23,8 @@ TOOLCHAIN_HOST_TASK ?= "\ nativesdk-wget \ nativesdk-ca-certificates \ nativesdk-texinfo \ - nativesdk-locale-base-en-us \ + nativesdk-libnss-nis \ + nativesdk-rpcsvc-proto \ " MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}" @@ -48,8 +49,6 @@ inherit toolchain-scripts-base inherit nopackages deltask install -deltask package -deltask packagedata deltask populate_sysroot do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}" @@ -73,6 +72,7 @@ create_sdk_files_append () { toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS} echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script + echo 'export OPENSSL_CONF="${SDKPATHNATIVE}${sysconfdir}/ssl/openssl.cnf"' >>$script if [ "${SDKMACHINE}" = "i686" ]; then echo 'export NO32LIBS="0"' >>$script diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb new file mode 100644 index 0000000000..575254af40 --- /dev/null +++ b/meta/recipes-core/meta/cve-update-db-native.bb @@ -0,0 +1,185 @@ +SUMMARY = "Updates the NVD CVE database" +LICENSE = "MIT" + +INHIBIT_DEFAULT_DEPS = "1" + +inherit native + +deltask do_unpack +deltask do_patch +deltask do_configure +deltask do_compile +deltask do_install +deltask do_populate_sysroot + +python () { + if not d.getVar("CVE_CHECK_DB_FILE"): + raise bb.parse.SkipRecipe("Skip recipe when cve-check class is not loaded.") +} + +python do_populate_cve_db() { + """ + Update NVD database with json data feed + """ + import bb.utils + import sqlite3, urllib, urllib.parse, shutil, gzip + from datetime import date + + bb.utils.export_proxies(d) + + BASE_URL = "https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-" + YEAR_START = 2002 + + db_file = d.getVar("CVE_CHECK_DB_FILE") + db_dir = os.path.dirname(db_file) + json_tmpfile = os.path.join(db_dir, 'nvd.json.gz') + + # Don't refresh the database more than once an hour + try: + import time + if time.time() - os.path.getmtime(db_file) < (60*60): + return + except OSError: + pass + + cve_f = open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a') + + if not os.path.isdir(db_dir): + os.mkdir(db_dir) + + # Connect to database + conn = sqlite3.connect(db_file) + c = conn.cursor() + + initialize_db(c) + + for year in range(YEAR_START, date.today().year + 1): + year_url = BASE_URL + str(year) + meta_url = year_url + ".meta" + json_url = year_url + ".json.gz" + + # Retrieve meta last modified date + response = urllib.request.urlopen(meta_url) + if response: + for l in response.read().decode("utf-8").splitlines(): + key, value = l.split(":", 1) + if key == "lastModifiedDate": + last_modified = value + break + else: + bb.warn("Cannot parse CVE metadata, update failed") + return + + # Compare with current db last modified date + c.execute("select DATE from META where YEAR = ?", (year,)) + meta = c.fetchone() + if not meta or meta[0] != last_modified: + # Clear products table entries corresponding to current year + c.execute("delete from PRODUCTS where ID like ?", ('CVE-%d%%' % year,)) + + # Update db with current year json file + try: + response = urllib.request.urlopen(json_url) + if response: + update_db(c, gzip.decompress(response.read()).decode('utf-8')) + c.execute("insert or replace into META values (?, ?)", [year, last_modified]) + except urllib.error.URLError as e: + cve_f.write('Warning: CVE db update error, CVE data is outdated.\n\n') + bb.warn("Cannot parse CVE data (%s), update failed" % e.reason) + return + + # Update success, set the date to cve_check file. + if year == date.today().year: + cve_f.write('CVE database update : %s\n\n' % date.today()) + + cve_f.close() + conn.commit() + conn.close() +} + +def initialize_db(c): + c.execute("CREATE TABLE IF NOT EXISTS META (YEAR INTEGER UNIQUE, DATE TEXT)") + + c.execute("CREATE TABLE IF NOT EXISTS NVD (ID TEXT UNIQUE, SUMMARY TEXT, \ + SCOREV2 TEXT, SCOREV3 TEXT, MODIFIED INTEGER, VECTOR TEXT)") + + c.execute("CREATE TABLE IF NOT EXISTS PRODUCTS (ID TEXT, \ + VENDOR TEXT, PRODUCT TEXT, VERSION_START TEXT, OPERATOR_START TEXT, \ + VERSION_END TEXT, OPERATOR_END TEXT)") + c.execute("CREATE INDEX IF NOT EXISTS PRODUCT_ID_IDX on PRODUCTS(ID);") + +def parse_node_and_insert(c, node, cveId): + # Parse children node if needed + for child in node.get('children', ()): + parse_node_and_insert(c, child, cveId) + + def cpe_generator(): + for cpe in node.get('cpe_match', ()): + if not cpe['vulnerable']: + return + cpe23 = cpe['cpe23Uri'].split(':') + vendor = cpe23[3] + product = cpe23[4] + version = cpe23[5] + + if version != '*': + # Version is defined, this is a '=' match + yield [cveId, vendor, product, version, '=', '', ''] + else: + # Parse start version, end version and operators + op_start = '' + op_end = '' + v_start = '' + v_end = '' + + if 'versionStartIncluding' in cpe: + op_start = '>=' + v_start = cpe['versionStartIncluding'] + + if 'versionStartExcluding' in cpe: + op_start = '>' + v_start = cpe['versionStartExcluding'] + + if 'versionEndIncluding' in cpe: + op_end = '<=' + v_end = cpe['versionEndIncluding'] + + if 'versionEndExcluding' in cpe: + op_end = '<' + v_end = cpe['versionEndExcluding'] + + yield [cveId, vendor, product, v_start, op_start, v_end, op_end] + + c.executemany("insert into PRODUCTS values (?, ?, ?, ?, ?, ?, ?)", cpe_generator()) + +def update_db(c, jsondata): + import json + root = json.loads(jsondata) + + for elt in root['CVE_Items']: + if not elt['impact']: + continue + + cveId = elt['cve']['CVE_data_meta']['ID'] + cveDesc = elt['cve']['description']['description_data'][0]['value'] + date = elt['lastModifiedDate'] + accessVector = elt['impact']['baseMetricV2']['cvssV2']['accessVector'] + cvssv2 = elt['impact']['baseMetricV2']['cvssV2']['baseScore'] + + try: + cvssv3 = elt['impact']['baseMetricV3']['cvssV3']['baseScore'] + except: + cvssv3 = 0.0 + + c.execute("insert or replace into NVD values (?, ?, ?, ?, ?, ?)", + [cveId, cveDesc, cvssv2, cvssv3, date, accessVector]) + + configurations = elt['configurations']['nodes'] + for config in configurations: + parse_node_and_insert(c, config, cveId) + + +addtask do_populate_cve_db before do_fetch +do_populate_cve_db[nostamp] = "1" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta/recipes-core/meta/dummy-sdk-package.inc b/meta/recipes-core/meta/dummy-sdk-package.inc new file mode 100644 index 0000000000..61afab1d76 --- /dev/null +++ b/meta/recipes-core/meta/dummy-sdk-package.inc @@ -0,0 +1,30 @@ +SUMMARY = "Dummy packages which handle excluding packages from the sdk, e.g. ensuring perl is excluded from buildtools" +LICENSE = "MIT" + +PACKAGE_ARCH = "all" + +inherit allarch + +python() { + # Put the package somewhere separate to ensure it's never used except + # when we want it + # (note that we have to do this in anonymous python here to avoid + # allarch.bbclass disabling itself) + d.setVar('PACKAGE_ARCH', '${DUMMYARCH}') +} + +ALLOW_EMPTY_${PN} = "1" + +PR[vardeps] += "DUMMYPROVIDES" +PR[vardeps] += "DUMMYPROVIDES_PACKAGES" + +DUMMYPROVIDES_PACKAGES ??= "" +DUMMYPROVIDES += "${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split()])}" + +python populate_packages_prepend() { + p = d.getVar("PN") + d.appendVar("RPROVIDES_%s" % p, "${DUMMYPROVIDES}") + d.appendVar("RCONFLICTS_%s" % p, "${DUMMYPROVIDES}") + d.appendVar("RREPLACES_%s" % p, "${DUMMYPROVIDES_PACKAGES}") +} + diff --git a/meta/recipes-core/meta/meta-environment-extsdk.bb b/meta/recipes-core/meta/meta-environment-extsdk.bb index d9e596143f..2076b56f25 100644 --- a/meta/recipes-core/meta/meta-environment-extsdk.bb +++ b/meta/recipes-core/meta/meta-environment-extsdk.bb @@ -5,8 +5,8 @@ require meta-environment.bb PN = "meta-environment-extsdk-${MACHINE}" create_sdk_files_append() { - local sysroot=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET', True), d.getVar('TOPDIR', True))} - local sdkpathnative=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE',True), d.getVar('TOPDIR', True))} + local sysroot=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${MACHINE} + local sdkpathnative=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${BUILD_ARCH} toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative } diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb index d9e045f041..da1230bead 100644 --- a/meta/recipes-core/meta/meta-environment.bb +++ b/meta/recipes-core/meta/meta-environment.bb @@ -1,6 +1,4 @@ SUMMARY = "Package of environment files for SDK" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" LICENSE = "MIT" PR = "r8" @@ -23,27 +21,28 @@ inherit cross-canadian do_generate_content[cleandirs] = "${SDK_OUTPUT}" do_generate_content[dirs] = "${SDK_OUTPUT}/${SDKPATH}" +# Need to ensure we have the virtual mappings and site files for all multtilib variants +do_generate_content[depends] = "${@oe.utils.build_depends_string(all_multilib_tune_values(d, 'TOOLCHAIN_NEED_CONFIGSITE_CACHE'), 'do_populate_sysroot')}" python do_generate_content() { # Handle multilibs in the SDK environment, siteconfig, etc files... localdata = bb.data.createCopy(d) # make sure we only use the WORKDIR value from 'd', or it can change - localdata.setVar('WORKDIR', d.getVar('WORKDIR', True)) + localdata.setVar('WORKDIR', d.getVar('WORKDIR')) # make sure we only use the SDKTARGETSYSROOT value from 'd' - localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True)) + localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT')) localdata.setVar('libdir', d.getVar('target_libdir', False)) # Process DEFAULTTUNE bb.build.exec_func("create_sdk_files", localdata) - variants = d.getVar("MULTILIB_VARIANTS", True) or "" + variants = d.getVar("MULTILIB_VARIANTS") or "" for item in variants.split(): # Load overrides from 'd' to avoid having to reset the value... overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item localdata.setVar("OVERRIDES", overrides) localdata.setVar("MLPREFIX", item + "-") - bb.data.update_data(localdata) bb.build.exec_func("create_sdk_files", localdata) } addtask generate_content before do_install after do_compile @@ -56,6 +55,8 @@ create_sdk_files() { # Add version information toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS} + + toolchain_create_post_relocate_script ${SDK_OUTPUT}/${SDKPATH}/post-relocate-setup.sh ${SDKPATH} } do_install() { @@ -69,9 +70,9 @@ FILES_${PN}= " \ ${SDKPATH}/* \ " -do_fetch[noexec] = "1" -do_unpack[noexec] = "1" -do_patch[noexec] = "1" -do_configure[noexec] = "1" -do_compile[noexec] = "1" -do_populate_sysroot[noexec] = "1" +deltask do_fetch +deltask do_unpack +deltask do_patch +deltask do_configure +deltask do_compile +deltask do_populate_sysroot diff --git a/meta/recipes-core/meta/meta-extsdk-toolchain.bb b/meta/recipes-core/meta/meta-extsdk-toolchain.bb index 886ff076dc..235d6ecc0f 100644 --- a/meta/recipes-core/meta/meta-extsdk-toolchain.bb +++ b/meta/recipes-core/meta/meta-extsdk-toolchain.bb @@ -1,10 +1,8 @@ SUMMARY = "Extensible SDK toolchain meta-recipe" DESCRIPTION = "Meta-recipe for ensuring the build directory contains all appropriate toolchain packages for using an IDE" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native" +DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native" do_populate_sysroot[deptask] = "do_populate_sysroot" @@ -12,16 +10,16 @@ do_populate_sysroot[deptask] = "do_populate_sysroot" # within sstate.bbclass, so if you copy or rename this and expect the same # functionality you'll need to modify that as well. -LOCKED_SIGS_INDIR = "${D}/locked-sigs" +LOCKED_SIGS_INDIR = "${WORKDIR}/locked-sigs" addtask do_locked_sigs after do_populate_sysroot SSTATETASKS += "do_locked_sigs" do_locked_sigs[sstate-inputdirs] = "${LOCKED_SIGS_INDIR}" -do_locked_sigs[sstate-outputdirs] = "${STAGING_DIR_HOST}/locked-sigs" +do_locked_sigs[sstate-outputdirs] = "${STAGING_DIR}/${PACKAGE_ARCH}/${PN}/locked-sigs" python do_locked_sigs() { import oe.copy_buildsystem - outdir = os.path.join(d.getVar('LOCKED_SIGS_INDIR', True)) + outdir = os.path.join(d.getVar('LOCKED_SIGS_INDIR')) bb.utils.mkdirhier(outdir) sigfile = os.path.join(outdir, 'locked-sigs-extsdk-toolchain.inc') oe.copy_buildsystem.generate_locked_sigs(sigfile, d) diff --git a/meta/recipes-core/meta/meta-go-toolchain.bb b/meta/recipes-core/meta/meta-go-toolchain.bb new file mode 100644 index 0000000000..dde385c1b1 --- /dev/null +++ b/meta/recipes-core/meta/meta-go-toolchain.bb @@ -0,0 +1,12 @@ +SUMMARY = "Meta package for building a installable Go toolchain" +LICENSE = "MIT" + +inherit populate_sdk + +TOOLCHAIN_HOST_TASK_append = " \ + packagegroup-go-cross-canadian-${MACHINE} \ +" + +TOOLCHAIN_TARGET_TASK_append = " \ + ${@multilib_pkg_extend(d, 'packagegroup-go-sdk-target')} \ +" diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb index c4ddcfcb43..768f6f4bb6 100644 --- a/meta/recipes-core/meta/meta-ide-support.bb +++ b/meta/recipes-core/meta/meta-ide-support.bb @@ -1,11 +1,10 @@ SUMMARY = "Integrated Development Environment support" DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native" +DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native cmake-native" PR = "r3" +RM_WORK_EXCLUDE += "${PN}" inherit meta toolchain-scripts nopackages diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb index ba9fd88805..b02b0665e6 100644 --- a/meta/recipes-core/meta/meta-toolchain.bb +++ b/meta/recipes-core/meta/meta-toolchain.bb @@ -3,7 +3,4 @@ LICENSE = "MIT" PR = "r7" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - inherit populate_sdk diff --git a/meta/recipes-core/meta/meta-world-pkgdata.bb b/meta/recipes-core/meta/meta-world-pkgdata.bb index 81c8647fa6..b299861375 100644 --- a/meta/recipes-core/meta/meta-world-pkgdata.bb +++ b/meta/recipes-core/meta/meta-world-pkgdata.bb @@ -3,6 +3,8 @@ LICENSE = "MIT" INHIBIT_DEFAULT_DEPS = "1" +PACKAGE_ARCH = "${MACHINE_ARCH}" + addtask do_allpackagedata before do_build do_allpackagedata() { : @@ -19,20 +21,20 @@ do_collect_packagedata[sstate-outputdirs] = "${STAGING_DIR_HOST}/world-pkgdata" python do_collect_packagedata() { import oe.copy_buildsystem - outdir = os.path.join(d.getVar('WORLD_PKGDATADIR', True)) + outdir = os.path.join(d.getVar('WORLD_PKGDATADIR')) bb.utils.mkdirhier(outdir) sigfile = os.path.join(outdir, 'locked-sigs-pkgdata.inc') oe.copy_buildsystem.generate_locked_sigs(sigfile, d) } -do_fetch[noexec] = "1" -do_unpack[noexec] = "1" -do_patch[noexec] = "1" -do_configure[noexec] = "1" -do_compile[noexec] = "1" -do_install[noexec] = "1" +deltask do_fetch +deltask do_unpack +deltask do_patch +deltask do_configure +deltask do_compile +deltask do_install -do_configure[deptask] = "" +do_prepare_recipe_sysroot[deptask] = "" WORLD_PKGDATA_EXCLUDE ?= "" diff --git a/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb index 2b96111600..5bc11b9daf 100644 --- a/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb +++ b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb @@ -1,27 +1,34 @@ -SUMMARY = "Dummy package which ensures perl is excluded from buildtools" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +DUMMYARCH = "buildtools-dummy-${SDKPKGSUFFIX}" -inherit allarch +DUMMYPROVIDES_PACKAGES = "\ + nativesdk-perl \ + nativesdk-libxml-parser-perl \ + nativesdk-perl-module-bytes \ + nativesdk-perl-module-carp \ + nativesdk-perl-module-constant \ + nativesdk-perl-module-data-dumper \ + nativesdk-perl-module-errno \ + nativesdk-perl-module-exporter \ + nativesdk-perl-module-file-basename \ + nativesdk-perl-module-file-compare \ + nativesdk-perl-module-file-copy \ + nativesdk-perl-module-file-find \ + nativesdk-perl-module-file-glob \ + nativesdk-perl-module-file-path \ + nativesdk-perl-module-file-stat \ + nativesdk-perl-module-getopt-long \ + nativesdk-perl-module-io-file \ + nativesdk-perl-module-posix \ + nativesdk-perl-module-thread-queue \ + nativesdk-perl-module-threads \ +" -PR = "r2" - -python() { - # Put the package somewhere separate to ensure it's never used except - # when we want it - # (note that we have to do this in anonymous python here to avoid - # allarch.bbclass disabling itself) - d.setVar('PACKAGE_ARCH', 'buildtools-dummy-${SDKPKGSUFFIX}') -} +DUMMYPROVIDES = "\ + /usr/bin/perl \ + " -PERLPACKAGES = "nativesdk-perl \ - nativesdk-perl-module-file-path" - -ALLOW_EMPTY_${PN} = "1" +PR = "r2" -python populate_packages_prepend() { - d.appendVar(d.expand('RPROVIDES_${PN}'), '${PERLPACKAGES}') - d.appendVar(d.expand('RCONFLICTS_${PN}'), '${PERLPACKAGES}') - d.appendVar(d.expand('RREPLACES_${PN}'), '${PERLPACKAGES}') -} +require dummy-sdk-package.inc +inherit nativesdk diff --git a/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb b/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb new file mode 100644 index 0000000000..29f4dd3633 --- /dev/null +++ b/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb @@ -0,0 +1,17 @@ +DUMMYARCH = "sdk-provides-dummy-${SDKPKGSUFFIX}" + +DUMMYPROVIDES_PACKAGES = "\ + pkgconfig \ +" + +# Add /bin/sh? +DUMMYPROVIDES = "\ + /bin/bash \ + /usr/bin/env \ + libGL.so()(64bit) \ + libGL.so \ +" + +require dummy-sdk-package.inc + +inherit nativesdk diff --git a/meta/recipes-core/meta/package-index.bb b/meta/recipes-core/meta/package-index.bb index 3c46b49977..a4123b7622 100644 --- a/meta/recipes-core/meta/package-index.bb +++ b/meta/recipes-core/meta/package-index.bb @@ -4,18 +4,15 @@ LICENSE = "MIT" INHIBIT_DEFAULT_DEPS = "1" PACKAGES = "" -do_fetch[noexec] = "1" -do_unpack[noexec] = "1" -do_patch[noexec] = "1" -do_configure[noexec] = "1" -do_compile[noexec] = "1" -do_install[noexec] = "1" -do_package[noexec] = "1" -do_packagedata[noexec] = "1" -do_package_write_ipk[noexec] = "1" -do_package_write_rpm[noexec] = "1" -do_package_write_deb[noexec] = "1" -do_populate_sysroot[noexec] = "1" +inherit nopackages + +deltask do_fetch +deltask do_unpack +deltask do_patch +deltask do_configure +deltask do_compile +deltask do_install +deltask do_populate_sysroot do_package_index[nostamp] = "1" do_package_index[depends] += "${PACKAGEINDEXDEPS}" diff --git a/meta/recipes-core/meta/signing-keys.bb b/meta/recipes-core/meta/signing-keys.bb index 37790373a1..1e1c7e3459 100644 --- a/meta/recipes-core/meta/signing-keys.bb +++ b/meta/recipes-core/meta/signing-keys.bb @@ -3,8 +3,6 @@ SUMMARY = "Makes public keys of the signing keys available" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" inherit allarch deploy @@ -23,53 +21,63 @@ FILES_${PN}-packagefeed = "${sysconfdir}/pki/packagefeed-gpg" python do_get_public_keys () { from oe.gpg_sign import get_signer - if d.getVar("RPM_SIGN_PACKAGES", True): + if d.getVar("RPM_SIGN_PACKAGES"): # Export public key of the rpm signing key - signer = get_signer(d, d.getVar('RPM_GPG_BACKEND', True)) + signer = get_signer(d, d.getVar('RPM_GPG_BACKEND')) signer.export_pubkey(os.path.join(d.expand('${B}'), 'rpm-key'), - d.getVar('RPM_GPG_NAME', True)) + d.getVar('RPM_GPG_NAME')) - if d.getVar("IPK_SIGN_PACKAGES", True): + if d.getVar("IPK_SIGN_PACKAGES"): # Export public key of the ipk signing key - signer = get_signer(d, d.getVar('IPK_GPG_BACKEND', True)) + signer = get_signer(d, d.getVar('IPK_GPG_BACKEND')) signer.export_pubkey(os.path.join(d.expand('${B}'), 'ipk-key'), - d.getVar('IPK_GPG_NAME', True)) + d.getVar('IPK_GPG_NAME')) - if d.getVar('PACKAGE_FEED_SIGN', True) == '1': + if d.getVar('PACKAGE_FEED_SIGN') == '1': # Export public key of the feed signing key - signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND', True)) + signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND')) signer.export_pubkey(os.path.join(d.expand('${B}'), 'pf-key'), - d.getVar('PACKAGE_FEED_GPG_NAME', True)) + d.getVar('PACKAGE_FEED_GPG_NAME')) } do_get_public_keys[cleandirs] = "${B}" addtask get_public_keys before do_install +do_get_public_keys[depends] += "gnupg-native:do_populate_sysroot" do_install () { if [ -f "${B}/rpm-key" ]; then - install -D -m 0644 "${B}/rpm-key" "${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO_VERSION}" + install -D -m 0644 "${B}/rpm-key" "${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}" fi if [ -f "${B}/ipk-key" ]; then - install -D -m 0644 "${B}/ipk-key" "${D}${sysconfdir}/pki/ipk-gpg/IPK-GPG-KEY-${DISTRO_VERSION}" + install -D -m 0644 "${B}/ipk-key" "${D}${sysconfdir}/pki/ipk-gpg/IPK-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}" fi if [ -f "${B}/pf-key" ]; then - install -D -m 0644 "${B}/pf-key" "${D}${sysconfdir}/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-${DISTRO_VERSION}" + install -D -m 0644 "${B}/pf-key" "${D}${sysconfdir}/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}" fi } do_deploy () { if [ -f "${B}/rpm-key" ]; then - install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO_VERSION}" + install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}" fi if [ -f "${B}/ipk-key" ]; then - install -D -m 0644 "${B}/ipk-key" "${DEPLOYDIR}/IPK-GPG-KEY-${DISTRO_VERSION}" + install -D -m 0644 "${B}/ipk-key" "${DEPLOYDIR}/IPK-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}" fi if [ -f "${B}/pf-key" ]; then - install -D -m 0644 "${B}/pf-key" "${DEPLOYDIR}/PACKAGEFEED-GPG-KEY-${DISTRO_VERSION}" + install -D -m 0644 "${B}/pf-key" "${DEPLOYDIR}/PACKAGEFEED-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}" fi } do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_RPM}" # cleandirs should possibly be in deploy.bbclass but we need it do_deploy[cleandirs] = "${DEPLOYDIR}" -# clear stamp-extra-info since MACHINE is normally put there by deploy.bbclass +# clear stamp-extra-info since MACHINE_ARCH is normally put there by +# deploy.bbclass do_deploy[stamp-extra-info] = "" addtask deploy after do_get_public_keys + +# Delete unnecessary tasks. In particular, "do_unpack" _must_ be deleted because +# it cleans ${B} and will wipe any keys exported by do_get_public_keys. +deltask do_fetch +deltask do_unpack +deltask do_patch +deltask do_configure +deltask do_compile diff --git a/meta/recipes-core/meta/target-sdk-provides-dummy.bb b/meta/recipes-core/meta/target-sdk-provides-dummy.bb new file mode 100644 index 0000000000..e3beeb796c --- /dev/null +++ b/meta/recipes-core/meta/target-sdk-provides-dummy.bb @@ -0,0 +1,61 @@ +DUMMYARCH = "sdk-provides-dummy-target" + +DUMMYPROVIDES_PACKAGES = "\ + busybox \ + busybox-dev \ + busybox-src \ + coreutils \ + coreutils-dev \ + coreutils-src \ + bash \ + bash-dev \ + bash-src \ + perl \ + perl-dev \ + perl-src \ + perl-module-re \ + perl-module-strict \ + perl-module-vars \ + perl-module-text-wrap \ + libxml-parser-perl \ + perl-module-bytes \ + perl-module-carp \ + perl-module-config \ + perl-module-constant \ + perl-module-data-dumper \ + perl-module-errno \ + perl-module-exporter \ + perl-module-file-basename \ + perl-module-file-compare \ + perl-module-file-copy \ + perl-module-file-find \ + perl-module-file-glob \ + perl-module-file-path \ + perl-module-file-stat \ + perl-module-file-temp \ + perl-module-getopt-long \ + perl-module-io-file \ + perl-module-overload \ + perl-module-overloading \ + perl-module-posix \ + perl-module-thread-queue \ + perl-module-threads \ + perl-module-warnings \ + perl-module-warnings-register \ + pkgconfig \ + pkgconfig-dev \ + pkgconfig-src \ +" + +DUMMYPROVIDES = "\ + /bin/sh \ + /bin/bash \ + /usr/bin/env \ + /usr/bin/perl \ + libperl.so.5 \ + libperl.so.5()(64bit) \ +" + +require dummy-sdk-package.inc + +SSTATE_DUPWHITELIST += "${PKGDATA_DIR}/${PN} ${PKGDATA_DIR}/runtime/${PN}" diff --git a/meta/recipes-core/meta/testexport-tarball.bb b/meta/recipes-core/meta/testexport-tarball.bb index d9861c4da7..c38ac902a0 100644 --- a/meta/recipes-core/meta/testexport-tarball.bb +++ b/meta/recipes-core/meta/testexport-tarball.bb @@ -3,8 +3,6 @@ DESCRIPTION = "SDK type target for standalone tarball containing packages define This recipe is almost the same as buildtools-tarball" SUMMARY = "Standalone tarball for test systems with missing software" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" TEST_EXPORT_SDK_PACKAGES ??= "" @@ -12,7 +10,13 @@ TOOLCHAIN_TARGET_TASK ?= "" TOOLCHAIN_HOST_TASK ?= "${TEST_EXPORT_SDK_PACKAGES}" -SDK_PACKAGE_ARCHS += "tesexport-tools-${SDKPKGSUFFIX}" +MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}" +PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}" +PACKAGE_ARCHS = "" +TARGET_ARCH = "none" +TARGET_OS = "none" + +SDK_PACKAGE_ARCHS += "testexport-tools-${SDKPKGSUFFIX}" TOOLCHAIN_OUTPUTNAME ?= "${TEST_EXPORT_SDK_NAME}" @@ -24,7 +28,15 @@ EXCLUDE_FROM_WORLD = "1" inherit meta inherit populate_sdk -inherit toolchain-scripts +inherit toolchain-scripts-base +inherit nopackages + +deltask install +deltask populate_sysroot + +do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}" + +REAL_MULTIMACH_TARGET_SYS = "none" create_sdk_files_append () { rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-* diff --git a/meta/recipes-core/meta/uninative-tarball.bb b/meta/recipes-core/meta/uninative-tarball.bb index e203a8322e..39638eb8c5 100644 --- a/meta/recipes-core/meta/uninative-tarball.bb +++ b/meta/recipes-core/meta/uninative-tarball.bb @@ -1,17 +1,23 @@ SUMMARY = "libc and patchelf tarball for use with uninative.bbclass" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" TOOLCHAIN_TARGET_TASK = "" # ibm850 - mcopy from mtools # iso8859-1 - guile +# utf-16, cp1252 - binutils-windres TOOLCHAIN_HOST_TASK = "\ nativesdk-glibc \ nativesdk-glibc-gconv-ibm850 \ nativesdk-glibc-gconv-iso8859-1 \ + nativesdk-glibc-gconv-utf-16 \ + nativesdk-glibc-gconv-cp1252 \ + nativesdk-glibc-gconv-euc-jp \ + nativesdk-glibc-gconv-libjis \ nativesdk-patchelf \ + nativesdk-libxcrypt \ + nativesdk-libxcrypt-compat \ + nativesdk-libnss-nis \ " INHIBIT_DEFAULT_DEPS = "1" @@ -33,8 +39,6 @@ inherit populate_sdk inherit nopackages deltask install -deltask package -deltask packagedata deltask populate_sysroot do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}" @@ -54,7 +58,7 @@ fakeroot create_sdk_files() { } -fakeroot tar_sdk() { +fakeroot archive_sdk() { cd ${SDK_OUTPUT}/${SDKPATH} DEST="./${SDK_ARCH}-${SDK_OS}" @@ -62,5 +66,5 @@ fakeroot tar_sdk() { rm sysroots -rf patchelf --set-interpreter ${@''.join('a' for n in range(1024))} $DEST/usr/bin/patchelf mv $DEST/usr/bin/patchelf $DEST/usr/bin/patchelf-uninative - tar ${SDKTAROPTS} -c -j --file=${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . + ${SDK_ARCHIVE_CMD} } diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb new file mode 100644 index 0000000000..09eb409e87 --- /dev/null +++ b/meta/recipes-core/meta/wic-tools.bb @@ -0,0 +1,26 @@ +SUMMARY = "A meta recipe to build native tools used by wic." + +LICENSE = "MIT" + +DEPENDS = "\ + parted-native syslinux-native gptfdisk-native dosfstools-native \ + mtools-native bmap-tools-native grub-efi-native cdrtools-native \ + btrfs-tools-native squashfs-tools-native pseudo-native \ + e2fsprogs-native util-linux-native \ + " +DEPENDS_append_x86 = " syslinux grub-efi systemd-boot" +DEPENDS_append_x86-64 = " syslinux grub-efi systemd-boot" +DEPENDS_append_x86-x32 = " syslinux grub-efi" + +INHIBIT_DEFAULT_DEPS = "1" + +inherit nopackages + +# The sysroot of wic-tools is needed for wic, but if rm_work is enabled, it will +# be removed before wic has a chance to use it, hence the exclusion below. +RM_WORK_EXCLUDE += "${PN}" + +python do_build_sysroot () { + bb.build.exec_func("extend_recipe_sysroot", d) +} +addtask do_build_sysroot after do_prepare_recipe_sysroot before do_build |