diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-09-18 13:15:47 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-22 12:19:43 +0100 |
commit | ba83eb315d1462e096e2d6682d246cbbe260b4c0 (patch) | |
tree | 7b0bf6ac84989275df250d76e1d1097fdd9bd0aa /bitbake/bin | |
parent | 87e86d4fd3a22627bf5a7eff20d8551cb1e67452 (diff) | |
download | poky-ba83eb315d1462e096e2d6682d246cbbe260b4c0.tar.gz |
bitbake: bitbake: cooker,xmlrpc,servers: implement CookerFeatures
Implementing feature set selection that allows a client
to enable specific features in the server at connection time.
Only enabling of features is supported, as there is
no way to safely remove data loaded into the cooker.
Once enabled, a feature will remain enabled for the
life of the cooker.
Client-server connection now supports specifying the feature
set required by the client. This is implemented in the Process
server using a managed proxy list, so the server cooker
will now load dynamically needed features based on what client
connects to it.
In the XMLRPC server the feature set is requested by
using a parameter for registerUIHandler function.
This allows observer-only clients to also specify features
for the server.
The server code configuration now is completly separated
from the client code. All hardcoding of client knowledge is
removed from the server.
The extra_caches is removed as the client can now specify
the caches it needs using the feature. The UI modules
now need to specify the desired featureSet. HOB is modified
to conform to the featureSet specification.
The only feature available is CookerFeatures.HOB_EXTRA_CACHES
which forces loading the bb.cache_extra:HobRecipeInfo class.
(Bitbake rev: 98e594837aab89ea042cfa9f3740d20a661b14e2)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 60c4b96c70..b4506efb52 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -75,18 +75,6 @@ def get_ui(config): | |||
75 | sys.exit("FATAL: Invalid user interface '%s' specified.\n" | 75 | sys.exit("FATAL: Invalid user interface '%s' specified.\n" |
76 | "Valid interfaces: depexp, goggle, ncurses, hob, knotty [default]." % interface) | 76 | "Valid interfaces: depexp, goggle, ncurses, hob, knotty [default]." % interface) |
77 | 77 | ||
78 | def gather_extra_cache_data(): | ||
79 | extra = [] | ||
80 | interfaces = ['depexp', 'goggle', 'ncurses', 'hob', 'knotty'] | ||
81 | for i in interfaces: | ||
82 | try: | ||
83 | ui = __import__("bb.ui." + i, fromlist = [i]) | ||
84 | if hasattr(ui, "extraCaches"): | ||
85 | extra = extra + ui.extraCaches | ||
86 | del ui | ||
87 | except: | ||
88 | pass | ||
89 | return extra | ||
90 | 78 | ||
91 | # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" | 79 | # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" |
92 | warnlog = logging.getLogger("BitBake.Warnings") | 80 | warnlog = logging.getLogger("BitBake.Warnings") |
@@ -302,25 +290,22 @@ def main(): | |||
302 | # Clear away any spurious environment variables while we stoke up the cooker | 290 | # Clear away any spurious environment variables while we stoke up the cooker |
303 | cleanedvars = bb.utils.clean_environment() | 291 | cleanedvars = bb.utils.clean_environment() |
304 | 292 | ||
305 | # Collect all the caches we need | ||
306 | if configParams.server_only: | ||
307 | configuration.extra_caches = gather_extra_cache_data() | ||
308 | else: | ||
309 | configuration.extra_caches = getattr(ui_module, "extraCaches", []) | ||
310 | |||
311 | if not configParams.remote_server: | 293 | if not configParams.remote_server: |
312 | # we start a server with a given configuration | 294 | # we start a server with a given configuration |
313 | server = start_server(servermodule, configParams, configuration) | 295 | server = start_server(servermodule, configParams, configuration) |
314 | else: | 296 | else: |
315 | # we start a stub server that is actually a XMLRPClient to | 297 | # we start a stub server that is actually a XMLRPClient that connects to a real server |
316 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) | 298 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) |
317 | server.saveConnectionDetails(configParams.remote_server) | 299 | server.saveConnectionDetails(configParams.remote_server) |
318 | 300 | ||
319 | logger.removeHandler(handler) | 301 | logger.removeHandler(handler) |
320 | 302 | ||
321 | if not configParams.server_only: | 303 | if not configParams.server_only: |
304 | # Collect the feature set for the UI | ||
305 | featureset = getattr(ui_module, "featureSet", []) | ||
306 | |||
322 | # Setup a connection to the server (cooker) | 307 | # Setup a connection to the server (cooker) |
323 | server_connection = server.establishConnection() | 308 | server_connection = server.establishConnection(featureset) |
324 | 309 | ||
325 | # Restore the environment in case the UI needs it | 310 | # Restore the environment in case the UI needs it |
326 | for k in cleanedvars: | 311 | for k in cleanedvars: |