summaryrefslogtreecommitdiffstats
path: root/bin/bitbake
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-02-23 21:47:17 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-23 22:45:12 +0000
commit95b97d2dc6466ea3d99371f5b5bd68f6f3c99074 (patch)
tree8a9a51b34bf49a1bfb8073896549c688d57e1b9c /bin/bitbake
parent9020c2d4476766f63ff7e024bbd99043d06feefc (diff)
downloadbitbake-contrib-95b97d2dc6466ea3d99371f5b5bd68f6f3c99074.tar.gz
bitbake: add -B option to bind with interface
When start bitbake as a server only process, we need to assign certain interface to it. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-xbin/bitbake17
1 files changed, 14 insertions, 3 deletions
diff --git a/bin/bitbake b/bin/bitbake
index 6da4980e5..c06d4e817 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -168,6 +168,8 @@ Default BBFILES are the .bb files in the current directory.""")
parser.add_option("", "--server-only", help = "Run bitbake without UI, the frontend can connect with bitbake server itself",
action = "store_true", dest = "server_only", default = False)
+ parser.add_option("-B", "--bind", help = "The name/address for the bitbake server to bind to",
+ action = "store", dest = "bind", default = False)
options, args = parser.parse_args(sys.argv)
configuration = BBConfiguration(options)
@@ -189,8 +191,14 @@ Default BBFILES are the .bb files in the current directory.""")
sys.exit("FATAL: Invalid server type '%s' specified.\n"
"Valid interfaces: xmlrpc, process [default], none." % servertype)
- if configuration.server_only and configuration.servertype != "xmlrpc":
- sys.exit("FATAL: If '--server-only' is defined, we must set the servertype as 'xmlrpc'.\n")
+ if configuration.server_only:
+ if configuration.servertype != "xmlrpc":
+ sys.exit("FATAL: If '--server-only' is defined, we must set the servertype as 'xmlrpc'.\n")
+ if not configuration.bind:
+ sys.exit("FATAL: The '--server-only' option requires a name/address to bind to with the -B option.\n")
+
+ if configuration.bind and configuration.servertype != "xmlrpc":
+ sys.exit("FATAL: If '-B' or '--bind' is defined, we must set the servertype as 'xmlrpc'.\n")
# Save a logfile for cooker into the current working directory. When the
# server is daemonized this logfile will be truncated.
@@ -212,8 +220,11 @@ Default BBFILES are the .bb files in the current directory.""")
bb.utils.clean_environment()
server = server.BitBakeServer()
+ if configuration.bind:
+ server.initServer((configuration.bind, 0))
+ else:
+ server.initServer()
- server.initServer()
idle = server.getServerIdleCB()
cooker = bb.cooker.BBCooker(configuration, idle, initialenv)