[oe-commits] Jason Wessel : oe-init-build-env-memres: Add auto port functionality

git at git.openembedded.org git at git.openembedded.org
Mon Dec 2 11:27:27 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 9cf1ac73c4e35101a4f5c01a5e1c53f9d567bc58
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=9cf1ac73c4e35101a4f5c01a5e1c53f9d567bc58

Author: Jason Wessel <jason.wessel at windriver.com>
Date:   Mon Nov 25 15:21:29 2013 -0600

oe-init-build-env-memres: Add auto port functionality

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 at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 oe-init-build-env-memres | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/oe-init-build-env-memres b/oe-init-build-env-memres
index 687d5e1..0007998 100755
--- a/oe-init-build-env-memres
+++ b/oe-init-build-env-memres
@@ -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



More information about the Openembedded-commits mailing list