diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-07-19 22:54:38 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-21 07:48:34 +0100 |
commit | 9d4254be5853a546a346bf0d19919dcfba12773d (patch) | |
tree | e689407c61ab36ec87990ea3e775db303d5a7df9 | |
parent | 6f6cd0674fd1595f4e74b7da692e0c348b2660c6 (diff) | |
download | bitbake-9d4254be5853a546a346bf0d19919dcfba12773d.tar.gz |
bitbake: implement --foreground command line option
This option makes bitbake xmlrpc server to run in foreground.
It should be useful for debugging purposes.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | lib/bb/main.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/bb/main.py b/lib/bb/main.py index 1c32e9308..849cade8c 100755 --- a/lib/bb/main.py +++ b/lib/bb/main.py @@ -247,6 +247,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): help="Run bitbake without a UI, only starting a server " "(cooker) process.") + parser.add_option("", "--foreground", action="store_true", + help="Run bitbake server in foreground.") + parser.add_option("-B", "--bind", action="store", dest="bind", default=False, help="The name/address for the bitbake server to bind to.") @@ -357,7 +360,8 @@ def start_server(servermodule, configParams, configuration, features): if isinstance(event, logging.LogRecord): logger.handle(event) raise - server.detach() + if not configParams.foreground: + server.detach() cooker.lock.close() return server @@ -398,6 +402,10 @@ def bitbake_main(configParams, configuration): ("the BBSERVER environment variable" if "BBSERVER" in os.environ \ else "the '--remote-server' option")) + elif configParams.foreground: + raise BBMainException("FATAL: The '--foreground' option can only be used " + "with --server-only.\n") + if configParams.bind and configParams.servertype != "xmlrpc": raise BBMainException("FATAL: If '-B' or '--bind' is defined, we must " "set the servertype as 'xmlrpc'.\n") @@ -495,6 +503,8 @@ def bitbake_main(configParams, configuration): else: print("Bitbake server address: %s, server port: %s" % (server.serverImpl.host, server.serverImpl.port)) + if configParams.foreground: + server.serverImpl.serve_forever() return 0 return 1 |