summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-04-06 17:46:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:10:27 +0100
commitf77baec6dee958e4b0a78ceac1d4e253b7a8eb7a (patch)
treed3676d6072de055c87af3474a49e258bf0a4ed84 /bitbake
parent4127fef8ba500832cea6ee6f53424ad41fc01e44 (diff)
downloadpoky-f77baec6dee958e4b0a78ceac1d4e253b7a8eb7a.tar.gz
bitbake: toaster: don't start bitbake server
>From now on toaster script will not run bitbake server. It will be started by runbuilds and stopped after the build. (Bitbake rev: 3fbd8534149e87c5a5d1bc1691711cfca05cafd1) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/toaster67
1 files changed, 6 insertions, 61 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index d409554d13..6a85ae255c 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -17,7 +17,7 @@
17# You should have received a copy of the GNU General Public License 17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see http://www.gnu.org/licenses/. 18# along with this program. If not, see http://www.gnu.org/licenses/.
19 19
20# Usage: source toaster [start|stop|restart-bitbake] 20# Usage: source toaster [start|stop]
21# [webport=<port>] [noui] [noweb] 21# [webport=<port>] [noui] [noweb]
22 22
23# Helper function to kill a background toaster development server 23# Helper function to kill a background toaster development server
@@ -95,7 +95,6 @@ stop_system()
95 kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null 95 kill `cat ${BUILDDIR}/.toasterui.pid` 2>/dev/null
96 rm ${BUILDDIR}/.toasterui.pid 96 rm ${BUILDDIR}/.toasterui.pid
97 fi 97 fi
98 stop_bitbake
99 webserverKillAll 98 webserverKillAll
100 # unset exported variables 99 # unset exported variables
101 unset DATABASE_URL 100 unset DATABASE_URL
@@ -106,31 +105,6 @@ stop_system()
106 INSTOPSYSTEM=0 105 INSTOPSYSTEM=0
107} 106}
108 107
109start_bitbake() {
110 unset BBSERVER
111 bitbake --read conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0
112 if [ $? -ne 0 ]; then
113 echo "Bitbake server start failed"
114 return 1
115 fi
116 export BBSERVER=0.0.0.0:-1
117 export DATABASE_URL=`$MANAGE get-dburl`
118 # we start the TOASTERUI only if not inhibited
119 if [ $NOTOASTERUI -eq 0 ]; then
120 bitbake --observe-only -u toasterui --remote-server=$BBSERVER -t xmlrpc \
121 >>${BUILDDIR}/toaster_ui.log 2>&1 \
122 & echo $! >${BUILDDIR}/.toasterui.pid
123 fi
124 return 0
125}
126
127stop_bitbake() {
128 BBSERVER=0.0.0.0:-1 bitbake -m
129 unset BBSERVER
130 # force stop any misbehaving bitbake server
131 lsof -t bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
132}
133
134verify_prereq() { 108verify_prereq() {
135 # Verify Django version 109 # Verify Django version
136 reqfile=$(python -c "import os; print os.path.realpath('$BBBASEDIR/toaster-requirements.txt')") 110 reqfile=$(python -c "import os; print os.path.realpath('$BBBASEDIR/toaster-requirements.txt')")
@@ -229,15 +203,6 @@ if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then
229 return 1 203 return 1
230fi 204fi
231 205
232if [ "$1" = 'restart-bitbake' ] ; then
233 stop_bitbake
234 sleep 1
235 start_bitbake
236 rc=$?
237 sleep 3
238 return $rc
239fi
240
241verify_prereq || return 1 206verify_prereq || return 1
242 207
243# We make sure we're running in the current shell and in a good environment 208# We make sure we're running in the current shell and in a good environment
@@ -281,16 +246,6 @@ case $CMD in
281 $MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1 246 $MANAGE checksocket "0.0.0.0:$WEB_PORT" || return 1
282 fi 247 fi
283 248
284 # Make sure it's safe to start by checking bitbake lock
285 if [ -e $BUILDDIR/bitbake.lock ]; then
286 python -c "import fcntl; fcntl.flock(open(\"$BUILDDIR/bitbake.lock\"), fcntl.LOCK_EX|fcntl.LOCK_NB)" 2>/dev/null
287 if [ $? -ne 0 ] ; then
288 echo "Error: bitbake lock state error. File locks show that the system is on." 1>&2
289 echo "Please wait for the current build to finish, stop and then start the system again." 1>&2
290 return 3
291 fi
292 fi
293
294 # kill Toaster web server if it's alive 249 # kill Toaster web server if it's alive
295 if [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then 250 if [ -e $BUILDDIR/.toastermain.pid ] && kill -0 `cat $BUILDDIR/.toastermain.pid`; then
296 echo "Warning: bitbake appears to be dead, but the Toaster web server is running." 1>&2 251 echo "Warning: bitbake appears to be dead, but the Toaster web server is running." 1>&2
@@ -308,22 +263,12 @@ case $CMD in
308 echo "Failed ${CMD}." 263 echo "Failed ${CMD}."
309 return 4 264 return 4
310 fi 265 fi
311 start_bitbake 266 export DATABASE_URL=`$MANAGE get-dburl`
312 if [ $? -eq 0 ]; then 267 $MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid
313 $MANAGE runbuilds & echo $! >${BUILDDIR}/.runbuilds.pid 268 # set fail safe stop system on terminal exit
314 # set fail safe stop system on terminal exit
315 trap stop_system SIGHUP
316 echo "Successful ${CMD}."
317 return 0
318 else
319 # failed start, do stop
320 stop_system
321 echo "Failed ${CMD}."
322 return 1
323 fi
324 # stop system on terminal exit
325 set -o monitor
326 trap stop_system SIGHUP 269 trap stop_system SIGHUP
270 echo "Successful ${CMD}."
271 return 0
327 ;; 272 ;;
328 stop ) 273 stop )
329 stop_system 274 stop_system