summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbitbake/bin/bitbake17
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py6
2 files changed, 17 insertions, 6 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 6da4980e5d..c06d4e8176 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -168,6 +168,8 @@ Default BBFILES are the .bb files in the current directory.""")
168 parser.add_option("", "--server-only", help = "Run bitbake without UI, the frontend can connect with bitbake server itself", 168 parser.add_option("", "--server-only", help = "Run bitbake without UI, the frontend can connect with bitbake server itself",
169 action = "store_true", dest = "server_only", default = False) 169 action = "store_true", dest = "server_only", default = False)
170 170
171 parser.add_option("-B", "--bind", help = "The name/address for the bitbake server to bind to",
172 action = "store", dest = "bind", default = False)
171 options, args = parser.parse_args(sys.argv) 173 options, args = parser.parse_args(sys.argv)
172 174
173 configuration = BBConfiguration(options) 175 configuration = BBConfiguration(options)
@@ -189,8 +191,14 @@ Default BBFILES are the .bb files in the current directory.""")
189 sys.exit("FATAL: Invalid server type '%s' specified.\n" 191 sys.exit("FATAL: Invalid server type '%s' specified.\n"
190 "Valid interfaces: xmlrpc, process [default], none." % servertype) 192 "Valid interfaces: xmlrpc, process [default], none." % servertype)
191 193
192 if configuration.server_only and configuration.servertype != "xmlrpc": 194 if configuration.server_only:
193 sys.exit("FATAL: If '--server-only' is defined, we must set the servertype as 'xmlrpc'.\n") 195 if configuration.servertype != "xmlrpc":
196 sys.exit("FATAL: If '--server-only' is defined, we must set the servertype as 'xmlrpc'.\n")
197 if not configuration.bind:
198 sys.exit("FATAL: The '--server-only' option requires a name/address to bind to with the -B option.\n")
199
200 if configuration.bind and configuration.servertype != "xmlrpc":
201 sys.exit("FATAL: If '-B' or '--bind' is defined, we must set the servertype as 'xmlrpc'.\n")
194 202
195 # Save a logfile for cooker into the current working directory. When the 203 # Save a logfile for cooker into the current working directory. When the
196 # server is daemonized this logfile will be truncated. 204 # server is daemonized this logfile will be truncated.
@@ -212,8 +220,11 @@ Default BBFILES are the .bb files in the current directory.""")
212 bb.utils.clean_environment() 220 bb.utils.clean_environment()
213 221
214 server = server.BitBakeServer() 222 server = server.BitBakeServer()
223 if configuration.bind:
224 server.initServer((configuration.bind, 0))
225 else:
226 server.initServer()
215 227
216 server.initServer()
217 idle = server.getServerIdleCB() 228 idle = server.getServerIdleCB()
218 229
219 cooker = bb.cooker.BBCooker(configuration, idle, initialenv) 230 cooker = bb.cooker.BBCooker(configuration, idle, initialenv)
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index b5980c6084..c53cee488a 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -163,7 +163,7 @@ class BitBakeXMLRPCServer(SimpleXMLRPCServer):
163 # remove this when you're done with debugging 163 # remove this when you're done with debugging
164 # allow_reuse_address = True 164 # allow_reuse_address = True
165 165
166 def __init__(self, interface = ("localhost", 0)): 166 def __init__(self, interface):
167 """ 167 """
168 Constructor 168 Constructor
169 """ 169 """
@@ -267,8 +267,8 @@ class BitBakeServerConnection():
267 pass 267 pass
268 268
269class BitBakeServer(object): 269class BitBakeServer(object):
270 def initServer(self): 270 def initServer(self, interface = ("localhost", 0)):
271 self.server = BitBakeXMLRPCServer() 271 self.server = BitBakeXMLRPCServer(interface)
272 272
273 def addcooker(self, cooker): 273 def addcooker(self, cooker):
274 self.cooker = cooker 274 self.cooker = cooker