summaryrefslogtreecommitdiffstats
path: root/bitbake/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-23 12:07:42 +0100
commit9bfe460934dd9bafcfab7bdf8cbbf7ad968e9026 (patch)
tree0dfeb6ce3e580a54c190d2f8ef1236aae321efb2 /bitbake/bin
parent52a67cc958185266f1b982555cf019a8b4f10817 (diff)
downloadpoky-9bfe460934dd9bafcfab7bdf8cbbf7ad968e9026.tar.gz
bitbake: 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] (Bitbake rev: 12a73f6914488029f2b9dd680e004fba7dde41af) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/toaster22
1 files changed, 20 insertions, 2 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index c2e33fe376..762451df23 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -24,6 +24,14 @@ Usage: source toaster start|stop [webport=<address:port>] [noweb]
24 [webport] Set the development server (default: localhost:8000) 24 [webport] Set the development server (default: localhost:8000)
25" 25"
26 26
27custom_extention()
28{
29 custom_extension=$BBBASEDIR/lib/toaster/orm/fixtures/custom_toaster_append.sh
30 if [ -f $custom_extension ] ; then
31 $custom_extension $*
32 fi
33}
34
27databaseCheck() 35databaseCheck()
28{ 36{
29 retval=0 37 retval=0
@@ -50,6 +58,11 @@ databaseCheck()
50webserverKillAll() 58webserverKillAll()
51{ 59{
52 local pidfile 60 local pidfile
61 if [ -f ${BUILDDIR}/.toastermain.pid ] ; then
62 custom_extention web_stop_postpend
63 else
64 custom_extention noweb_stop_postpend
65 fi
53 for pidfile in ${BUILDDIR}/.toastermain.pid ${BUILDDIR}/.runbuilds.pid; do 66 for pidfile in ${BUILDDIR}/.toastermain.pid ${BUILDDIR}/.runbuilds.pid; do
54 if [ -f ${pidfile} ]; then 67 if [ -f ${pidfile} ]; then
55 pid=`cat ${pidfile}` 68 pid=`cat ${pidfile}`
@@ -89,6 +102,7 @@ webserverStartAll()
89 else 102 else
90 echo "Toaster development webserver started at http://$ADDR_PORT" 103 echo "Toaster development webserver started at http://$ADDR_PORT"
91 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" 104 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"
105 custom_extention web_start_postpend $ADDR_PORT
92 fi 106 fi
93 107
94 return $retval 108 return $retval
@@ -168,7 +182,6 @@ fi
168unset OE_ROOT 182unset OE_ROOT
169 183
170 184
171
172WEBSERVER=1 185WEBSERVER=1
173ADDR_PORT="localhost:8000" 186ADDR_PORT="localhost:8000"
174unset CMD 187unset CMD
@@ -241,6 +254,7 @@ fi
241echo "The system will $CMD." 254echo "The system will $CMD."
242 255
243# Execute the commands 256# Execute the commands
257custom_extention toaster_prepend $CMD $ADDR_PORT
244 258
245case $CMD in 259case $CMD in
246 start ) 260 start )
@@ -262,9 +276,10 @@ case $CMD in
262 if [ ! -f "$TOASTER_DIR/toaster.sqlite" ] ; then 276 if [ ! -f "$TOASTER_DIR/toaster.sqlite" ] ; then
263 if ! databaseCheck; then 277 if ! databaseCheck; then
264 echo "Failed ${CMD}." 278 echo "Failed ${CMD}."
265 return 4 279 return 4
266 fi 280 fi
267 fi 281 fi
282 custom_extention noweb_start_postpend $ADDR_PORT
268 fi 283 fi
269 if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then 284 if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
270 echo "Failed ${CMD}." 285 echo "Failed ${CMD}."
@@ -278,6 +293,7 @@ case $CMD in
278 # set fail safe stop system on terminal exit 293 # set fail safe stop system on terminal exit
279 trap stop_system SIGHUP 294 trap stop_system SIGHUP
280 echo "Successful ${CMD}." 295 echo "Successful ${CMD}."
296 custom_extention toaster_postpend $CMD $ADDR_PORT
281 return 0 297 return 0
282 ;; 298 ;;
283 stop ) 299 stop )
@@ -285,3 +301,5 @@ case $CMD in
285 echo "Successful ${CMD}." 301 echo "Successful ${CMD}."
286 ;; 302 ;;
287esac 303esac
304custom_extention toaster_postpend $CMD $ADDR_PORT
305