aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-04-21 14:22:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-06 10:12:17 +0100
commit93853e06fba4a1f09a3cceac344f1341b177a5b3 (patch)
treeeb0f409df75eb7fb29edada898c1a4feed523571 /bitbake
parent4446b351388825820ce2ef634383368920648bce (diff)
downloadopenembedded-core-contrib-93853e06fba4a1f09a3cceac344f1341b177a5b3.tar.gz
bitbake: toaster: bin/toaster Add ability to specify port and address to bind to
Allow binding to a specified address and port to start the django development server on. Remove the assumption that you want to bind to 0.0.0.0 and set the default to localhost. Add some additional help text after Toaster webserver has started (Bitbake rev: ef3c88a57313947feb5ef08c4fea6fd110cde1e7) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/toaster18
1 files changed, 13 insertions, 5 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 2d07255d9b..9540fc9e6c 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -69,7 +69,7 @@ webserverStartAll()
echo "Starting webserver..."
- $MANAGE runserver "0.0.0.0:$WEB_PORT" \
+ $MANAGE runserver "$ADDR_PORT" \
</dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
& echo $! >${BUILDDIR}/.toastermain.pid
@@ -79,7 +79,8 @@ webserverStartAll()
retval=1
rm "${BUILDDIR}/.toastermain.pid"
else
- echo "Webserver address: http://0.0.0.0:$WEB_PORT/"
+ echo "Toaster development webserver started at http://$ADDR_PORT"
+ echo -e "\nYou can now run 'bitbake <target>' on the command line and monitor your build in Toaster.\nYou can also use a Toaster project to configure and run a build.\n"
fi
return $retval
@@ -180,7 +181,7 @@ fi
export TOASTER_DIR=`pwd`
WEBSERVER=1
-WEB_PORT="8000"
+ADDR_PORT="localhost:8000"
unset CMD
for param in $*; do
case $param in
@@ -194,7 +195,14 @@ for param in $*; do
CMD=$param
;;
webport=*)
- WEB_PORT="${param#*=}"
+ ADDR_PORT="${param#*=}"
+ # Split the addr:port string
+ ADDR=`echo $ADDR_PORT | cut -f 1 -d ':'`
+ PORT=`echo $ADDR_PORT | cut -f 2 -d ':'`
+ # If only a port has been speified then set address to localhost.
+ if [ $ADDR = $PORT ] ; then
+ ADDR_PORT="localhost:$PORT"
+ fi
;;
*)
echo "$HELP"
@@ -247,7 +255,7 @@ case $CMD in
start )
# check if addr:port is not in use
if [ "$CMD" == 'start' ]; then
- $MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1
+ $MANAGE checksocket "$ADDR_PORT" || return 1
fi
# kill Toaster web server if it's alive