summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2013-11-25 15:21:28 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-02 11:28:27 +0000
commit644a1a27eca40a3c563e65e975b9b48a98a20a24 (patch)
treec56f7162e5cf25fd256949f26c98dc29dcafccfe
parenta6b55d9d831fa0b5bf8ec2f6a6f988ee5addd242 (diff)
downloadpoky-644a1a27eca40a3c563e65e975b9b48a98a20a24.tar.gz
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. (From OE-Core rev: d71059c86a8160f39af6ddfdd30c86835f4eb959) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xoe-init-build-env9
-rwxr-xr-xoe-init-build-env-memres21
2 files changed, 27 insertions, 3 deletions
diff --git a/oe-init-build-env b/oe-init-build-env
index de9692fe44..8ef32f3d55 100755
--- a/oe-init-build-env
+++ b/oe-init-build-env
@@ -47,3 +47,12 @@ else
47 unset BBPATH 47 unset BBPATH
48fi 48fi
49 49
50# Shutdown any bitbake server if the BBSERVER variable is not set
51if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then
52 grep ":" bitbake.lock > /dev/null && BBSERVER=`cat bitbake.lock` bitbake --status-only
53 if [ $? = 0 ] ; then
54 echo "Shutting down bitbake memory resident server with bitbake -m"
55 BBSERVER=`cat bitbake.lock` bitbake -m
56 fi
57fi
58
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
54 unset OEROOT 54 unset OEROOT
55 unset BBPATH 55 unset BBPATH
56fi 56fi
57bitbake --server-only -t xmlrpc -B localhost:$port 57res=1
58export BBSERVER=localhost:$port 58if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null ; then
59echo "Bitbake server started on port $port, use bitbake -m to shut it down" 59 BBSERVER=`cat bitbake.lock` bitbake --status-only
60 res=$?
61fi
62
63if [ $res != 0 ] ; then
64 bitbake --server-only -t xmlrpc -B localhost:$port
65fi
66
67export BBSERVER=`cat bitbake.lock`
68
69if [ $res = 0 ] ; then
70 echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
71else
72 echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
73fi
74unset res