From f9bc3b27244a141ec7273445d3ea139a047e0ddf Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Mon, 13 Jul 2015 11:43:40 -0700 Subject: devtool: also load plugins from BBPATH This makes it easier to extend, as a layer can add its own sub-commands. Argument parsing is also separated into two steps, the same way it's done in recipetool, as we need access to the global command-line arguments early, before plugins are loaded, both for debugging arguments and for the bitbake path (we need to load the bitbake module to get tinfoil, which is now needed to load the plugins). Rather than constructing tinfoil once and passing it through into sub-commands for their use, we have to construct it for configuration metadata, use it, and then shut it down, as some sub-commands call out to recipetool, which needs its own tinfoil instance, and therefore needs to acquire the bitbake lock. If we're still holding the lock at that point, that's clearly a problem. [YOCTO #7625] Signed-off-by: Christopher Larson Signed-off-by: Ross Burton --- scripts/lib/devtool/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/lib/devtool') diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 61b810c938..b54ddf5ff4 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -96,7 +96,7 @@ def exec_fakeroot(d, cmd, **kwargs): newenv[splitval[0]] = splitval[1] return subprocess.call("%s %s" % (fakerootcmd, cmd), env=newenv, **kwargs) -def setup_tinfoil(): +def setup_tinfoil(config_only=False): """Initialize tinfoil api from bitbake""" import scriptpath bitbakepath = scriptpath.add_bitbake_lib_path() @@ -106,7 +106,7 @@ def setup_tinfoil(): import bb.tinfoil tinfoil = bb.tinfoil.Tinfoil() - tinfoil.prepare(False) + tinfoil.prepare(config_only) tinfoil.logger.setLevel(logger.getEffectiveLevel()) return tinfoil -- cgit v1.2.3