summaryrefslogtreecommitdiffstats
path: root/poky/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/classes')
-rw-r--r--poky/meta/classes/gio-module-cache.bbclass1
-rw-r--r--poky/meta/classes/insane.bbclass4
-rw-r--r--poky/meta/classes/mirrors.bbclass1
-rw-r--r--poky/meta/classes/rootfs-postcommands.bbclass5
-rw-r--r--poky/meta/classes/sanity.bbclass67
-rw-r--r--poky/meta/classes/staging.bbclass25
-rw-r--r--poky/meta/classes/testimage.bbclass21
-rw-r--r--poky/meta/classes/utils.bbclass2
8 files changed, 71 insertions, 55 deletions
diff --git a/poky/meta/classes/gio-module-cache.bbclass b/poky/meta/classes/gio-module-cache.bbclass
index e429bd319..0520c2257 100644
--- a/poky/meta/classes/gio-module-cache.bbclass
+++ b/poky/meta/classes/gio-module-cache.bbclass
@@ -2,6 +2,7 @@ PACKAGE_WRITE_DEPS += "qemu-native"
inherit qemu
GIO_MODULE_PACKAGES ??= "${PN}"
+GIO_MODULE_PACKAGES_class-nativesdk = ""
gio_module_cache_common() {
if [ "x$D" != "x" ]; then
diff --git a/poky/meta/classes/insane.bbclass b/poky/meta/classes/insane.bbclass
index fa1546084..eb2d96711 100644
--- a/poky/meta/classes/insane.bbclass
+++ b/poky/meta/classes/insane.bbclass
@@ -534,9 +534,9 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1:
return
- tmpdir = d.getVar('TMPDIR')
+ tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8")
with open(path, 'rb') as f:
- file_content = f.read().decode('utf-8', errors='ignore')
+ file_content = f.read()
if tmpdir in file_content:
package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d))
diff --git a/poky/meta/classes/mirrors.bbclass b/poky/meta/classes/mirrors.bbclass
index b331afc5d..ed53dfbca 100644
--- a/poky/meta/classes/mirrors.bbclass
+++ b/poky/meta/classes/mirrors.bbclass
@@ -1,4 +1,5 @@
MIRRORS += "\
+${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian/20180310T215105Z/pool \n \
${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20120328T092752Z/debian/pool \n \
${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20110127T084257Z/debian/pool \n \
${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20090802T004153Z/debian/pool \n \
diff --git a/poky/meta/classes/rootfs-postcommands.bbclass b/poky/meta/classes/rootfs-postcommands.bbclass
index 552220953..221869e04 100644
--- a/poky/meta/classes/rootfs-postcommands.bbclass
+++ b/poky/meta/classes/rootfs-postcommands.bbclass
@@ -112,14 +112,11 @@ read_only_rootfs_hook () {
# Also tweak the key location for dropbear in the same way.
if [ -d ${IMAGE_ROOTFS}/etc/dropbear ]; then
- if [ -e ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ]; then
- echo "DROPBEAR_RSAKEY_DIR=/etc/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
- else
+ if [ ! -e ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ]; then
echo "DROPBEAR_RSAKEY_DIR=/var/lib/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
fi
fi
-
if ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then
# Change the value of ROOTFS_READ_ONLY in /etc/default/rcS to yes
if [ -e ${IMAGE_ROOTFS}/etc/default/rcS ]; then
diff --git a/poky/meta/classes/sanity.bbclass b/poky/meta/classes/sanity.bbclass
index e0e57ceec..4e8eae894 100644
--- a/poky/meta/classes/sanity.bbclass
+++ b/poky/meta/classes/sanity.bbclass
@@ -336,11 +336,11 @@ def check_path_length(filepath, pathname, limit):
return ""
def get_filesystem_id(path):
- status, result = oe.utils.getstatusoutput("stat -f -c '%s' '%s'" % ("%t", path))
- if status == 0:
- return result
- else:
- bb.warn("Can't get the filesystem id of: %s" % path)
+ import subprocess
+ try:
+ return subprocess.check_output(["stat", "-f", "-c", "%t", path]).decode('utf-8')
+ except subprocess.CalledProcessError:
+ bb.warn("Can't get filesystem id of: %s" % path)
return None
# Check that the path isn't located on nfs.
@@ -463,7 +463,7 @@ def check_patch_version(sanity_data):
import re, subprocess
try:
- result = subprocess.check_output(["patch", "--version"], stderr=subprocess.STDOUT, universal_newlines=True)
+ result = subprocess.check_output(["patch", "--version"], stderr=subprocess.STDOUT).decode('utf-8')
version = re.search(r"[0-9.]+", result.splitlines()[0]).group()
if LooseVersion(version) < LooseVersion("2.7"):
return "Your version of patch is older than 2.7 and has bugs which will break builds. Please install a newer version of patch.\n"
@@ -476,9 +476,12 @@ def check_patch_version(sanity_data):
# Use a modified reproducer from http://savannah.gnu.org/bugs/?30612 to validate.
def check_make_version(sanity_data):
from distutils.version import LooseVersion
- status, result = oe.utils.getstatusoutput("make --version")
- if status != 0:
- return "Unable to execute make --version, exit code %d\n" % status
+ import subprocess
+
+ try:
+ result = subprocess.check_output(['make', '--version'], stderr=subprocess.STDOUT).decode('utf-8')
+ except subprocess.CalledProcessError as e:
+ return "Unable to execute make --version, exit code %d\n%s\n" % (e.returncode, e.output)
version = result.split()[2]
if LooseVersion(version) == LooseVersion("3.82"):
# Construct a test file
@@ -493,18 +496,18 @@ def check_make_version(sanity_data):
f.close()
# Check if make 3.82 has been patched
- status,result = oe.utils.getstatusoutput("make -f makefile_test")
-
- os.remove("makefile_test")
- if os.path.exists("makefile_test_a.c"):
- os.remove("makefile_test_a.c")
- if os.path.exists("makefile_test_b.c"):
- os.remove("makefile_test_b.c")
- if os.path.exists("makefile_test.a"):
- os.remove("makefile_test.a")
-
- if status != 0:
+ try:
+ subprocess.check_call(['make', '-f', 'makefile_test'])
+ except subprocess.CalledProcessError as e:
return "Your version of make 3.82 is broken. Please revert to 3.81 or install a patched version.\n"
+ finally:
+ os.remove("makefile_test")
+ if os.path.exists("makefile_test_a.c"):
+ os.remove("makefile_test_a.c")
+ if os.path.exists("makefile_test_b.c"):
+ os.remove("makefile_test_b.c")
+ if os.path.exists("makefile_test.a"):
+ os.remove("makefile_test.a")
return None
@@ -512,9 +515,11 @@ def check_make_version(sanity_data):
# but earlier versions do not; this needs to work properly for sstate
def check_tar_version(sanity_data):
from distutils.version import LooseVersion
- status, result = oe.utils.getstatusoutput("tar --version")
- if status != 0:
- return "Unable to execute tar --version, exit code %d\n" % status
+ import subprocess
+ try:
+ result = subprocess.check_output(["tar", "--version"], stderr=subprocess.STDOUT).decode('utf-8')
+ except subprocess.CalledProcessError as e:
+ return "Unable to execute tar --version, exit code %d\n%s\n" % (e.returncode, e.output)
version = result.split()[3]
if LooseVersion(version) < LooseVersion("1.24"):
return "Your version of tar is older than 1.24 and has bugs which will break builds. Please install a newer version of tar.\n"
@@ -525,9 +530,11 @@ def check_tar_version(sanity_data):
# The git fetcher also had workarounds for git < 1.7.9.2 which we've dropped
def check_git_version(sanity_data):
from distutils.version import LooseVersion
- status, result = oe.utils.getstatusoutput("git --version 2> /dev/null")
- if status != 0:
- return "Unable to execute git --version, exit code %d\n" % status
+ import subprocess
+ try:
+ result = subprocess.check_output(["git", "--version"], stderr=subprocess.DEVNULL).decode('utf-8')
+ except subprocess.CalledProcessError as e:
+ return "Unable to execute git --version, exit code %d\n%s\n" % (e.returncode, e.output)
version = result.split()[2]
if LooseVersion(version) < LooseVersion("1.8.3.1"):
return "Your version of git is older than 1.8.3.1 and has bugs which will break builds. Please install a newer version of git.\n"
@@ -535,13 +542,15 @@ def check_git_version(sanity_data):
# Check the required perl modules which may not be installed by default
def check_perl_modules(sanity_data):
+ import subprocess
ret = ""
modules = ( "Text::ParseWords", "Thread::Queue", "Data::Dumper" )
errresult = ''
for m in modules:
- status, result = oe.utils.getstatusoutput("perl -e 'use %s'" % m)
- if status != 0:
- errresult += result
+ try:
+ subprocess.check_output(["perl", "-e", "use %s" % m])
+ except subprocess.CalledProcessError as e:
+ errresult += e.output
ret += "%s " % m
if ret:
return "Required perl module(s) not found: %s\n\n%s\n" % (ret, errresult)
diff --git a/poky/meta/classes/staging.bbclass b/poky/meta/classes/staging.bbclass
index 3fcbc9f15..939042eb4 100644
--- a/poky/meta/classes/staging.bbclass
+++ b/poky/meta/classes/staging.bbclass
@@ -383,8 +383,6 @@ python extend_recipe_sysroot() {
lock = bb.utils.lockfile(recipesysroot + "/sysroot.lock")
fixme = {}
- fixme[''] = []
- fixme['native'] = []
seendirs = set()
postinsts = []
multilibs = {}
@@ -471,7 +469,14 @@ python extend_recipe_sysroot() {
os.symlink(c + "." + taskhash, depdir + "/" + c)
manifest, d2 = oe.sstatesig.find_sstate_manifest(c, setscenedeps[dep][2], "populate_sysroot", d, multilibs)
+ if d2 is not d:
+ # If we don't do this, the recipe sysroot will be placed in the wrong WORKDIR for multilibs
+ # We need a consistent WORKDIR for the image
+ d2.setVar("WORKDIR", d.getVar("WORKDIR"))
destsysroot = d2.getVar("RECIPE_SYSROOT")
+ # We put allarch recipes into the default sysroot
+ if manifest and "allarch" in manifest:
+ destsysroot = d.getVar("RECIPE_SYSROOT")
native = False
if c.endswith("-native") or "-cross-" in c or "-crosssdk" in c:
@@ -479,12 +484,13 @@ python extend_recipe_sysroot() {
if manifest:
newmanifest = collections.OrderedDict()
+ targetdir = destsysroot
if native:
- fm = fixme['native']
targetdir = recipesysrootnative
- else:
- fm = fixme['']
- targetdir = destsysroot
+ if targetdir not in fixme:
+ fixme[targetdir] = []
+ fm = fixme[targetdir]
+
with open(manifest, "r") as f:
manifests[dep] = manifest
for l in f:
@@ -542,12 +548,7 @@ python extend_recipe_sysroot() {
bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists))
for f in fixme:
- if f == '':
- staging_processfixme(fixme[f], recipesysroot, recipesysroot, recipesysrootnative, d)
- elif f == 'native':
- staging_processfixme(fixme[f], recipesysrootnative, recipesysroot, recipesysrootnative, d)
- else:
- staging_processfixme(fixme[f], multilibs[f].getVar("RECIPE_SYSROOT"), recipesysroot, recipesysrootnative, d)
+ staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d)
for p in postinsts:
subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
diff --git a/poky/meta/classes/testimage.bbclass b/poky/meta/classes/testimage.bbclass
index 77291c22c..9feb26770 100644
--- a/poky/meta/classes/testimage.bbclass
+++ b/poky/meta/classes/testimage.bbclass
@@ -117,13 +117,6 @@ testimage_dump_host () {
}
python do_testimage() {
-
- testimage_sanity(d)
-
- if (d.getVar('IMAGE_PKGTYPE') == 'rpm'
- and 'dnf' in d.getVar('TEST_SUITES')):
- create_rpm_index(d)
-
testimage_main(d)
}
@@ -159,6 +152,12 @@ def testimage_main(d):
"""
raise RuntimeError
+ testimage_sanity(d)
+
+ if (d.getVar('IMAGE_PKGTYPE') == 'rpm'
+ and ('dnf' in d.getVar('TEST_SUITES') or 'auto' in d.getVar('TEST_SUITES'))):
+ create_rpm_index(d)
+
logger = make_logger_bitbake_compatible(logging.getLogger("BitBake"))
pn = d.getVar("PN")
@@ -260,10 +259,16 @@ def testimage_main(d):
# Load tests before starting the target
test_paths = get_runtime_paths(d)
test_modules = d.getVar('TEST_SUITES').split()
+ if not test_modules:
+ bb.fatal('Empty test suite, please verify TEST_SUITES variable')
+
tc.loadTests(test_paths, modules=test_modules)
- if not getSuiteCases(tc.suites):
+ suitecases = getSuiteCases(tc.suites)
+ if not suitecases:
bb.fatal('Empty test suite, please verify TEST_SUITES variable')
+ else:
+ bb.debug(2, 'test suites:\n\t%s' % '\n\t'.join([str(c) for c in suitecases]))
package_extraction(d, tc.suites)
diff --git a/poky/meta/classes/utils.bbclass b/poky/meta/classes/utils.bbclass
index 4f016e3d0..3f4f51b56 100644
--- a/poky/meta/classes/utils.bbclass
+++ b/poky/meta/classes/utils.bbclass
@@ -338,6 +338,8 @@ def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = '
variants = d.getVar("MULTILIB_VARIANTS") or ""
for item in variants.split():
localdata = get_multilib_datastore(item, d)
+ # We need WORKDIR to be consistent with the original datastore
+ localdata.setVar("WORKDIR", d.getVar("WORKDIR"))
value = localdata.getVar(var) or ""
if value != "":
if need_split:
OpenPOWER on IntegriCloud