diff options
author | Sujith H <sujith.h@gmail.com> | 2016-11-24 11:19:58 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-30 15:48:10 +0000 |
commit | 5f0405abed7c69d0409c83522f98d734647d666a (patch) | |
tree | 6ab1d0b39366b5f886444e1896e21bcee1d60bd3 /bitbake/lib/toaster/bldcontrol | |
parent | c57533b83bd45ae76787ceba1f9f08284ffe6fd5 (diff) | |
download | poky-5f0405abed7c69d0409c83522f98d734647d666a.tar.gz |
bitbake: toaster: localhostbecontroller accept custom init script for build
When passed variable CUSTOM_BUILD_INIT_SCRIPT to toaster
setting, it would be nice to use it. Else toaster
can use oe-init script. This gives an oppurtunity to
use customized build init scritps.
(Bitbake rev: 9d168bb5f05453bdb7156793eea25da0a3119b4d)
Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index e5f7c988c2..3896a829a9 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | |||
@@ -27,7 +27,7 @@ import shutil | |||
27 | from django.db import transaction | 27 | from django.db import transaction |
28 | from django.db.models import Q | 28 | from django.db.models import Q |
29 | from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake | 29 | from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake |
30 | from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer | 30 | from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer, ToasterSetting |
31 | import subprocess | 31 | import subprocess |
32 | 32 | ||
33 | from toastermain import settings | 33 | from toastermain import settings |
@@ -277,7 +277,12 @@ class LocalhostBEController(BuildEnvironmentController): | |||
277 | builddir = '%s-toaster-%d' % (self.be.builddir, bitbake.req.project.id) | 277 | builddir = '%s-toaster-%d' % (self.be.builddir, bitbake.req.project.id) |
278 | oe_init = os.path.join(self.pokydirname, 'oe-init-build-env') | 278 | oe_init = os.path.join(self.pokydirname, 'oe-init-build-env') |
279 | # init build environment | 279 | # init build environment |
280 | self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir), | 280 | try: |
281 | custom_script = ToasterSetting.objects.get(name="CUSTOM_BUILD_INIT_SCRIPT").value | ||
282 | custom_script = custom_script.replace("%BUILDDIR%" ,builddir) | ||
283 | self._shellcmd("bash -c 'source %s'" % (custom_script)) | ||
284 | except ToasterSetting.DoesNotExist: | ||
285 | self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir), | ||
281 | self.be.sourcedir) | 286 | self.be.sourcedir) |
282 | 287 | ||
283 | # update bblayers.conf | 288 | # update bblayers.conf |