diff options
| -rwxr-xr-x | bitbake/bin/toaster | 5 | ||||
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/bbcontroller.py | 16 | ||||
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 11 | ||||
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 3 |
4 files changed, 26 insertions, 9 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index 4f25293e73..85a2575a66 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster | |||
| @@ -175,6 +175,11 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th | |||
| 175 | exit 1; | 175 | exit 1; |
| 176 | fi | 176 | fi |
| 177 | 177 | ||
| 178 | if [ "x`which daemon`" == "x" ]; then | ||
| 179 | echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program." 1>&2; | ||
| 180 | exit 1; | ||
| 181 | fi | ||
| 182 | |||
| 178 | # Define a fake builddir where only the pid files are actually created. No real builds will take place here. | 183 | # Define a fake builddir where only the pid files are actually created. No real builds will take place here. |
| 179 | BUILDDIR=/tmp | 184 | BUILDDIR=/tmp |
| 180 | RUNNING=1 | 185 | RUNNING=1 |
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() |
