[bitbake-devel] [PATCH] toaster: set INHERIT var in the script that starts toaster
Cristiana Voicu
cristiana.voicu at intel.com
Mon Oct 28 11:28:16 UTC 2013
In order to use toaster, now you have to set INHERIT+="toaster buildhistory"
To keep it simple, I've done some changes in order to automate it. When toaster
is started, this line is added to local.conf. When it is stoped, it is removed.
Signed-off-by: Cristiana Voicu <cristiana.voicu at intel.com>
---
bitbake/bin/toaster | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 16de52b..639b7b7 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -49,6 +49,21 @@ function webserverStartAll()
return $retval
}
+#Helper functions to add/remove a line from a configuration file
+
+function addtoConfiguration()
+{
+ echo "#added by toaster" >> ${BUILDDIR}/conf/$2
+ echo $1 >> ${BUILDDIR}/conf/$2
+}
+
+function removefromConfiguration()
+{
+ comment_line=$(grep -n "#added by toaster" "$file" | cut -f1 -d:)
+ variable_line=$((comment_line+1))
+ lines="${comment_line},${variable_line}"
+ sed -i "$lines"'d' ${BUILDDIR}/conf/$1
+}
# We make sure we're running in the current shell and in a good environment
@@ -120,6 +135,7 @@ fi
case $CMD in
start )
+ addtoConfiguration "INHERIT+=\"toaster buildhistory\"" local.conf
webserverStartAll || return 4
unset BBSERVER
bitbake --server-only -t xmlrpc -B localhost:8200
@@ -138,6 +154,7 @@ case $CMD in
webserverKillAll
# force stop any misbehaving bitbake server
lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
+ removefromConfiguration local.conf
;;
esac
--
1.7.9.5
More information about the bitbake-devel
mailing list