All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] toaster: Add support for custom script and use toaster-bblayers.conf
@ 2016-11-17  9:06 Sujith Haridasan
  0 siblings, 0 replies; 4+ messages in thread
From: Sujith Haridasan @ 2016-11-17  9:06 UTC (permalink / raw)
  To: toaster

The following changes since commit 6eec988c6a5f276a78b3c2de9aa231c8b0097d20:

  toaster: layerindex updater Take into account layers being predefined (2016-11-09 18:26:41 -0800)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib sujith/toaster-use-custom-build-scriptsV2
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sujith/toaster-use-custom-build-scriptsV2

Sujith H (2):
  toaster: localhostbecontroller accept custom init script for build
  toaster: localhostbecontroller write toaster layers for project to
    toaster-bblayers.conf

 .../toaster/bldcontrol/localhostbecontroller.py    | 27 +++++++++-------------
 1 file changed, 11 insertions(+), 16 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 0/2] toaster: Add support for custom script and use toaster-bblayers.conf
@ 2016-11-17  9:09 Sujith H
  2016-11-17  9:09 ` [PATCH 1/2] toaster: localhostbecontroller accept custom init script for build Sujith H
  2016-11-17  9:09 ` [PATCH 2/2] toaster: localhostbecontroller write toaster layers for project to toaster-bblayers.conf Sujith H
  0 siblings, 2 replies; 4+ messages in thread
From: Sujith H @ 2016-11-17  9:09 UTC (permalink / raw)
  To: toaster

The following changes since commit 6eec988c6a5f276a78b3c2de9aa231c8b0097d20:

  toaster: layerindex updater Take into account layers being predefined (2016-11-09 18:26:41 -0800)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib sujith/toaster-use-custom-build-scriptsV2
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sujith/toaster-use-custom-build-scriptsV2

Sujith H (2):
  toaster: localhostbecontroller accept custom init script for build
  toaster: localhostbecontroller write toaster layers for project to
    toaster-bblayers.conf

 .../toaster/bldcontrol/localhostbecontroller.py    | 27 +++++++++-------------
 1 file changed, 11 insertions(+), 16 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] toaster: localhostbecontroller accept custom init script for build
  2016-11-17  9:09 [PATCH 0/2] toaster: Add support for custom script and use toaster-bblayers.conf Sujith H
@ 2016-11-17  9:09 ` Sujith H
  2016-11-17  9:09 ` [PATCH 2/2] toaster: localhostbecontroller write toaster layers for project to toaster-bblayers.conf Sujith H
  1 sibling, 0 replies; 4+ messages in thread
From: Sujith H @ 2016-11-17  9:09 UTC (permalink / raw)
  To: toaster

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.

Signed-off-by: Sujith H <sujith.h@gmail.com>
---
 bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index e5f7c98..3896a82 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -27,7 +27,7 @@ import shutil
 from django.db import transaction
 from django.db.models import Q
 from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake
-from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer
+from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer, ToasterSetting
 import subprocess
 
 from toastermain import settings
@@ -277,7 +277,12 @@ class LocalhostBEController(BuildEnvironmentController):
         builddir = '%s-toaster-%d' % (self.be.builddir, bitbake.req.project.id)
         oe_init = os.path.join(self.pokydirname, 'oe-init-build-env')
         # init build environment
-        self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir),
+        try:
+            custom_script = ToasterSetting.objects.get(name="CUSTOM_BUILD_INIT_SCRIPT").value
+            custom_script = custom_script.replace("%BUILDDIR%" ,builddir)
+            self._shellcmd("bash -c 'source %s'" % (custom_script))
+        except ToasterSetting.DoesNotExist:
+            self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir),
                        self.be.sourcedir)
 
         # update bblayers.conf
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] toaster: localhostbecontroller write toaster layers for project to toaster-bblayers.conf
  2016-11-17  9:09 [PATCH 0/2] toaster: Add support for custom script and use toaster-bblayers.conf Sujith H
  2016-11-17  9:09 ` [PATCH 1/2] toaster: localhostbecontroller accept custom init script for build Sujith H
@ 2016-11-17  9:09 ` Sujith H
  1 sibling, 0 replies; 4+ messages in thread
From: Sujith H @ 2016-11-17  9:09 UTC (permalink / raw)
  To: toaster

Instead of updating conf/bblayers, here we update toaster-bblayers.conf
file. So extra effort to update bblayers.conf can be removed safely.

Signed-off-by: Sujith H <sujith.h@gmail.com>
---
 .../lib/toaster/bldcontrol/localhostbecontroller.py    | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 3896a82..11335ac 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -286,19 +286,8 @@ class LocalhostBEController(BuildEnvironmentController):
                        self.be.sourcedir)
 
         # update bblayers.conf
-        bblconfpath = os.path.join(builddir, "conf/bblayers.conf")
-        conflines = open(bblconfpath, "r").readlines()
-        skip = False
+        bblconfpath = os.path.join(builddir, "conf/toaster-bblayers.conf")
         with open(bblconfpath, 'w') as bblayers:
-            for line in conflines:
-                if line.startswith("# line added by toaster"):
-                    skip = True
-                    continue
-                if skip:
-                    skip = False
-                else:
-                    bblayers.write(line)
-
             bblayers.write('# line added by toaster build control\n'
                            'BBLAYERS = "%s"' % ' '.join(layers))
 
@@ -311,9 +300,10 @@ class LocalhostBEController(BuildEnvironmentController):
 
         # run bitbake server from the clone
         bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
-        self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s '
+        toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")
+        self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '
                        '--server-only -t xmlrpc -B 0.0.0.0:0\"' % (oe_init,
-                       builddir, bitbake, confpath), self.be.sourcedir)
+                       builddir, bitbake, confpath, toasterlayers), self.be.sourcedir)
 
         # read port number from bitbake.lock
         self.be.bbport = ""
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-17  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-17  9:09 [PATCH 0/2] toaster: Add support for custom script and use toaster-bblayers.conf Sujith H
2016-11-17  9:09 ` [PATCH 1/2] toaster: localhostbecontroller accept custom init script for build Sujith H
2016-11-17  9:09 ` [PATCH 2/2] toaster: localhostbecontroller write toaster layers for project to toaster-bblayers.conf Sujith H
  -- strict thread matches above, loose matches on Subject: below --
2016-11-17  9:06 [PATCH 0/2] toaster: Add support for custom script and use toaster-bblayers.conf Sujith Haridasan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.