aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2017-08-20 18:01:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-22 19:49:31 +0100
commit12a73f6914488029f2b9dd680e004fba7dde41af (patch)
treeb733496fc69bcc78e9e220f8ef159626529c601f /bin
parentbcd68fd7231f166baff875fb88e4f9ce0d9bf91d (diff)
downloadbitbake-12a73f6914488029f2b9dd680e004fba7dde41af.tar.gz
Toaster: custom start and stop actions
Toaster needs the ability to allow custom extensions to execute when Toaster is started and stopped. Toaster will look for a custom extension script in the fixtures directory and execute any applicable hooks. [YOCTO #11938] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/toaster22
1 files changed, 20 insertions, 2 deletions
diff --git a/bin/toaster b/bin/toaster
index c2e33fe37..762451df2 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -24,6 +24,14 @@ Usage: source toaster start|stop [webport=<address:port>] [noweb]
[webport] Set the development server (default: localhost:8000)
"
+custom_extention()
+{
+ custom_extension=$BBBASEDIR/lib/toaster/orm/fixtures/custom_toaster_append.sh
+ if [ -f $custom_extension ] ; then
+ $custom_extension $*
+ fi
+}
+
databaseCheck()
{
retval=0
@@ -50,6 +58,11 @@ databaseCheck()
webserverKillAll()
{
local pidfile
+ if [ -f ${BUILDDIR}/.toastermain.pid ] ; then
+ custom_extention web_stop_postpend
+ else
+ custom_extention noweb_stop_postpend
+ fi
for pidfile in ${BUILDDIR}/.toastermain.pid ${BUILDDIR}/.runbuilds.pid; do
if [ -f ${pidfile} ]; then
pid=`cat ${pidfile}`
@@ -89,6 +102,7 @@ webserverStartAll()
else
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"
+ custom_extention web_start_postpend $ADDR_PORT
fi
return $retval
@@ -168,7 +182,6 @@ fi
unset OE_ROOT
-
WEBSERVER=1
ADDR_PORT="localhost:8000"
unset CMD
@@ -241,6 +254,7 @@ fi
echo "The system will $CMD."
# Execute the commands
+custom_extention toaster_prepend $CMD $ADDR_PORT
case $CMD in
start )
@@ -262,9 +276,10 @@ case $CMD in
if [ ! -f "$TOASTER_DIR/toaster.sqlite" ] ; then
if ! databaseCheck; then
echo "Failed ${CMD}."
- return 4
+ return 4
fi
fi
+ custom_extention noweb_start_postpend $ADDR_PORT
fi
if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
echo "Failed ${CMD}."
@@ -278,6 +293,7 @@ case $CMD in
# set fail safe stop system on terminal exit
trap stop_system SIGHUP
echo "Successful ${CMD}."
+ custom_extention toaster_postpend $CMD $ADDR_PORT
return 0
;;
stop )
@@ -285,3 +301,5 @@ case $CMD in
echo "Successful ${CMD}."
;;
esac
+custom_extention toaster_postpend $CMD $ADDR_PORT
+