aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2015-05-18 15:06:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-19 11:45:24 +0100
commit1dd599ddfcdb547bee49bd7d86acddf64c675b42 (patch)
treebb2966c7aad594b37f52b298a95c26885c787b4f
parent9097bae469cb1e005092c11610d92e908b8f19f5 (diff)
downloadbitbake-1dd599ddfcdb547bee49bd7d86acddf64c675b42.tar.gz
toaster: Remove dependency on daemon application
The bitbake observer is now started using python subprocess. This should allow for toaster to run without installing the "daemon" application. [Yocto #7271] Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbin/toaster5
-rw-r--r--lib/toaster/bldcontrol/localhostbecontroller.py12
2 files changed, 9 insertions, 8 deletions
diff --git a/bin/toaster b/bin/toaster
index f5ee68ca2..18eba8ea0 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -183,11 +183,6 @@ if [ `basename \"$0\"` = `basename \"${SRCFILE}\"` ]; then
exit 1
fi
- if ! which daemon >/dev/null 2>&1; then
- echo -e "Failed dependency; toaster needs the 'daemon' program in order to be able to start builds'. Please install the 'daemon' program from your distribution repositories or http://www.libslack.org/daemon/" 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/toaster_$$
if [ -d "$BUILDDIR" ]; then
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index 95ba48197..dfe06f947 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -117,10 +117,11 @@ class LocalhostBEController(BuildEnvironmentController):
f.seek(0, 2) # jump to the end
toaster_ui_log_filelength = f.tell()
- cmd = "bash -c \"source %s/oe-init-build-env %s 2>&1 >toaster_server.log && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 2>&1 >toaster_server.log && DATABASE_URL=%s BBSERVER=0.0.0.0:-1 daemon -d -i -D %s -o toaster_ui.log -- %s --observe-only -u toasterui &\"" % (self.pokydirname, self.be.builddir,
- self.dburl, self.be.builddir, own_bitbake)
+ cmd = "bash -c \"source %s/oe-init-build-env %s 2>&1 >toaster_server.log && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 2>&1 >>toaster_server.log \"" % (self.pokydirname, self.be.builddir)
+
port = "-1"
logger.debug("localhostbecontroller: starting builder \n%s\n" % cmd)
+
cmdoutput = self._shellcmd(cmd)
with open(self.be.builddir + "/toaster_server.log", "r") as f:
for i in f.readlines():
@@ -128,6 +129,10 @@ class LocalhostBEController(BuildEnvironmentController):
port = i.split(" ")[-1]
logger.debug("localhostbecontroller: Found bitbake server port %s" % port)
+ cmd = "bash -c \"source %s/oe-init-build-env-memres -1 %s && DATABASE_URL=%s %s --observe-only -u toasterui --remote-server=0.0.0.0:-1 -t xmlrpc\"" % (self.pokydirname, self.be.builddir, self.dburl, own_bitbake)
+ with open(toaster_ui_log_filepath, "a+") as f:
+ p = subprocess.Popen(cmd, cwd = self.be.builddir, shell=True, stdout=f, stderr=f)
+
def _toaster_ui_started(filepath, filepos = 0):
if not os.path.exists(filepath):
return False
@@ -148,8 +153,9 @@ class LocalhostBEController(BuildEnvironmentController):
retries += 1
if not started:
+ toaster_ui_log = open(os.path.join(self.be.builddir, "toaster_ui.log"), "r").read()
toaster_server_log = open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read()
- raise BuildSetupException("localhostbecontroller: Bitbake server did not start in 5 seconds, aborting (Error: '%s' '%s')" % (cmdoutput, toaster_server_log))
+ raise BuildSetupException("localhostbecontroller: Bitbake server did not start in 5 seconds, aborting (Error: '%s' '%s')" % (toaster_ui_log, toaster_server_log))
logger.debug("localhostbecontroller: Started bitbake server")