]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-init-build-env-memres: Add auto port functionality
authorJason Wessel <jason.wessel@windriver.com>
Mon, 25 Nov 2013 21:21:29 +0000 (15:21 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Dec 2013 11:27:46 +0000 (11:27 +0000)
In order to run multiple bitbake memory resident servers on the same
machine they must each use different ports.

This patch works in conjuction with bitbake to make the auto port
selection and lazy server startup the default.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-init-build-env-memres

index 687d5e1225e29a0d164607d91c6eef038fd9ee06..00079989dc600319b88035b003e3cf05e90edc76 100755 (executable)
@@ -26,8 +26,8 @@
 # to sourcing this script.
 #
 if [ -z "$1" ]; then
-    echo "No port specified, using 12345"
-    port=12345
+    echo "No port specified, using dynamically selected port"
+    port=-1
 else
     port=$1
     shift
@@ -60,15 +60,20 @@ if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null ; then
     res=$?
 fi
 
-if [ $res != 0 ] ; then
-    bitbake --server-only -t xmlrpc -B localhost:$port
-fi
+if [ $port = -1 ] ; then
+    export BBSERVER=localhost:-1
+    echo "Bitbake server started on demand as needed, use bitbake -m to shut it down"
+else
+    if [ $res != 0 ] ; then
+       bitbake --server-only -t xmlrpc -B localhost:$port
+    fi
 
-export BBSERVER=`cat bitbake.lock`
+    export BBSERVER=`cat bitbake.lock`
 
-if [ $res = 0 ] ; then
-    echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
-else
-    echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
+    if [ $res = 0 ] ; then
+       echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
+    else
+       echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
+    fi
+    unset res
 fi
-unset res