summaryrefslogtreecommitdiff
path: root/poky/scripts/lib
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2019-04-05 22:28:33 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-04-05 22:31:28 +0300
commit193236933b0f4ab91b1625b64e2187e2db4e0e8f (patch)
treee12769d7c76d8b0517d6de3d3c72189753d253ed /poky/scripts/lib
parentbd93df9478f2f56ffcbc8cb88f1709c735dcd85b (diff)
downloadopenbmc-193236933b0f4ab91b1625b64e2187e2db4e0e8f.tar.xz
reset upstream subtrees to HEAD
Reset the following subtrees on HEAD: poky: 8217b477a1(master) meta-xilinx: 64aa3d35ae(master) meta-openembedded: 0435c9e193(master) meta-raspberrypi: 490a4441ac(master) meta-security: cb6d1c85ee(master) Squashed patches: meta-phosphor: drop systemd 239 patches meta-phosphor: mrw-api: use correct install path Change-Id: I268e2646d9174ad305630c6bbd3fbc1a6105f43d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/scripts/lib')
-rw-r--r--poky/scripts/lib/devtool/__init__.py1
-rw-r--r--poky/scripts/lib/devtool/deploy.py20
-rw-r--r--poky/scripts/lib/devtool/standard.py4
-rw-r--r--poky/scripts/lib/devtool/upgrade.py21
-rwxr-xr-xpoky/scripts/lib/resulttool/manualexecution.py61
-rw-r--r--poky/scripts/lib/resulttool/resultutils.py39
-rw-r--r--poky/scripts/lib/resulttool/store.py23
-rw-r--r--poky/scripts/lib/scriptutils.py24
-rw-r--r--poky/scripts/lib/wic/engine.py2
-rw-r--r--poky/scripts/lib/wic/ksparser.py17
-rw-r--r--poky/scripts/lib/wic/partition.py2
-rw-r--r--poky/scripts/lib/wic/plugins/source/bootimg-efi.py6
12 files changed, 141 insertions, 79 deletions
diff --git a/poky/scripts/lib/devtool/__init__.py b/poky/scripts/lib/devtool/__init__.py
index 89f098a91..8fc7fffcd 100644
--- a/poky/scripts/lib/devtool/__init__.py
+++ b/poky/scripts/lib/devtool/__init__.py
@@ -205,6 +205,7 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
import oe.patch
if not os.path.exists(os.path.join(repodir, '.git')):
bb.process.run('git init', cwd=repodir)
+ bb.process.run('git config --local gc.autodetach 0', cwd=repodir)
bb.process.run('git add .', cwd=repodir)
commit_cmd = ['git']
oe.patch.GitApplyTree.gitCommandUserOptions(commit_cmd, d=d)
diff --git a/poky/scripts/lib/devtool/deploy.py b/poky/scripts/lib/devtool/deploy.py
index 886004b5d..f345f31b7 100644
--- a/poky/scripts/lib/devtool/deploy.py
+++ b/poky/scripts/lib/devtool/deploy.py
@@ -211,6 +211,11 @@ def deploy(args, config, basepath, workspace):
if not args.show_status:
extraoptions += ' -q'
+ scp_sshexec = ''
+ ssh_sshexec = 'ssh'
+ if args.ssh_exec:
+ scp_sshexec = "-S %s" % args.ssh_exec
+ ssh_sshexec = args.ssh_exec
scp_port = ''
ssh_port = ''
if args.port:
@@ -238,7 +243,7 @@ def deploy(args, config, basepath, workspace):
for fpath, fsize in filelist:
f.write('%s %d\n' % (fpath, fsize))
# Copy them to the target
- ret = subprocess.call("scp %s %s %s/* %s:%s" % (scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
+ ret = subprocess.call("scp %s %s %s %s/* %s:%s" % (scp_sshexec, scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
if ret != 0:
raise DevtoolError('Failed to copy script to %s - rerun with -s to '
'get a complete error message' % args.target)
@@ -246,7 +251,7 @@ def deploy(args, config, basepath, workspace):
shutil.rmtree(tmpdir)
# Now run the script
- ret = exec_fakeroot(rd, 'tar cf - . | ssh %s %s %s \'sh %s %s %s %s\'' % (ssh_port, extraoptions, args.target, tmpscript, args.recipename, destdir, tmpfilelist), cwd=recipe_outdir, shell=True)
+ ret = exec_fakeroot(rd, 'tar cf - . | %s %s %s %s \'sh %s %s %s %s\'' % (ssh_sshexec, ssh_port, extraoptions, args.target, tmpscript, args.recipename, destdir, tmpfilelist), cwd=recipe_outdir, shell=True)
if ret != 0:
raise DevtoolError('Deploy failed - rerun with -s to get a complete '
'error message')
@@ -276,6 +281,11 @@ def undeploy(args, config, basepath, workspace):
if not args.show_status:
extraoptions += ' -q'
+ scp_sshexec = ''
+ ssh_sshexec = 'ssh'
+ if args.ssh_exec:
+ scp_sshexec = "-S %s" % args.ssh_exec
+ ssh_sshexec = args.ssh_exec
scp_port = ''
ssh_port = ''
if args.port:
@@ -292,7 +302,7 @@ def undeploy(args, config, basepath, workspace):
with open(os.path.join(tmpdir, os.path.basename(tmpscript)), 'w') as f:
f.write(shellscript)
# Copy it to the target
- ret = subprocess.call("scp %s %s %s/* %s:%s" % (scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
+ ret = subprocess.call("scp %s %s %s %s/* %s:%s" % (scp_sshexec, scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
if ret != 0:
raise DevtoolError('Failed to copy script to %s - rerun with -s to '
'get a complete error message' % args.target)
@@ -300,7 +310,7 @@ def undeploy(args, config, basepath, workspace):
shutil.rmtree(tmpdir)
# Now run the script
- ret = subprocess.call('ssh %s %s %s \'sh %s %s\'' % (ssh_port, extraoptions, args.target, tmpscript, args.recipename), shell=True)
+ ret = subprocess.call('%s %s %s %s \'sh %s %s\'' % (ssh_sshexec, ssh_port, extraoptions, args.target, tmpscript, args.recipename), shell=True)
if ret != 0:
raise DevtoolError('Undeploy failed - rerun with -s to get a complete '
'error message')
@@ -324,6 +334,7 @@ def register_commands(subparsers, context):
parser_deploy.add_argument('-n', '--dry-run', help='List files to be deployed only', action='store_true')
parser_deploy.add_argument('-p', '--no-preserve', help='Do not preserve existing files', action='store_true')
parser_deploy.add_argument('--no-check-space', help='Do not check for available space before deploying', action='store_true')
+ parser_deploy.add_argument('-e', '--ssh-exec', help='Executable to use in place of ssh')
parser_deploy.add_argument('-P', '--port', help='Specify port to use for connection to the target')
strip_opts = parser_deploy.add_mutually_exclusive_group(required=False)
@@ -346,5 +357,6 @@ def register_commands(subparsers, context):
parser_undeploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true')
parser_undeploy.add_argument('-a', '--all', help='Undeploy all recipes deployed on the target', action='store_true')
parser_undeploy.add_argument('-n', '--dry-run', help='List files to be undeployed only', action='store_true')
+ parser_undeploy.add_argument('-e', '--ssh-exec', help='Executable to use in place of ssh')
parser_undeploy.add_argument('-P', '--port', help='Specify port to use for connection to the target')
parser_undeploy.set_defaults(func=undeploy)
diff --git a/poky/scripts/lib/devtool/standard.py b/poky/scripts/lib/devtool/standard.py
index b7d4d47df..ea09bbff3 100644
--- a/poky/scripts/lib/devtool/standard.py
+++ b/poky/scripts/lib/devtool/standard.py
@@ -849,9 +849,7 @@ def modify(args, config, basepath, workspace):
if bb.data.inherits_class('kernel', rd):
f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout '
'do_fetch do_unpack do_kernel_configme do_kernel_configcheck"\n')
- f.write('\ndo_patch() {\n'
- ' :\n'
- '}\n')
+ f.write('\ndo_patch[noexec] = "1"\n')
f.write('\ndo_configure_append() {\n'
' cp ${B}/.config ${S}/.config.baseline\n'
' ln -sfT ${B}/.config ${S}/.config.new\n'
diff --git a/poky/scripts/lib/devtool/upgrade.py b/poky/scripts/lib/devtool/upgrade.py
index 202007793..75e765e01 100644
--- a/poky/scripts/lib/devtool/upgrade.py
+++ b/poky/scripts/lib/devtool/upgrade.py
@@ -600,6 +600,20 @@ def latest_version(args, config, basepath, workspace):
tinfoil.shutdown()
return 0
+def check_upgrade_status(args, config, basepath, workspace):
+ if not args.recipe:
+ logger.info("Checking the upstream status for all recipes may take a few minutes")
+ results = oe.recipeutils.get_recipe_upgrade_status(args.recipe)
+ for result in results:
+ # pn, update_status, current, latest, maintainer, latest_commit, no_update_reason
+ if args.all or result[1] != 'MATCH':
+ logger.info("{:25} {:15} {:15} {} {} {}".format( result[0],
+ result[2],
+ result[1] if result[1] != 'UPDATE' else (result[3] if not result[3].endswith("new-commits-available") else "new commits"),
+ result[4],
+ result[5] if result[5] != 'N/A' else "",
+ "cannot be updated due to: %s" %(result[6]) if result[6] else ""))
+
def register_commands(subparsers, context):
"""Register devtool subcommands from this plugin"""
@@ -627,3 +641,10 @@ def register_commands(subparsers, context):
group='info')
parser_latest_version.add_argument('recipename', help='Name of recipe to query (just name - no version, path or extension)')
parser_latest_version.set_defaults(func=latest_version)
+
+ parser_check_upgrade_status = subparsers.add_parser('check-upgrade-status', help="Report upgradability for multiple (or all) recipes",
+ description="Prints a table of recipes together with versions currently provided by recipes, and latest upstream versions, when there is a later version available",
+ group='info')
+ parser_check_upgrade_status.add_argument('recipe', help='Name of the recipe to report (omit to report upgrade info for all recipes)', nargs='*')
+ parser_check_upgrade_status.add_argument('--all', '-a', help='Show all recipes, not just recipes needing upgrade', action="store_true")
+ parser_check_upgrade_status.set_defaults(func=check_upgrade_status)
diff --git a/poky/scripts/lib/resulttool/manualexecution.py b/poky/scripts/lib/resulttool/manualexecution.py
index 6487cd9bf..c94f98126 100755
--- a/poky/scripts/lib/resulttool/manualexecution.py
+++ b/poky/scripts/lib/resulttool/manualexecution.py
@@ -24,30 +24,18 @@ def load_json_file(file):
with open(file, "r") as f:
return json.load(f)
-
class ManualTestRunner(object):
- def __init__(self):
- self.jdata = ''
- self.test_module = ''
- self.test_cases_id = ''
- self.configuration = ''
- self.starttime = ''
- self.result_id = ''
- self.write_dir = ''
def _get_testcases(self, file):
self.jdata = load_json_file(file)
- self.test_cases_id = []
self.test_module = self.jdata[0]['test']['@alias'].split('.', 2)[0]
- for i in self.jdata:
- self.test_cases_id.append(i['test']['@alias'])
-
+
def _get_input(self, config):
while True:
output = input('{} = '.format(config))
- if re.match('^[a-zA-Z0-9_-]+$', output):
+ if re.match('^[a-z0-9-.]+$', output):
break
- print('Only alphanumeric and underscore/hyphen are allowed. Please try again')
+ print('Only lowercase alphanumeric, hyphen and dot are allowed. Please try again')
return output
def _create_config(self):
@@ -67,44 +55,42 @@ class ManualTestRunner(object):
extra_config = set(store_map['manual']) - set(self.configuration)
for config in sorted(extra_config):
print('---------------------------------------------')
- print('This is configuration #%s. Please provide configuration value(use "None" if not applicable).'
- % config)
+ print('This is configuration #%s. Please provide configuration value(use "None" if not applicable).' % config)
print('---------------------------------------------')
value_conf = self._get_input('Configuration Value')
print('---------------------------------------------\n')
self.configuration[config] = value_conf
def _create_result_id(self):
- self.result_id = 'manual_' + self.test_module + '_' + self.starttime
+ self.result_id = 'manual_%s_%s' % (self.test_module, self.starttime)
- def _execute_test_steps(self, test_id):
+ def _execute_test_steps(self, test):
test_result = {}
- total_steps = len(self.jdata[test_id]['test']['execution'].keys())
print('------------------------------------------------------------------------')
- print('Executing test case:' + '' '' + self.test_cases_id[test_id])
+ print('Executing test case: %s' % test['test']['@alias'])
print('------------------------------------------------------------------------')
- print('You have total ' + str(total_steps) + ' test steps to be executed.')
+ print('You have total %s test steps to be executed.' % len(test['test']['execution']))
print('------------------------------------------------------------------------\n')
- for step in sorted((self.jdata[test_id]['test']['execution']).keys()):
- print('Step %s: ' % step + self.jdata[test_id]['test']['execution']['%s' % step]['action'])
- print('Expected output: ' + self.jdata[test_id]['test']['execution']['%s' % step]['expected_results'])
- done = input('\nPlease press ENTER when you are done to proceed to next step.\n')
+ for step, _ in sorted(test['test']['execution'].items(), key=lambda x: int(x[0])):
+ print('Step %s: %s' % (step, test['test']['execution'][step]['action']))
+ expected_output = test['test']['execution'][step]['expected_results']
+ if expected_output:
+ print('Expected output: %s' % expected_output)
while True:
- done = input('\nPlease provide test results: (P)assed/(F)ailed/(B)locked/(S)kipped? \n')
- done = done.lower()
+ done = input('\nPlease provide test results: (P)assed/(F)ailed/(B)locked/(S)kipped? \n').lower()
result_types = {'p':'PASSED',
- 'f':'FAILED',
- 'b':'BLOCKED',
- 's':'SKIPPED'}
+ 'f':'FAILED',
+ 'b':'BLOCKED',
+ 's':'SKIPPED'}
if done in result_types:
for r in result_types:
if done == r:
res = result_types[r]
if res == 'FAILED':
log_input = input('\nPlease enter the error and the description of the log: (Ex:log:211 Error Bitbake)\n')
- test_result.update({self.test_cases_id[test_id]: {'status': '%s' % res, 'log': '%s' % log_input}})
+ test_result.update({test['test']['@alias']: {'status': '%s' % res, 'log': '%s' % log_input}})
else:
- test_result.update({self.test_cases_id[test_id]: {'status': '%s' % res}})
+ test_result.update({test['test']['@alias']: {'status': '%s' % res}})
break
print('Invalid input!')
return test_result
@@ -119,9 +105,9 @@ class ManualTestRunner(object):
self._create_result_id()
self._create_write_dir()
test_results = {}
- print('\nTotal number of test cases in this test suite: ' + '%s\n' % len(self.jdata))
- for i in range(0, len(self.jdata)):
- test_result = self._execute_test_steps(i)
+ print('\nTotal number of test cases in this test suite: %s\n' % len(self.jdata))
+ for t in self.jdata:
+ test_result = self._execute_test_steps(t)
test_results.update(test_result)
return self.configuration, self.result_id, self.write_dir, test_results
@@ -129,8 +115,7 @@ def manualexecution(args, logger):
testrunner = ManualTestRunner()
get_configuration, get_result_id, get_write_dir, get_test_results = testrunner.run_test(args.file)
resultjsonhelper = OETestResultJSONHelper()
- resultjsonhelper.dump_testresult_file(get_write_dir, get_configuration, get_result_id,
- get_test_results)
+ resultjsonhelper.dump_testresult_file(get_write_dir, get_configuration, get_result_id, get_test_results)
return 0
def register_commands(subparsers):
diff --git a/poky/scripts/lib/resulttool/resultutils.py b/poky/scripts/lib/resulttool/resultutils.py
index 153f2b8e1..ad40ac849 100644
--- a/poky/scripts/lib/resulttool/resultutils.py
+++ b/poky/scripts/lib/resulttool/resultutils.py
@@ -15,6 +15,7 @@
import os
import json
import scriptpath
+import copy
scriptpath.add_oe_lib_path()
flatten_map = {
@@ -60,12 +61,6 @@ def append_resultsdata(results, f, configmap=store_map):
testpath = "/".join(data[res]["configuration"].get(i) for i in configmap[testtype])
if testpath not in results:
results[testpath] = {}
- if 'ptestresult.rawlogs' in data[res]['result']:
- del data[res]['result']['ptestresult.rawlogs']
- if 'ptestresult.sections' in data[res]['result']:
- for i in data[res]['result']['ptestresult.sections']:
- if 'log' in data[res]['result']['ptestresult.sections'][i]:
- del data[res]['result']['ptestresult.sections'][i]['log']
results[testpath][res] = data[res]
#
@@ -93,15 +88,43 @@ def filter_resultsdata(results, resultid):
newresults[r][i] = results[r][i]
return newresults
-def save_resultsdata(results, destdir, fn="testresults.json"):
+def strip_ptestresults(results):
+ newresults = copy.deepcopy(results)
+ #for a in newresults2:
+ # newresults = newresults2[a]
+ for res in newresults:
+ if 'result' not in newresults[res]:
+ continue
+ if 'ptestresult.rawlogs' in newresults[res]['result']:
+ del newresults[res]['result']['ptestresult.rawlogs']
+ if 'ptestresult.sections' in newresults[res]['result']:
+ for i in newresults[res]['result']['ptestresult.sections']:
+ if 'log' in newresults[res]['result']['ptestresult.sections'][i]:
+ del newresults[res]['result']['ptestresult.sections'][i]['log']
+ return newresults
+
+def save_resultsdata(results, destdir, fn="testresults.json", ptestjson=False, ptestlogs=False):
for res in results:
if res:
dst = destdir + "/" + res + "/" + fn
else:
dst = destdir + "/" + fn
os.makedirs(os.path.dirname(dst), exist_ok=True)
+ resultsout = results[res]
+ if not ptestjson:
+ resultsout = strip_ptestresults(results[res])
with open(dst, 'w') as f:
- f.write(json.dumps(results[res], sort_keys=True, indent=4))
+ f.write(json.dumps(resultsout, sort_keys=True, indent=4))
+ for res2 in results[res]:
+ if ptestlogs and 'result' in results[res][res2]:
+ if 'ptestresult.rawlogs' in results[res][res2]['result']:
+ with open(dst.replace(fn, "ptest-raw.log"), "w+") as f:
+ f.write(results[res][res2]['result']['ptestresult.rawlogs']['log'])
+ if 'ptestresult.sections' in results[res][res2]['result']:
+ for i in results[res][res2]['result']['ptestresult.sections']:
+ if 'log' in results[res][res2]['result']['ptestresult.sections'][i]:
+ with open(dst.replace(fn, "ptest-%s.log" % i), "w+") as f:
+ f.write(results[res][res2]['result']['ptestresult.sections'][i]['log'])
def git_get_result(repo, tags):
git_objs = []
diff --git a/poky/scripts/lib/resulttool/store.py b/poky/scripts/lib/resulttool/store.py
index 5e33716c3..e4a080752 100644
--- a/poky/scripts/lib/resulttool/store.py
+++ b/poky/scripts/lib/resulttool/store.py
@@ -29,15 +29,18 @@ def store(args, logger):
try:
results = {}
logger.info('Reading files from %s' % args.source)
- 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)
- elif args.all:
- dst = f.replace(args.source, tempdir + "/")
- os.makedirs(os.path.dirname(dst), exist_ok=True)
- shutil.copyfile(f, dst)
+ if os.path.isfile(args.source):
+ 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)
+ elif args.all:
+ dst = f.replace(args.source, tempdir + "/")
+ os.makedirs(os.path.dirname(dst), exist_ok=True)
+ shutil.copyfile(f, dst)
revisions = {}
@@ -65,7 +68,7 @@ def store(args, logger):
results = revisions[r]
keywords = {'commit': r[0], 'branch': r[1], "commit_count": r[2]}
subprocess.check_call(["find", tempdir, "!", "-path", "./.git/*", "-delete"])
- resultutils.save_resultsdata(results, tempdir)
+ resultutils.save_resultsdata(results, tempdir, ptestlogs=True)
logger.info('Storing test result into git repository %s' % args.git_dir)
diff --git a/poky/scripts/lib/scriptutils.py b/poky/scripts/lib/scriptutils.py
index 31e48ea4d..0633c7066 100644
--- a/poky/scripts/lib/scriptutils.py
+++ b/poky/scripts/lib/scriptutils.py
@@ -26,6 +26,8 @@ import string
import subprocess
import sys
import tempfile
+import importlib
+from importlib import machinery
def logger_create(name, stream=None):
logger = logging.getLogger(name)
@@ -37,12 +39,12 @@ def logger_create(name, stream=None):
def logger_setup_color(logger, color='auto'):
from bb.msg import BBLogFormatter
- console = logging.StreamHandler(sys.stdout)
- formatter = BBLogFormatter("%(levelname)s: %(message)s")
- console.setFormatter(formatter)
- logger.handlers = [console]
- if color == 'always' or (color=='auto' and console.stream.isatty()):
- formatter.enable_color()
+
+ for handler in logger.handlers:
+ if (isinstance(handler, logging.StreamHandler) and
+ isinstance(handler.formatter, BBLogFormatter)):
+ if color == 'always' or (color == 'auto' and handler.stream.isatty()):
+ handler.formatter.enable_color()
def load_plugins(logger, plugins, pluginpath):
@@ -50,12 +52,9 @@ def load_plugins(logger, plugins, pluginpath):
def load_plugin(name):
logger.debug('Loading plugin %s' % name)
- fp, pathname, description = imp.find_module(name, [pluginpath])
- try:
- return imp.load_module(name, fp, pathname, description)
- finally:
- if fp:
- fp.close()
+ spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] )
+ if spec:
+ return spec.loader.load_module()
def plugin_name(filename):
return os.path.splitext(os.path.basename(filename))[0]
@@ -70,6 +69,7 @@ def load_plugins(logger, plugins, pluginpath):
plugin.plugin_init(plugins)
plugins.append(plugin)
+
def git_convert_standalone_clone(repodir):
"""If specified directory is a git repository, ensure it's a standalone clone"""
import bb.process
diff --git a/poky/scripts/lib/wic/engine.py b/poky/scripts/lib/wic/engine.py
index ea600d285..ab33fa604 100644
--- a/poky/scripts/lib/wic/engine.py
+++ b/poky/scripts/lib/wic/engine.py
@@ -338,7 +338,7 @@ class Disk:
def copy(self, src, pnum, path):
"""Copy partition image into wic image."""
if self.partitions[pnum].fstype.startswith('ext'):
- cmd = "printf 'cd {}\nwrite {} {}' | {} -w {}".\
+ cmd = "printf 'cd {}\nwrite {} {}\n' | {} -w {}".\
format(path, src, os.path.basename(src),
self.debugfs, self._get_part_image(pnum))
else: # fat
diff --git a/poky/scripts/lib/wic/ksparser.py b/poky/scripts/lib/wic/ksparser.py
index 7e5a9c509..08baf7612 100644
--- a/poky/scripts/lib/wic/ksparser.py
+++ b/poky/scripts/lib/wic/ksparser.py
@@ -28,14 +28,30 @@
import os
import shlex
import logging
+import re
from argparse import ArgumentParser, ArgumentError, ArgumentTypeError
from wic.engine import find_canned
from wic.partition import Partition
+from wic.misc import get_bitbake_var
logger = logging.getLogger('wic')
+__expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
+
+def expand_line(line):
+ while True:
+ m = __expand_var_regexp__.search(line)
+ if not m:
+ return line
+ key = m.group()[2:-1]
+ val = get_bitbake_var(key)
+ if val is None:
+ logger.warning("cannot expand variable %s" % key)
+ return line
+ line = line[:m.start()] + val + line[m.end():]
+
class KickStartError(Exception):
"""Custom exception."""
pass
@@ -190,6 +206,7 @@ class KickStart():
line = line.strip()
lineno += 1
if line and line[0] != '#':
+ line = expand_line(line)
try:
line_args = shlex.split(line)
parsed = parser.parse_args(line_args)
diff --git a/poky/scripts/lib/wic/partition.py b/poky/scripts/lib/wic/partition.py
index 3da7e23e6..ca206ece0 100644
--- a/poky/scripts/lib/wic/partition.py
+++ b/poky/scripts/lib/wic/partition.py
@@ -173,7 +173,7 @@ class Partition():
# Split sourceparams string of the form key1=val1[,key2=val2,...]
# into a dict. Also accepts valueless keys i.e. without =
splitted = self.sourceparams.split(',')
- srcparams_dict = dict(par.split('=') for par in splitted if par)
+ srcparams_dict = dict(par.split('=', 1) for par in splitted if par)
plugin = PluginMgr.get_plugins('source')[self.source]
plugin.do_configure_partition(self, srcparams_dict, creator,
diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
index 0eb86a079..83a7e189e 100644
--- a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -77,12 +77,13 @@ class BootimgEFIPlugin(SourcePlugin):
if not custom_cfg:
# Create grub configuration using parameters from wks file
bootloader = creator.ks.bootloader
+ title = source_params.get('title')
grubefi_conf = ""
grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n"
grubefi_conf += "default=boot\n"
grubefi_conf += "timeout=%s\n" % bootloader.timeout
- grubefi_conf += "menuentry 'boot'{\n"
+ grubefi_conf += "menuentry '%s'{\n" % (title if title else "boot")
kernel = "/bzImage"
@@ -152,9 +153,10 @@ class BootimgEFIPlugin(SourcePlugin):
if not custom_cfg:
# Create systemd-boot configuration using parameters from wks file
kernel = "/bzImage"
+ title = source_params.get('title')
boot_conf = ""
- boot_conf += "title boot\n"
+ boot_conf += "title %s\n" % (title if title else "boot")
boot_conf += "linux %s\n" % kernel
boot_conf += "options LABEL=Boot root=%s %s\n" % \
(creator.rootdev, bootloader.append)