path: root/oe-init-build-env-memres
diff options
authorJason Wessel <jason.wessel@windriver.com>2013-11-25 15:21:28 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-02 11:27:36 +0000
commitd71059c86a8160f39af6ddfdd30c86835f4eb959 (patch)
tree47bfb0568e568d843692a14506f2a96503eeff49 /oe-init-build-env-memres
parent2e60ef7fe63974e443a9ddc25c5eb4249ec37963 (diff)
oe-init-build-env: Allow startup with and without memres
Use the bitbake --status-only and the fact that bitbake.lock will contain the host name and port to determine when to activate or shutdown the stay resident bitbake server. This allows a end developer to cleanly switch between the two ways to use bitbake as well as enter the memres bitbake server from multiple shells without starting the server if it is already running. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'oe-init-build-env-memres')
1 files changed, 18 insertions, 3 deletions
diff --git a/oe-init-build-env-memres b/oe-init-build-env-memres
index 79b91b751a..687d5e1225 100755
--- a/oe-init-build-env-memres
+++ b/oe-init-build-env-memres
@@ -54,6 +54,21 @@ else
unset OEROOT
unset BBPATH
-bitbake --server-only -t xmlrpc -B localhost:$port
-export BBSERVER=localhost:$port
-echo "Bitbake server started on port $port, use bitbake -m to shut it down"
+if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null ; then
+ BBSERVER=`cat bitbake.lock` bitbake --status-only
+ res=$?
+if [ $res != 0 ] ; then
+ bitbake --server-only -t xmlrpc -B localhost:$port
+export BBSERVER=`cat bitbake.lock`
+if [ $res = 0 ] ; then
+ echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
+ echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
+unset res