diff options
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py')
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index 291624625b..6142f7e004 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | |||
| @@ -24,6 +24,7 @@ import os | |||
| 24 | import sys | 24 | import sys |
| 25 | import re | 25 | import re |
| 26 | import shutil | 26 | import shutil |
| 27 | import time | ||
| 27 | from django.db import transaction | 28 | from django.db import transaction |
| 28 | from django.db.models import Q | 29 | from django.db.models import Q |
| 29 | from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake | 30 | from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake |
| @@ -331,12 +332,22 @@ class LocalhostBEController(BuildEnvironmentController): | |||
| 331 | bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake') | 332 | bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake') |
| 332 | toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf") | 333 | toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf") |
| 333 | self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s ' | 334 | self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s ' |
| 334 | '--server-only -t xmlrpc -B 0.0.0.0:0\"' % (oe_init, | 335 | '--server-only -B 0.0.0.0:0\"' % (oe_init, |
| 335 | builddir, bitbake, confpath, toasterlayers), self.be.sourcedir) | 336 | builddir, bitbake, confpath, toasterlayers), self.be.sourcedir) |
| 336 | 337 | ||
| 337 | # read port number from bitbake.lock | 338 | # read port number from bitbake.lock |
| 338 | self.be.bbport = "" | 339 | self.be.bbport = "" |
| 339 | bblock = os.path.join(builddir, 'bitbake.lock') | 340 | bblock = os.path.join(builddir, 'bitbake.lock') |
| 341 | # allow 10 seconds for bb lock file to appear but also be populated | ||
| 342 | for lock_check in range(10): | ||
| 343 | if not os.path.exists(bblock): | ||
| 344 | logger.debug("localhostbecontroller: waiting for bblock file to appear") | ||
| 345 | time.sleep(1) | ||
| 346 | continue | ||
| 347 | if 10 < os.stat(bblock).st_size: | ||
| 348 | break | ||
| 349 | logger.debug("localhostbecontroller: waiting for bblock content to appear") | ||
| 350 | time.sleep(1) | ||
| 340 | with open(bblock) as fplock: | 351 | with open(bblock) as fplock: |
| 341 | for line in fplock: | 352 | for line in fplock: |
| 342 | if ":" in line: | 353 | if ":" in line: |
| @@ -365,10 +376,10 @@ class LocalhostBEController(BuildEnvironmentController): | |||
| 365 | log = os.path.join(builddir, 'toaster_ui.log') | 376 | log = os.path.join(builddir, 'toaster_ui.log') |
| 366 | local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')), | 377 | local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')), |
| 367 | 'bitbake') | 378 | 'bitbake') |
| 368 | self._shellcmd(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:-1" ' | 379 | self._shellcmd(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" ' |
| 369 | '%s %s -u toasterui --token="" >>%s 2>&1;' | 380 | '%s %s -u toasterui --token="" >>%s 2>&1;' |
| 370 | 'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:-1 %s -m)&\"' \ | 381 | 'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:%s %s -m)&\"' \ |
| 371 | % (brbe, local_bitbake, bbtargets, log, bitbake)], | 382 | % (brbe, self.be.bbport, local_bitbake, bbtargets, log, self.be.bbport, bitbake)], |
| 372 | builddir, nowait=True) | 383 | builddir, nowait=True) |
| 373 | 384 | ||
| 374 | logger.debug('localhostbecontroller: Build launched, exiting. ' | 385 | logger.debug('localhostbecontroller: Build launched, exiting. ' |
