summaryrefslogtreecommitdiff
path: root/poky/scripts/lib
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2019-07-08 15:24:31 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-07-08 16:34:48 +0300
commit2939317205d1f39eefebec7bd6ba01faaa0f9369 (patch)
tree45f4ba1e0bca7dc394b7fa77ca3122f1121a6a55 /poky/scripts/lib
parent963b1beb7e04e1c6c55bea2104b856e3121202db (diff)
downloadopenbmc-2.7.0-rc1.tar.xz
reset upstream subtrees to warrior HEAD2.7.0-rc1
Reset the following subtrees on warrior HEAD: meta-security: 4f7be0d252(warrior) poky: 38d5c8ea98(warrior) meta-raspberrypi: 6c73694912(warrior) meta-openembedded: 6fa72d587a(warrior) Change-Id: Id2550baeb90de14bdd9ee8c06f2c619fc719bc68 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/scripts/lib')
-rw-r--r--poky/scripts/lib/recipetool/create_buildsys_python.py22
-rw-r--r--poky/scripts/lib/resulttool/merge.py20
-rw-r--r--poky/scripts/lib/resulttool/resultutils.py19
-rw-r--r--poky/scripts/lib/resulttool/store.py9
-rw-r--r--poky/scripts/lib/wic/engine.py7
-rw-r--r--poky/scripts/lib/wic/filemap.py5
-rw-r--r--poky/scripts/lib/wic/partition.py2
-rw-r--r--poky/scripts/lib/wic/plugins/source/bootimg-efi.py60
-rw-r--r--poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py8
-rw-r--r--poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py21
10 files changed, 54 insertions, 119 deletions
diff --git a/poky/scripts/lib/recipetool/create_buildsys_python.py b/poky/scripts/lib/recipetool/create_buildsys_python.py
index ac9bc9237c..1a38bd0b14 100644
--- a/poky/scripts/lib/recipetool/create_buildsys_python.py
+++ b/poky/scripts/lib/recipetool/create_buildsys_python.py
@@ -31,11 +31,11 @@ def tinfoil_init(instance):
class PythonRecipeHandler(RecipeHandler):
- base_pkgdeps = ['python3-core']
- excluded_pkgdeps = ['python3-dbg']
- # os.path is provided by python3-core
+ base_pkgdeps = ['python-core']
+ excluded_pkgdeps = ['python-dbg']
+ # os.path is provided by python-core
assume_provided = ['builtins', 'os.path']
- # Assumes that the host python3 builtin_module_names is sane for target too
+ # Assumes that the host python builtin_module_names is sane for target too
assume_provided = assume_provided + list(sys.builtin_module_names)
bbvar_map = {
@@ -215,9 +215,9 @@ class PythonRecipeHandler(RecipeHandler):
self.apply_info_replacements(info)
if uses_setuptools:
- classes.append('setuptools3')
+ classes.append('setuptools')
else:
- classes.append('distutils3')
+ classes.append('distutils')
if license_str:
for i, line in enumerate(lines_before):
@@ -282,7 +282,7 @@ class PythonRecipeHandler(RecipeHandler):
for feature, feature_reqs in extras_req.items():
unmapped_deps.difference_update(feature_reqs)
- feature_req_deps = ('python3-' + r.replace('.', '-').lower() for r in sorted(feature_reqs))
+ feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs))
lines_after.append('PACKAGECONFIG[{}] = ",,,{}"'.format(feature.lower(), ' '.join(feature_req_deps)))
inst_reqs = set()
@@ -293,7 +293,7 @@ class PythonRecipeHandler(RecipeHandler):
if inst_reqs:
unmapped_deps.difference_update(inst_reqs)
- inst_req_deps = ('python3-' + r.replace('.', '-').lower() for r in sorted(inst_reqs))
+ inst_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(inst_reqs))
lines_after.append('# WARNING: the following rdepends are from setuptools install_requires. These')
lines_after.append('# upstream names may not correspond exactly to bitbake package names.')
lines_after.append('RDEPENDS_${{PN}} += "{}"'.format(' '.join(inst_req_deps)))
@@ -356,7 +356,7 @@ class PythonRecipeHandler(RecipeHandler):
return info, 'setuptools' in imported_modules, non_literals, extensions
def get_setup_args_info(self, setupscript='./setup.py'):
- cmd = ['python3', setupscript]
+ cmd = ['python', setupscript]
info = {}
keys = set(self.bbvar_map.keys())
keys |= set(self.setuparg_list_fields)
@@ -390,7 +390,7 @@ class PythonRecipeHandler(RecipeHandler):
def get_setup_byline(self, fields, setupscript='./setup.py'):
info = {}
- cmd = ['python3', setupscript]
+ cmd = ['python', setupscript]
cmd.extend('--' + self.setuparg_map.get(f, f.lower()) for f in fields)
try:
info_lines = self.run_command(cmd, cwd=os.path.dirname(setupscript)).splitlines()
@@ -527,7 +527,7 @@ class PythonRecipeHandler(RecipeHandler):
pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
ldata = tinfoil.config_data.createCopy()
- bb.parse.handle('classes/python3-dir.bbclass', ldata, True)
+ bb.parse.handle('classes/python-dir.bbclass', ldata, True)
python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR')
dynload_dir = os.path.join(os.path.dirname(python_sitedir), 'lib-dynload')
diff --git a/poky/scripts/lib/resulttool/merge.py b/poky/scripts/lib/resulttool/merge.py
index 18b4825a18..70d23a48fd 100644
--- a/poky/scripts/lib/resulttool/merge.py
+++ b/poky/scripts/lib/resulttool/merge.py
@@ -11,23 +11,16 @@ import json
import resulttool.resultutils as resultutils
def merge(args, logger):
- configvars = {}
- if not args.not_add_testseries:
- configvars = resultutils.extra_configvars.copy()
- if args.executed_by:
- configvars['EXECUTED_BY'] = args.executed_by
if resultutils.is_url(args.target_results) or os.path.isdir(args.target_results):
- results = resultutils.load_resultsdata(args.target_results, configmap=resultutils.store_map, configvars=configvars)
- resultutils.append_resultsdata(results, args.base_results, configmap=resultutils.store_map, configvars=configvars)
+ results = resultutils.load_resultsdata(args.target_results, configmap=resultutils.store_map)
+ resultutils.append_resultsdata(results, args.base_results, configmap=resultutils.store_map)
resultutils.save_resultsdata(results, args.target_results)
else:
- results = resultutils.load_resultsdata(args.base_results, configmap=resultutils.flatten_map, configvars=configvars)
+ results = resultutils.load_resultsdata(args.base_results, configmap=resultutils.flatten_map)
if os.path.exists(args.target_results):
- resultutils.append_resultsdata(results, args.target_results, configmap=resultutils.flatten_map, configvars=configvars)
+ resultutils.append_resultsdata(results, args.target_results, configmap=resultutils.flatten_map)
resultutils.save_resultsdata(results, os.path.dirname(args.target_results), fn=os.path.basename(args.target_results))
- logger.info('Merged results to %s' % os.path.dirname(args.target_results))
-
return 0
def register_commands(subparsers):
@@ -40,7 +33,4 @@ def register_commands(subparsers):
help='the results file/directory/URL to import')
parser_build.add_argument('target_results',
help='the target file or directory to merge the base_results with')
- parser_build.add_argument('-t', '--not-add-testseries', action='store_true',
- help='do not add testseries configuration to results')
- parser_build.add_argument('-x', '--executed-by', default='',
- help='add executed-by configuration to each result file')
+
diff --git a/poky/scripts/lib/resulttool/resultutils.py b/poky/scripts/lib/resulttool/resultutils.py
index e595c185df..ea4ab42d9a 100644
--- a/poky/scripts/lib/resulttool/resultutils.py
+++ b/poky/scripts/lib/resulttool/resultutils.py
@@ -42,12 +42,10 @@ def is_url(p):
"""
return p.startswith('http://') or p.startswith('https://')
-extra_configvars = {'TESTSERIES': ''}
-
#
# Load the json file and append the results data into the provided results dict
#
-def append_resultsdata(results, f, configmap=store_map, configvars=extra_configvars):
+def append_resultsdata(results, f, configmap=store_map):
if type(f) is str:
if is_url(f):
with urllib.request.urlopen(f) as response:
@@ -63,15 +61,12 @@ def append_resultsdata(results, f, configmap=store_map, configvars=extra_configv
for res in data:
if "configuration" not in data[res] or "result" not in data[res]:
raise ValueError("Test results data without configuration or result section?")
- for config in configvars:
- if config == "TESTSERIES" and "TESTSERIES" not in data[res]["configuration"]:
- data[res]["configuration"]["TESTSERIES"] = testseries
- continue
- if config not in data[res]["configuration"]:
- data[res]["configuration"][config] = configvars[config]
+ if "TESTSERIES" not in data[res]["configuration"]:
+ data[res]["configuration"]["TESTSERIES"] = testseries
testtype = data[res]["configuration"].get("TEST_TYPE")
if testtype not in configmap:
raise ValueError("Unknown test type %s" % testtype)
+ configvars = configmap[testtype]
testpath = "/".join(data[res]["configuration"].get(i) for i in configmap[testtype])
if testpath not in results:
results[testpath] = {}
@@ -81,16 +76,16 @@ def append_resultsdata(results, f, configmap=store_map, configvars=extra_configv
# Walk a directory and find/load results data
# or load directly from a file
#
-def load_resultsdata(source, configmap=store_map, configvars=extra_configvars):
+def load_resultsdata(source, configmap=store_map):
results = {}
if is_url(source) or os.path.isfile(source):
- append_resultsdata(results, source, configmap, configvars)
+ append_resultsdata(results, source, configmap)
return results
for root, dirs, files in os.walk(source):
for name in files:
f = os.path.join(root, name)
if name == "testresults.json":
- append_resultsdata(results, f, configmap, configvars)
+ append_resultsdata(results, f, configmap)
return results
def filter_resultsdata(results, resultid):
diff --git a/poky/scripts/lib/resulttool/store.py b/poky/scripts/lib/resulttool/store.py
index 79c83dd8b7..06505aecc0 100644
--- a/poky/scripts/lib/resulttool/store.py
+++ b/poky/scripts/lib/resulttool/store.py
@@ -21,19 +21,16 @@ import oeqa.utils.gitarchive as gitarchive
def store(args, logger):
tempdir = tempfile.mkdtemp(prefix='testresults.')
try:
- configvars = resultutils.extra_configvars.copy()
- if args.executed_by:
- configvars['EXECUTED_BY'] = args.executed_by
results = {}
logger.info('Reading files from %s' % args.source)
if resultutils.is_url(args.source) or os.path.isfile(args.source):
- resultutils.append_resultsdata(results, args.source, configvars=configvars)
+ resultutils.append_resultsdata(results, args.source)
else:
for root, dirs, files in os.walk(args.source):
for name in files:
f = os.path.join(root, name)
if name == "testresults.json":
- resultutils.append_resultsdata(results, f, configvars=configvars)
+ resultutils.append_resultsdata(results, f)
elif args.all:
dst = f.replace(args.source, tempdir + "/")
os.makedirs(os.path.dirname(dst), exist_ok=True)
@@ -96,6 +93,4 @@ def register_commands(subparsers):
help='include all files, not just testresults.json files')
parser_build.add_argument('-e', '--allow-empty', action='store_true',
help='don\'t error if no results to store are found')
- parser_build.add_argument('-x', '--executed-by', default='',
- help='add executed-by configuration to each result file')
diff --git a/poky/scripts/lib/wic/engine.py b/poky/scripts/lib/wic/engine.py
index 61939ad194..42e93c3eb8 100644
--- a/poky/scripts/lib/wic/engine.py
+++ b/poky/scripts/lib/wic/engine.py
@@ -75,8 +75,7 @@ def find_canned_image(scripts_path, wks_file):
for fname in files:
if fname.endswith("~") or fname.endswith("#"):
continue
- if ((fname.endswith(".wks") and wks_file + ".wks" == fname) or \
- (fname.endswith(".wks.in") and wks_file + ".wks.in" == fname)):
+ if fname.endswith(".wks") and wks_file + ".wks" == fname:
fullpath = os.path.join(canned_wks_dir, fname)
return fullpath
return None
@@ -93,7 +92,7 @@ def list_canned_images(scripts_path):
for fname in files:
if fname.endswith("~") or fname.endswith("#"):
continue
- if fname.endswith(".wks") or fname.endswith(".wks.in"):
+ if fname.endswith(".wks"):
fullpath = os.path.join(canned_wks_dir, fname)
with open(fullpath) as wks:
for line in wks:
@@ -102,7 +101,7 @@ def list_canned_images(scripts_path):
if idx != -1:
desc = line[idx + len("short-description:"):].strip()
break
- basename = fname.split('.')[0]
+ basename = os.path.splitext(fname)[0]
print(" %s\t\t%s" % (basename.ljust(30), desc))
diff --git a/poky/scripts/lib/wic/filemap.py b/poky/scripts/lib/wic/filemap.py
index a3919fbcad..244c07a71c 100644
--- a/poky/scripts/lib/wic/filemap.py
+++ b/poky/scripts/lib/wic/filemap.py
@@ -32,10 +32,7 @@ def get_block_size(file_obj):
"""
# Get the block size of the host file-system for the image file by calling
# the FIGETBSZ ioctl (number 2).
- try:
- binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0))
- except OSError:
- raise IOError("Unable to determine block size")
+ binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0))
bsize = struct.unpack('I', binary_data)[0]
if not bsize:
import os
diff --git a/poky/scripts/lib/wic/partition.py b/poky/scripts/lib/wic/partition.py
index 01466b258d..6a1dc59501 100644
--- a/poky/scripts/lib/wic/partition.py
+++ b/poky/scripts/lib/wic/partition.py
@@ -308,7 +308,7 @@ class Partition():
dosfs_cmd = "mkdosfs %s -i %s %s %s -C %s %d" % \
(label_str, self.fsuuid, size_str, extraopts, rootfs,
- rootfs_size)
+ max(8250, rootfs_size))
exec_native_cmd(dosfs_cmd, native_sysroot)
mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir)
diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
index 5cc5c8a6b8..652323fa77 100644
--- a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -55,10 +55,8 @@ class BootimgEFIPlugin(SourcePlugin):
if not bootimg_dir:
raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
- initrds = initrd.split(';')
- for rd in initrds:
- cp_cmd = "cp %s/%s %s" % (bootimg_dir, rd, hdddir)
- exec_cmd(cp_cmd, True)
+ cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
+ exec_cmd(cp_cmd, True)
else:
logger.debug("Ignoring missing initrd")
@@ -73,24 +71,13 @@ class BootimgEFIPlugin(SourcePlugin):
grubefi_conf += "timeout=%s\n" % bootloader.timeout
grubefi_conf += "menuentry '%s'{\n" % (title if title else "boot")
- kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
-
- label = source_params.get('label')
- label_conf = "root=%s" % creator.rootdev
- if label:
- label_conf = "LABEL=%s" % label
+ kernel = "/bzImage"
- grubefi_conf += "linux /%s %s rootwait %s\n" \
- % (kernel, label_conf, bootloader.append)
+ grubefi_conf += "linux %s root=%s rootwait %s\n" \
+ % (kernel, creator.rootdev, bootloader.append)
if initrd:
- initrds = initrd.split(';')
- grubefi_conf += "initrd"
- for rd in initrds:
- grubefi_conf += " /%s" % rd
- grubefi_conf += "\n"
+ grubefi_conf += "initrd /%s\n" % initrd
grubefi_conf += "}\n"
@@ -125,10 +112,8 @@ class BootimgEFIPlugin(SourcePlugin):
if not bootimg_dir:
raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
- initrds = initrd.split(';')
- for rd in initrds:
- cp_cmd = "cp %s/%s %s" % (bootimg_dir, rd, hdddir)
- exec_cmd(cp_cmd, True)
+ cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
+ exec_cmd(cp_cmd, True)
else:
logger.debug("Ignoring missing initrd")
@@ -153,28 +138,17 @@ class BootimgEFIPlugin(SourcePlugin):
if not custom_cfg:
# Create systemd-boot configuration using parameters from wks file
- kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
-
+ kernel = "/bzImage"
title = source_params.get('title')
boot_conf = ""
boot_conf += "title %s\n" % (title if title else "boot")
- boot_conf += "linux /%s\n" % kernel
-
- label = source_params.get('label')
- label_conf = "LABEL=Boot root=%s" % creator.rootdev
- if label:
- label_conf = "LABEL=%s" % label
-
- boot_conf += "options %s %s\n" % \
- (label_conf, bootloader.append)
+ boot_conf += "linux %s\n" % kernel
+ boot_conf += "options LABEL=Boot root=%s %s\n" % \
+ (creator.rootdev, bootloader.append)
if initrd:
- initrds = initrd.split(';')
- for rd in initrds:
- boot_conf += "initrd /%s\n" % rd
+ boot_conf += "initrd /%s\n" % initrd
logger.debug("Writing systemd-boot config "
"%s/hdd/boot/loader/entries/boot.conf", cr_workdir)
@@ -224,12 +198,8 @@ class BootimgEFIPlugin(SourcePlugin):
hdddir = "%s/hdd/boot" % cr_workdir
- kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
-
- install_cmd = "install -m 0644 %s/%s %s/%s" % \
- (staging_kernel_dir, kernel, hdddir, kernel)
+ install_cmd = "install -m 0644 %s/bzImage %s/bzImage" % \
+ (staging_kernel_dir, hdddir)
exec_cmd(install_cmd)
diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index 670d347747..6c9f54a897 100644
--- a/poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -149,12 +149,8 @@ class BootimgPcbiosPlugin(SourcePlugin):
hdddir = "%s/hdd/boot" % cr_workdir
- kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
-
- cmds = ("install -m 0644 %s/%s %s/vmlinuz" %
- (staging_kernel_dir, kernel, hdddir),
+ cmds = ("install -m 0644 %s/bzImage %s/vmlinuz" %
+ (staging_kernel_dir, hdddir),
"install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" %
(bootimg_dir, hdddir),
"install -m 0644 %s/syslinux/vesamenu.c32 %s/vesamenu.c32" %
diff --git a/poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 74d6f14519..96d07ff629 100644
--- a/poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -70,10 +70,8 @@ class IsoImagePlugin(SourcePlugin):
syslinux_conf += "DEFAULT boot\n"
syslinux_conf += "LABEL boot\n"
- kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
- syslinux_conf += "KERNEL /" + kernel + "\n"
+ kernel = "/bzImage"
+ syslinux_conf += "KERNEL " + kernel + "\n"
syslinux_conf += "APPEND initrd=/initrd LABEL=boot %s\n" \
% bootloader.append
@@ -116,11 +114,9 @@ class IsoImagePlugin(SourcePlugin):
grubefi_conf += "\n"
grubefi_conf += "menuentry 'boot'{\n"
- kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
+ kernel = "/bzImage"
- grubefi_conf += "linux /%s rootwait %s\n" \
+ grubefi_conf += "linux %s rootwait %s\n" \
% (kernel, bootloader.append)
grubefi_conf += "initrd /initrd \n"
grubefi_conf += "}\n"
@@ -272,12 +268,9 @@ class IsoImagePlugin(SourcePlugin):
if os.path.isfile("%s/initrd.cpio.gz" % cr_workdir):
os.remove("%s/initrd.cpio.gz" % cr_workdir)
- kernel = get_bitbake_var("KERNEL_IMAGETYPE")
- if not kernel:
- kernel = "bzImage"
-
- install_cmd = "install -m 0644 %s/%s %s/%s" % \
- (kernel_dir, kernel, isodir, kernel)
+ # Install bzImage
+ install_cmd = "install -m 0644 %s/bzImage %s/bzImage" % \
+ (kernel_dir, isodir)
exec_cmd(install_cmd)
#Create bootloader for efi boot