summaryrefslogtreecommitdiff
path: root/poky/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/classes')
-rw-r--r--poky/meta/classes/image.bbclass5
-rw-r--r--poky/meta/classes/image_types_wic.bbclass8
-rw-r--r--poky/meta/classes/meson.bbclass3
-rw-r--r--poky/meta/classes/package.bbclass100
-rw-r--r--poky/meta/classes/populate_sdk_base.bbclass5
-rw-r--r--poky/meta/classes/pypi.bbclass4
-rw-r--r--poky/meta/classes/qemuboot.bbclass6
-rw-r--r--poky/meta/classes/sanity.bbclass6
-rw-r--r--poky/meta/classes/sstate.bbclass15
-rw-r--r--poky/meta/classes/staging.bbclass1
-rw-r--r--poky/meta/classes/testimage.bbclass17
-rw-r--r--poky/meta/classes/utils.bbclass19
12 files changed, 48 insertions, 141 deletions
diff --git a/poky/meta/classes/image.bbclass b/poky/meta/classes/image.bbclass
index 694b58fc9f..07aa1f1fa5 100644
--- a/poky/meta/classes/image.bbclass
+++ b/poky/meta/classes/image.bbclass
@@ -62,7 +62,10 @@ def check_image_features(d):
valid_features = (d.getVarFlag('IMAGE_FEATURES', 'validitems') or "").split()
valid_features += d.getVarFlags('COMPLEMENTARY_GLOB').keys()
for var in d:
- if var.startswith("FEATURE_PACKAGES_"):
+ if var.startswith("PACKAGE_GROUP_"):
+ bb.warn("PACKAGE_GROUP is deprecated, please use FEATURE_PACKAGES instead")
+ valid_features.append(var[14:])
+ elif var.startswith("FEATURE_PACKAGES_"):
valid_features.append(var[17:])
valid_features.sort()
diff --git a/poky/meta/classes/image_types_wic.bbclass b/poky/meta/classes/image_types_wic.bbclass
index 96ed0473ee..b83308b45c 100644
--- a/poky/meta/classes/image_types_wic.bbclass
+++ b/poky/meta/classes/image_types_wic.bbclass
@@ -32,7 +32,8 @@ IMAGE_CMD_wic () {
if [ -z "$wks" ]; then
bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
fi
- BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS}
+
+ BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS}
mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
}
IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"
@@ -85,10 +86,6 @@ python do_write_wks_template () {
bb.utils.copyfile(wks_file, "%s/%s" % (depdir, basename + '-' + os.path.basename(wks_file)))
}
-do_flush_pseudodb() {
- ${FAKEROOTENV} ${FAKEROOTCMD} -S
-}
-
python () {
if d.getVar('USING_WIC'):
wks_file_u = d.getVar('WKS_FULL_PATH', False)
@@ -142,7 +139,6 @@ 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_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/meson.bbclass b/poky/meta/classes/meson.bbclass
index 06034e8b47..e9628033c6 100644
--- a/poky/meta/classes/meson.bbclass
+++ b/poky/meta/classes/meson.bbclass
@@ -164,7 +164,8 @@ meson_do_configure_prepend_class-native() {
python meson_do_qa_configure() {
import re
warn_re = re.compile(r"^WARNING: Cross property (.+) is using default value (.+)$", re.MULTILINE)
- log = open(d.expand("${B}/meson-logs/meson-log.txt")).read()
+ with open(d.expand("${B}/meson-logs/meson-log.txt")) as logfile:
+ log = logfile.read()
for (prop, value) in warn_re.findall(log):
bb.warn("Meson cross property %s used without explicit assignment, defaulting to %s" % (prop, value))
}
diff --git a/poky/meta/classes/package.bbclass b/poky/meta/classes/package.bbclass
index 0b5cf47749..d4c6a90e84 100644
--- a/poky/meta/classes/package.bbclass
+++ b/poky/meta/classes/package.bbclass
@@ -245,8 +245,6 @@ python () {
deps = ""
for dep in (d.getVar('PACKAGE_DEPENDS') or "").split():
deps += " %s:do_populate_sysroot" % dep
- if d.getVar('PACKAGE_MINIDEBUGINFO') == '1':
- deps += ' xz-native:do_populate_sysroot'
d.appendVarFlag('do_package', 'depends', deps)
# shlibs requires any DEPENDS to have already packaged for the *.list files
@@ -461,83 +459,6 @@ def splitstaticdebuginfo(file, dvar, debugstaticdir, debugstaticlibdir, debugsta
return (file, sources)
-def inject_minidebuginfo(file, dvar, debugdir, debuglibdir, debugappend, debugsrcdir, d):
- # Extract just the symbols from debuginfo into minidebuginfo,
- # compress it with xz and inject it back into the binary in a .gnu_debugdata section.
- # https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
-
- import subprocess
-
- readelf = d.getVar('READELF')
- nm = d.getVar('NM')
- objcopy = d.getVar('OBJCOPY')
-
- minidebuginfodir = d.expand('${WORKDIR}/minidebuginfo')
-
- src = file[len(dvar):]
- dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
- debugfile = dvar + dest
- minidebugfile = minidebuginfodir + src + '.minidebug'
- bb.utils.mkdirhier(os.path.dirname(minidebugfile))
-
- # If we didn't produce debuginfo for any reason, we can't produce minidebuginfo either
- # so skip it.
- if not os.path.exists(debugfile):
- bb.debug(1, 'ELF file {} has no debuginfo, skipping minidebuginfo injection'.format(file))
- return
-
- # Find non-allocated PROGBITS, NOTE, and NOBITS sections in the debuginfo.
- # We will exclude all of these from minidebuginfo to save space.
- remove_section_names = []
- for line in subprocess.check_output([readelf, '-W', '-S', debugfile], universal_newlines=True).splitlines():
- fields = line.split()
- if len(fields) < 8:
- continue
- name = fields[0]
- type = fields[1]
- flags = fields[7]
- # .debug_ sections will be removed by objcopy -S so no need to explicitly remove them
- if name.startswith('.debug_'):
- continue
- if 'A' not in flags and type in ['PROGBITS', 'NOTE', 'NOBITS']:
- remove_section_names.append(name)
-
- # List dynamic symbols in the binary. We can exclude these from minidebuginfo
- # because they are always present in the binary.
- dynsyms = set()
- for line in subprocess.check_output([nm, '-D', file, '--format=posix', '--defined-only'], universal_newlines=True).splitlines():
- dynsyms.add(line.split()[0])
-
- # Find all function symbols from debuginfo which aren't in the dynamic symbols table.
- # These are the ones we want to keep in minidebuginfo.
- keep_symbols_file = minidebugfile + '.symlist'
- found_any_symbols = False
- with open(keep_symbols_file, 'w') as f:
- for line in subprocess.check_output([nm, debugfile, '--format=sysv', '--defined-only'], universal_newlines=True).splitlines():
- fields = line.split('|')
- if len(fields) < 7:
- continue
- name = fields[0].strip()
- type = fields[3].strip()
- if type == 'FUNC' and name not in dynsyms:
- f.write('{}\n'.format(name))
- found_any_symbols = True
-
- if not found_any_symbols:
- bb.debug(1, 'ELF file {} contains no symbols, skipping minidebuginfo injection'.format(file))
- return
-
- bb.utils.remove(minidebugfile)
- bb.utils.remove(minidebugfile + '.xz')
-
- subprocess.check_call([objcopy, '-S'] +
- ['--remove-section={}'.format(s) for s in remove_section_names] +
- ['--keep-symbols={}'.format(keep_symbols_file), debugfile, minidebugfile])
-
- subprocess.check_call(['xz', '--keep', minidebugfile])
-
- subprocess.check_call([objcopy, '--add-section', '.gnu_debugdata={}.xz'.format(minidebugfile), file])
-
def copydebugsources(debugsrcdir, sources, d):
# The debug src information written out to sourcefile is further processed
# and copied to the destination here.
@@ -614,7 +535,7 @@ def copydebugsources(debugsrcdir, sources, d):
# Package data handling routines
#
-def get_package_mapping (pkg, basepkg, d, depversions=None):
+def get_package_mapping (pkg, basepkg, d):
import oe.packagedata
data = oe.packagedata.read_subpkgdata(pkg, d)
@@ -625,14 +546,6 @@ def get_package_mapping (pkg, basepkg, d, depversions=None):
if bb.data.inherits_class('allarch', d) and not d.getVar('MULTILIB_VARIANTS') \
and data[key] == basepkg:
return pkg
- if depversions == []:
- # Avoid returning a mapping if the renamed package rprovides its original name
- rprovkey = "RPROVIDES_%s" % pkg
- if rprovkey in data:
- if pkg in bb.utils.explode_dep_versions2(data[rprovkey]):
- bb.note("%s rprovides %s, not replacing the latter" % (data[key], pkg))
- return pkg
- # Do map to rewritten package name
return data[key]
return pkg
@@ -653,10 +566,8 @@ def runtime_mapping_rename (varname, pkg, d):
new_depends = {}
deps = bb.utils.explode_dep_versions2(d.getVar(varname) or "")
- for depend, depversions in deps.items():
- new_depend = get_package_mapping(depend, pkg, d, depversions)
- if depend != new_depend:
- bb.note("package name mapping done: %s -> %s" % (depend, new_depend))
+ for depend in deps:
+ new_depend = get_package_mapping(depend, pkg, d)
new_depends[new_depend] = deps[depend]
d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False))
@@ -1274,11 +1185,6 @@ python split_and_strip_files () {
oe.utils.multiprocess_launch(oe.package.runstrip, sfiles, d)
- # Build "minidebuginfo" and reinject it back into the stripped binaries
- if d.getVar('PACKAGE_MINIDEBUGINFO') == '1':
- oe.utils.multiprocess_launch(inject_minidebuginfo, list(elffiles), d,
- extraargs=(dvar, debugdir, debuglibdir, debugappend, debugsrcdir, d))
-
#
# End of strip
#
diff --git a/poky/meta/classes/populate_sdk_base.bbclass b/poky/meta/classes/populate_sdk_base.bbclass
index f85c3b9f62..ef0d8bef58 100644
--- a/poky/meta/classes/populate_sdk_base.bbclass
+++ b/poky/meta/classes/populate_sdk_base.bbclass
@@ -185,11 +185,6 @@ fakeroot create_sdk_files() {
# Escape special characters like '+' and '.' in the SDKPATH
escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
-
- mkdir -p ${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/
- echo '${SDKPATHNATIVE}${libdir_nativesdk}
-${SDKPATHNATIVE}${base_libdir_nativesdk}
-include /etc/ld.so.conf' > ${SDK_OUTPUT}/${SDKPATHNATIVE}${sysconfdir}/ld.so.conf
}
python check_sdk_sysroots() {
diff --git a/poky/meta/classes/pypi.bbclass b/poky/meta/classes/pypi.bbclass
index e5d7ab3ce1..87b4c85fc0 100644
--- a/poky/meta/classes/pypi.bbclass
+++ b/poky/meta/classes/pypi.bbclass
@@ -22,5 +22,5 @@ SECTION = "devel/python"
SRC_URI += "${PYPI_SRC_URI}"
S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
-UPSTREAM_CHECK_URI ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
-UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)"
+UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${PYPI_PACKAGE}/"
+UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)/"
diff --git a/poky/meta/classes/qemuboot.bbclass b/poky/meta/classes/qemuboot.bbclass
index 3162e7a8eb..54044c38da 100644
--- a/poky/meta/classes/qemuboot.bbclass
+++ b/poky/meta/classes/qemuboot.bbclass
@@ -65,10 +65,6 @@
# " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
# Note, runqemu will replace "@PORT@" with the port number which is used.
#
-# QB_ROOTFS_EXTRA_OPT: extra options to be appended to the rootfs device in case there is none specified by QB_ROOTFS_OPT.
-# Can be used to automatically determine the image from the other variables
-# but define things link 'bootindex' when booting from EFI or 'readonly' when using squashfs
-# without the need to specify a dedicated qemu configuration
# Usage:
# IMAGE_CLASSES += "qemuboot"
# See "runqemu help" for more info
@@ -81,13 +77,13 @@ QB_OPT_APPEND ?= "-show-cursor"
QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@"
QB_CMDLINE_IP_SLIRP ?= "ip=dhcp"
QB_CMDLINE_IP_TAP ?= "ip=192.168.7.@CLIENT@::192.168.7.@GATEWAY@:255.255.255.0"
-QB_ROOTFS_EXTRA_OPT ?= ""
# This should be kept align with ROOT_VM
QB_DRIVE_TYPE ?= "/dev/sd"
# Create qemuboot.conf
addtask do_write_qemuboot_conf after do_rootfs before do_image
+IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete"
def qemuboot_vars(d):
build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
diff --git a/poky/meta/classes/sanity.bbclass b/poky/meta/classes/sanity.bbclass
index 292c5591dd..9e87101738 100644
--- a/poky/meta/classes/sanity.bbclass
+++ b/poky/meta/classes/sanity.bbclass
@@ -527,7 +527,7 @@ def check_wsl(d):
bb.warn("You are running bitbake under WSLv2, this works properly but you should optimize your VHDX file eventually to avoid running out of storage space")
return None
-# Require at least gcc version 6.0.
+# Require at least gcc version 5.0.
#
# This can be fixed on CentOS-7 with devtoolset-6+
# https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/
@@ -541,8 +541,8 @@ def check_gcc_version(sanity_data):
build_cc, version = oe.utils.get_host_compiler_version(sanity_data)
if build_cc.strip() == "gcc":
- if LooseVersion(version) < LooseVersion("6.0"):
- return "Your version of gcc is older than 6.0 and will break builds. Please install a newer version of gcc (you could use the project's buildtools-extended-tarball or use scripts/install-buildtools).\n"
+ if LooseVersion(version) < LooseVersion("5.0"):
+ return "Your version of gcc is older than 5.0 and will break builds. Please install a newer version of gcc (you could use the project's buildtools-extended-tarball or use scripts/install-buildtools).\n"
return None
# Tar version 1.24 and onwards handle overwriting symlinks correctly
diff --git a/poky/meta/classes/sstate.bbclass b/poky/meta/classes/sstate.bbclass
index c73c3b42a7..aa9c30b4e1 100644
--- a/poky/meta/classes/sstate.bbclass
+++ b/poky/meta/classes/sstate.bbclass
@@ -690,7 +690,10 @@ def sstate_package(ss, d):
if not os.path.exists(siginfo):
bb.siggen.dump_this_task(siginfo, d)
else:
- os.utime(siginfo, None)
+ try:
+ os.utime(siginfo, None)
+ except PermissionError:
+ pass
return
@@ -776,7 +779,7 @@ sstate_task_postfunc[dirs] = "${WORKDIR}"
sstate_create_package () {
# Exit early if it already exists
if [ -e ${SSTATE_PKG} ]; then
- touch ${SSTATE_PKG}
+ [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG}
return
fi
@@ -810,7 +813,7 @@ sstate_create_package () {
else
rm $TFILE
fi
- touch ${SSTATE_PKG}
+ [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG}
}
python sstate_sign_package () {
@@ -1122,7 +1125,11 @@ python sstate_eventhandler() {
if not os.path.exists(siginfo):
bb.siggen.dump_this_task(siginfo, d)
else:
- os.utime(siginfo, None)
+ try:
+ os.utime(siginfo, None)
+ except PermissionError:
+ pass
+
}
SSTATE_PRUNE_OBSOLETEWORKDIR ?= "1"
diff --git a/poky/meta/classes/staging.bbclass b/poky/meta/classes/staging.bbclass
index de3a19815a..5b04f88b2d 100644
--- a/poky/meta/classes/staging.bbclass
+++ b/poky/meta/classes/staging.bbclass
@@ -93,7 +93,6 @@ SYSROOT_PREPROCESS_FUNCS ?= ""
SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir"
python do_populate_sysroot () {
- # SYSROOT 'version' 2
bb.build.exec_func("sysroot_stage_all", d)
bb.build.exec_func("sysroot_strip", d)
for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS') or '').split():
diff --git a/poky/meta/classes/testimage.bbclass b/poky/meta/classes/testimage.bbclass
index 00f0c29836..deb81bc256 100644
--- a/poky/meta/classes/testimage.bbclass
+++ b/poky/meta/classes/testimage.bbclass
@@ -31,7 +31,6 @@ TESTIMAGE_AUTO ??= "0"
# TEST_LOG_DIR contains a command ssh log and may contain infromation about what command is running, output and return codes and for qemu a boot log till login.
# Booting is handled by this class, and it's not a test in itself.
# TEST_QEMUBOOT_TIMEOUT can be used to set the maximum time in seconds the launch code will wait for the login prompt.
-# TEST_OVERALL_TIMEOUT can be used to set the maximum time in seconds the tests will be allowed to run (defaults to no limit).
# TEST_QEMUPARAMS can be used to pass extra parameters to qemu, e.g. "-m 1024" for setting the amount of ram to 1 GB.
# TEST_RUNQEMUPARAMS can be used to pass extra parameters to runqemu, e.g. "gl" to enable OpenGL acceleration.
@@ -76,7 +75,6 @@ DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"
TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
TEST_QEMUBOOT_TIMEOUT ?= "1000"
-TEST_OVERALL_TIMEOUT ?= ""
TEST_TARGET ?= "qemu"
TEST_QEMUPARAMS ?= ""
TEST_RUNQEMUPARAMS ?= ""
@@ -208,10 +206,6 @@ def testimage_main(d):
"""
os.kill(os.getpid(), signal.SIGINT)
- def handle_test_timeout(timeout):
- bb.warn("Global test timeout reached (%s seconds), stopping the tests." %(timeout))
- os.kill(os.getpid(), signal.SIGINT)
-
testimage_sanity(d)
if (d.getVar('IMAGE_PKGTYPE') == 'rpm'
@@ -281,14 +275,11 @@ def testimage_main(d):
# Get use_kvm
kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
- # Get OVMF
- ovmf = d.getVar("QEMU_USE_OVMF")
-
slirp = False
if d.getVar("QEMU_USE_SLIRP"):
slirp = True
- # TODO: We use the current implementation of qemu runner because of
+ # TODO: We use the current implementatin of qemu runner because of
# time constrains, qemu runner really needs a refactor too.
target_kwargs = { 'machine' : machine,
'rootfs' : rootfs,
@@ -302,7 +293,6 @@ def testimage_main(d):
'slirp' : slirp,
'dump_dir' : d.getVar("TESTIMAGE_DUMP_DIR"),
'serial_ports': len(d.getVar("SERIAL_CONSOLES").split()),
- 'ovmf' : ovmf,
}
if d.getVar("TESTIMAGE_BOOT_PATTERNS"):
@@ -369,11 +359,6 @@ def testimage_main(d):
# We need to check if runqemu ends unexpectedly
# or if the worker send us a SIGTERM
tc.target.start(params=d.getVar("TEST_QEMUPARAMS"), runqemuparams=d.getVar("TEST_RUNQEMUPARAMS"))
- import threading
- try:
- threading.Timer(int(d.getVar("TEST_OVERALL_TIMEOUT")), handle_test_timeout, (int(d.getVar("TEST_OVERALL_TIMEOUT")),)).start()
- except ValueError:
- pass
results = tc.runTests()
except (KeyboardInterrupt, BlockingIOError) as err:
if isinstance(err, KeyboardInterrupt):
diff --git a/poky/meta/classes/utils.bbclass b/poky/meta/classes/utils.bbclass
index 120bcc64a6..cd3d05709e 100644
--- a/poky/meta/classes/utils.bbclass
+++ b/poky/meta/classes/utils.bbclass
@@ -1,3 +1,22 @@
+def machine_paths(d):
+ """List any existing machine specific filespath directories"""
+ machine = d.getVar("MACHINE")
+ filespathpkg = d.getVar("FILESPATHPKG").split(":")
+ for basepath in d.getVar("FILESPATHBASE").split(":"):
+ for pkgpath in filespathpkg:
+ machinepath = os.path.join(basepath, pkgpath, machine)
+ if os.path.isdir(machinepath):
+ yield machinepath
+
+def is_machine_specific(d):
+ """Determine whether the current recipe is machine specific"""
+ machinepaths = set(machine_paths(d))
+ srcuri = d.getVar("SRC_URI").split()
+ for url in srcuri:
+ fetcher = bb.fetch2.Fetch([srcuri], d)
+ if url.startswith("file://"):
+ if any(fetcher.localpath(url).startswith(mp + "/") for mp in machinepaths):
+ return True
oe_soinstall() {
# Purpose: Install shared library file and