summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-08-26 17:13:46 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-03 13:32:36 +0100
commita9eb80de164fb8a464e29bf1cc6c7cf397f36662 (patch)
treecaed5c2ecdf3f54460c66eba230337fb90d3832f /scripts
parent65fe3e45b10c5578446c758f66840891c62cd774 (diff)
downloadopenembedded-core-a9eb80de164fb8a464e29bf1cc6c7cf397f36662.tar.gz
openembedded-core-a9eb80de164fb8a464e29bf1cc6c7cf397f36662.tar.bz2
openembedded-core-a9eb80de164fb8a464e29bf1cc6c7cf397f36662.zip
devtool: run kernel dependencies
The kernel package needs "kern-tools-native" in order for it's do_kernel_metadata. Thus, devtool extract for kernel in a pristine environment fails. With the current bb.tinfoil implementation it is not possible to run arbitrary bitbake commands - e.g. run "bitbake kern-tools-native -c populate_sysroot" in our case. This patch implements an ugly workaround for that problem, basically by hardcoding this dependency and running the required bitbake task(s) before tinfoil is initialized. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index f2621cdb91..e59fb5e567 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -170,7 +170,7 @@ def extract(args, config, basepath, workspace):
"""Entry point for the devtool 'extract' subcommand"""
import bb
- tinfoil = setup_tinfoil()
+ tinfoil = _prep_extract_operation(config, basepath, args.recipename)
rd = parse_recipe(config, tinfoil, args.recipename, True)
if not rd:
@@ -210,6 +210,24 @@ class BbTaskExecutor(object):
self.executed.append(func)
+def _prep_extract_operation(config, basepath, recipename):
+ """HACK: Ugly workaround for making sure that requirements are met when
+ trying to extract a package. Returns the tinfoil instance to be used."""
+ tinfoil = setup_tinfoil()
+ rd = parse_recipe(config, tinfoil, recipename, True)
+
+ if bb.data.inherits_class('kernel-yocto', rd):
+ tinfoil.shutdown()
+ try:
+ stdout, _ = exec_build_env_command(config.init_path, basepath,
+ 'bitbake kern-tools-native')
+ tinfoil = setup_tinfoil()
+ except bb.process.ExecutionError as err:
+ raise DevtoolError("Failed to build kern-tools-native:\n%s" %
+ err.stdout)
+ return tinfoil
+
+
def _extract_source(srctree, keep_temp, devbranch, d):
"""Extract sources of a recipe"""
import bb.event
@@ -395,8 +413,10 @@ def modify(args, config, basepath, workspace):
raise DevtoolError("directory %s does not exist or not a directory "
"(specify -x to extract source from recipe)" %
args.srctree)
-
- tinfoil = setup_tinfoil()
+ if args.extract:
+ tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+ else:
+ tinfoil = setup_tinfoil()
rd = parse_recipe(config, tinfoil, args.recipename, True)
if not rd: