summaryrefslogtreecommitdiffstats
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-04 16:23:51 +0100
commit2b6218d4492d34a2c570172f1c8ea0310a8fa958 (patch)
treefd749fd28a8886bf8fbdde55ae9d8e5fd8dddf54 /scripts
parent3b3f9bbc30f6e4fa07b821b9c03112df17844972 (diff)
downloadpoky-2b6218d4492d34a2c570172f1c8ea0310a8fa958.tar.gz
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] (From OE-Core rev: a9eb80de164fb8a464e29bf1cc6c7cf397f36662) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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):
170 """Entry point for the devtool 'extract' subcommand""" 170 """Entry point for the devtool 'extract' subcommand"""
171 import bb 171 import bb
172 172
173 tinfoil = setup_tinfoil() 173 tinfoil = _prep_extract_operation(config, basepath, args.recipename)
174 174
175 rd = parse_recipe(config, tinfoil, args.recipename, True) 175 rd = parse_recipe(config, tinfoil, args.recipename, True)
176 if not rd: 176 if not rd:
@@ -210,6 +210,24 @@ class BbTaskExecutor(object):
210 self.executed.append(func) 210 self.executed.append(func)
211 211
212 212
213def _prep_extract_operation(config, basepath, recipename):
214 """HACK: Ugly workaround for making sure that requirements are met when
215 trying to extract a package. Returns the tinfoil instance to be used."""
216 tinfoil = setup_tinfoil()
217 rd = parse_recipe(config, tinfoil, recipename, True)
218
219 if bb.data.inherits_class('kernel-yocto', rd):
220 tinfoil.shutdown()
221 try:
222 stdout, _ = exec_build_env_command(config.init_path, basepath,
223 'bitbake kern-tools-native')
224 tinfoil = setup_tinfoil()
225 except bb.process.ExecutionError as err:
226 raise DevtoolError("Failed to build kern-tools-native:\n%s" %
227 err.stdout)
228 return tinfoil
229
230
213def _extract_source(srctree, keep_temp, devbranch, d): 231def _extract_source(srctree, keep_temp, devbranch, d):
214 """Extract sources of a recipe""" 232 """Extract sources of a recipe"""
215 import bb.event 233 import bb.event
@@ -395,8 +413,10 @@ def modify(args, config, basepath, workspace):
395 raise DevtoolError("directory %s does not exist or not a directory " 413 raise DevtoolError("directory %s does not exist or not a directory "
396 "(specify -x to extract source from recipe)" % 414 "(specify -x to extract source from recipe)" %
397 args.srctree) 415 args.srctree)
398 416 if args.extract:
399 tinfoil = setup_tinfoil() 417 tinfoil = _prep_extract_operation(config, basepath, args.recipename)
418 else:
419 tinfoil = setup_tinfoil()
400 420
401 rd = parse_recipe(config, tinfoil, args.recipename, True) 421 rd = parse_recipe(config, tinfoil, args.recipename, True)
402 if not rd: 422 if not rd: