summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-02 12:13:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-02 12:34:53 +0000
commit2237c9fcaab289c68a92306602f92ca31313e533 (patch)
treeeb5dab57e1c886f6a15c3a872b7638853432690d /bitbake/lib/toaster/bldcontrol
parentafe85485fe185b663a1285b5c27de3160bf06cf7 (diff)
downloadpoky-2237c9fcaab289c68a92306602f92ca31313e533.tar.gz
bitbake: toaster: proper setup for build configuration
This patch makes sure that all the toaster conf files are actually written from the build enviroment controllers. Additionally, toaster checks that the 'daemon' program, which is used to start the build system, is available (currently for localhost). [YOCTO #7171] (Bitbake rev: 0a1db7d1531f8254955e1152bcd8e6db4ec1d277) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol')
-rw-r--r--bitbake/lib/toaster/bldcontrol/bbcontroller.py16
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py11
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py3
3 files changed, 21 insertions, 9 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index dbfb2f3a04..cf3f1fde75 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -140,25 +140,25 @@ class BuildEnvironmentController(object):
140 bblayerconffile.write("# line added by toaster build control\nBBLAYERS = \"" + " ".join(layerlist) + "\"") 140 bblayerconffile.write("# line added by toaster build control\nBBLAYERS = \"" + " ".join(layerlist) + "\"")
141 bblayerconffile.close() 141 bblayerconffile.close()
142 142
143 def writePreConfFile(self, variable_list):
144 prefilepath = os.path.join(self.be.builddir, "conf/toaster-pre.conf")
145 with open(prefilepath, "w") as prefile:
146 for i in variable_list:
147 prefile.write("%s=\"%s\"\n" % (i.name, i.value))
148 143
144 def writeConfFile(self, variable_list = None, raw = None):
145 """ Writes a configuration file in the build directory. Override with buildenv-specific implementation. """
146 raise Exception("FIXME: Must override to actually write a configuration file")
149 147
150 def startBBServer(self, brbe): 148
149 def startBBServer(self):
151 """ Starts a BB server with Toaster toasterui set up to record the builds, an no controlling UI. 150 """ Starts a BB server with Toaster toasterui set up to record the builds, an no controlling UI.
152 After this method executes, self.be bbaddress/bbport MUST point to a running and free server, 151 After this method executes, self.be bbaddress/bbport MUST point to a running and free server,
153 and the bbstate MUST be updated to "started". 152 and the bbstate MUST be updated to "started".
154 """ 153 """
155 raise Exception("Must override in order to actually start the BB server") 154 raise Exception("FIXME: Must override in order to actually start the BB server")
156 155
157 def stopBBServer(self): 156 def stopBBServer(self):
158 """ Stops the currently running BB server. 157 """ Stops the currently running BB server.
159 The bbstate MUST be updated to "stopped". 158 The bbstate MUST be updated to "stopped".
160 self.connection must be none. 159 self.connection must be none.
161 """ 160 """
161 raise Exception("FIXME: Must override stoBBServer")
162 162
163 def setLayers(self, bbs, ls): 163 def setLayers(self, bbs, ls):
164 """ Checks-out bitbake executor and layers from git repositories. 164 """ Checks-out bitbake executor and layers from git repositories.
@@ -168,7 +168,7 @@ class BuildEnvironmentController(object):
168 168
169 a word of attention: by convention, the first layer for any build will be poky! 169 a word of attention: by convention, the first layer for any build will be poky!
170 """ 170 """
171 raise Exception("Must override setLayers") 171 raise Exception("FIXME: Must override setLayers")
172 172
173 173
174 def getBBController(self): 174 def getBBController(self):
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 980751fb96..47708d169a 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -82,6 +82,17 @@ class LocalhostBEController(BuildEnvironmentController):
82 self._createdirpath(self.be.builddir) 82 self._createdirpath(self.be.builddir)
83 self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, self.be.builddir)) 83 self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, self.be.builddir))
84 84
85
86 def writeConfFile(self, file_name, variable_list = None, raw = None):
87 filepath = os.path.join(self.be.builddir, file_name)
88 with open(filepath, "w") as conffile:
89 if variable_list is not None:
90 for i in variable_list:
91 conffile.write("%s=\"%s\"\n" % (i.name, i.value))
92 if raw is not None:
93 conffile.write(raw)
94
95
85 def startBBServer(self): 96 def startBBServer(self):
86 assert self.pokydirname and os.path.exists(self.pokydirname) 97 assert self.pokydirname and os.path.exists(self.pokydirname)
87 assert self.islayerset 98 assert self.islayerset
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 23ee855558..3b539b591a 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -56,7 +56,8 @@ class Command(NoArgsCommand):
56 56
57 # set up the buid environment with the needed layers 57 # set up the buid environment with the needed layers
58 bec.setLayers(br.brbitbake_set.all(), br.brlayer_set.all()) 58 bec.setLayers(br.brbitbake_set.all(), br.brlayer_set.all())
59 bec.writePreConfFile(br.brvariable_set.all()) 59 bec.writeConfFile("conf/toaster-pre.conf", br.brvariable_set.all())
60 bec.writeConfFile("conf/toaster.conf", raw = "INHERIT+=\"toaster buildhistory\"")
60 61
61 # get the bb server running with the build req id and build env id 62 # get the bb server running with the build req id and build env id
62 bbctrl = bec.getBBController() 63 bbctrl = bec.getBBController()