summaryrefslogtreecommitdiffstats
path: root/bitbake
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
parentafe85485fe185b663a1285b5c27de3160bf06cf7 (diff)
downloadast2050-yocto-poky-2237c9fcaab289c68a92306602f92ca31313e533.zip
ast2050-yocto-poky-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')
-rwxr-xr-xbitbake/bin/toaster5
-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
4 files changed, 26 insertions, 9 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 4f25293..85a2575 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -175,6 +175,11 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th
exit 1;
fi
+ if [ "x`which daemon`" == "x" ]; then
+ echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program." 1>&2;
+ exit 1;
+ fi
+
# Define a fake builddir where only the pid files are actually created. No real builds will take place here.
BUILDDIR=/tmp
RUNNING=1
diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index dbfb2f3..cf3f1fd 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -140,25 +140,25 @@ class BuildEnvironmentController(object):
bblayerconffile.write("# line added by toaster build control\nBBLAYERS = \"" + " ".join(layerlist) + "\"")
bblayerconffile.close()
- def writePreConfFile(self, variable_list):
- prefilepath = os.path.join(self.be.builddir, "conf/toaster-pre.conf")
- with open(prefilepath, "w") as prefile:
- for i in variable_list:
- prefile.write("%s=\"%s\"\n" % (i.name, i.value))
+ def writeConfFile(self, variable_list = None, raw = None):
+ """ Writes a configuration file in the build directory. Override with buildenv-specific implementation. """
+ raise Exception("FIXME: Must override to actually write a configuration file")
- def startBBServer(self, brbe):
+
+ def startBBServer(self):
""" Starts a BB server with Toaster toasterui set up to record the builds, an no controlling UI.
After this method executes, self.be bbaddress/bbport MUST point to a running and free server,
and the bbstate MUST be updated to "started".
"""
- raise Exception("Must override in order to actually start the BB server")
+ raise Exception("FIXME: Must override in order to actually start the BB server")
def stopBBServer(self):
""" Stops the currently running BB server.
The bbstate MUST be updated to "stopped".
self.connection must be none.
"""
+ raise Exception("FIXME: Must override stoBBServer")
def setLayers(self, bbs, ls):
""" Checks-out bitbake executor and layers from git repositories.
@@ -168,7 +168,7 @@ class BuildEnvironmentController(object):
a word of attention: by convention, the first layer for any build will be poky!
"""
- raise Exception("Must override setLayers")
+ raise Exception("FIXME: Must override setLayers")
def getBBController(self):
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 980751f..47708d1 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -82,6 +82,17 @@ class LocalhostBEController(BuildEnvironmentController):
self._createdirpath(self.be.builddir)
self._shellcmd("bash -c \"source %s/oe-init-build-env %s\"" % (self.pokydirname, self.be.builddir))
+
+ def writeConfFile(self, file_name, variable_list = None, raw = None):
+ filepath = os.path.join(self.be.builddir, file_name)
+ with open(filepath, "w") as conffile:
+ if variable_list is not None:
+ for i in variable_list:
+ conffile.write("%s=\"%s\"\n" % (i.name, i.value))
+ if raw is not None:
+ conffile.write(raw)
+
+
def startBBServer(self):
assert self.pokydirname and os.path.exists(self.pokydirname)
assert self.islayerset
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 23ee855..3b539b5 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):
# set up the buid environment with the needed layers
bec.setLayers(br.brbitbake_set.all(), br.brlayer_set.all())
- bec.writePreConfFile(br.brvariable_set.all())
+ bec.writeConfFile("conf/toaster-pre.conf", br.brvariable_set.all())
+ bec.writeConfFile("conf/toaster.conf", raw = "INHERIT+=\"toaster buildhistory\"")
# get the bb server running with the build req id and build env id
bbctrl = bec.getBBController()
OpenPOWER on IntegriCloud