diff options
author | Christopher Larson <chris_larson@mentor.com> | 2015-07-13 11:43:40 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-27 23:29:13 +0100 |
commit | 0eb40ba0de4c063ac5dcbc71b0de8e8e2cd5aa17 (patch) | |
tree | 90a5c8f78c41b0f0dda7bc9d87cc8ecd55ac9dfe /scripts/lib | |
parent | da02f483c47ff2a6fe01a878b4b575b50b50c6d3 (diff) | |
download | poky-0eb40ba0de4c063ac5dcbc71b0de8e8e2cd5aa17.tar.gz |
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]
(From OE-Core rev: f9bc3b27244a141ec7273445d3ea139a047e0ddf)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/devtool/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
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): | |||
96 | newenv[splitval[0]] = splitval[1] | 96 | newenv[splitval[0]] = splitval[1] |
97 | return subprocess.call("%s %s" % (fakerootcmd, cmd), env=newenv, **kwargs) | 97 | return subprocess.call("%s %s" % (fakerootcmd, cmd), env=newenv, **kwargs) |
98 | 98 | ||
99 | def setup_tinfoil(): | 99 | def setup_tinfoil(config_only=False): |
100 | """Initialize tinfoil api from bitbake""" | 100 | """Initialize tinfoil api from bitbake""" |
101 | import scriptpath | 101 | import scriptpath |
102 | bitbakepath = scriptpath.add_bitbake_lib_path() | 102 | bitbakepath = scriptpath.add_bitbake_lib_path() |
@@ -106,7 +106,7 @@ def setup_tinfoil(): | |||
106 | 106 | ||
107 | import bb.tinfoil | 107 | import bb.tinfoil |
108 | tinfoil = bb.tinfoil.Tinfoil() | 108 | tinfoil = bb.tinfoil.Tinfoil() |
109 | tinfoil.prepare(False) | 109 | tinfoil.prepare(config_only) |
110 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) | 110 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) |
111 | return tinfoil | 111 | return tinfoil |
112 | 112 | ||