diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-10-13 17:10:39 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-30 13:39:51 +0000 |
commit | 2837b110ae8fd5ff0ca3ac5959cadb7d4a5ce6cc (patch) | |
tree | fca7aba2e90cbcb6f3b11a90bb00665850fa2460 /bitbake/bin | |
parent | a0660718e6599538dd65cadadbc04c6adc951b57 (diff) | |
download | poky-2837b110ae8fd5ff0ca3ac5959cadb7d4a5ce6cc.tar.gz |
bitbake: toaster: change startup parameter passing to avoid race
We avoid a race between the setting the TOASTER_BRBE variable
and reading the variable in toaster ui by supplying the variable
at server startup time through the toaster.conf post-read file.
Additional small changes are included, including marking the
build request with the environment id of where the build took place.
(Bitbake rev: 7c333350418c4140e6c988c5272940f8057d327d)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/toaster | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index 75c7a076b1..6f5d98e331 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster | |||
@@ -83,8 +83,10 @@ function webserverStartAll() | |||
83 | 83 | ||
84 | function addtoConfiguration() | 84 | function addtoConfiguration() |
85 | { | 85 | { |
86 | echo "#Created by toaster start script" > ${BUILDDIR}/conf/$2 | 86 | file=$1 |
87 | echo $1 >> ${BUILDDIR}/conf/$2 | 87 | shift |
88 | echo "#Created by toaster start script" > ${BUILDDIR}/conf/$file | ||
89 | for var in "$@"; do echo $var >> ${BUILDDIR}/conf/$file; done | ||
88 | } | 90 | } |
89 | 91 | ||
90 | INSTOPSYSTEM=0 | 92 | INSTOPSYSTEM=0 |
@@ -196,6 +198,7 @@ fi | |||
196 | 198 | ||
197 | NOTOASTERUI=0 | 199 | NOTOASTERUI=0 |
198 | WEBSERVER=1 | 200 | WEBSERVER=1 |
201 | TOASTER_BRBE="" | ||
199 | for param in $*; do | 202 | for param in $*; do |
200 | case $param in | 203 | case $param in |
201 | noui ) | 204 | noui ) |
@@ -204,6 +207,8 @@ for param in $*; do | |||
204 | noweb ) | 207 | noweb ) |
205 | WEBSERVER=0 | 208 | WEBSERVER=0 |
206 | ;; | 209 | ;; |
210 | brbe=* ) | ||
211 | TOASTER_BRBE=$'\n'"TOASTER_BRBE=\""${param#*=}"\"" | ||
207 | esac | 212 | esac |
208 | done | 213 | done |
209 | 214 | ||
@@ -228,7 +233,7 @@ fi | |||
228 | case $CMD in | 233 | case $CMD in |
229 | start ) | 234 | start ) |
230 | start_success=1 | 235 | start_success=1 |
231 | addtoConfiguration "INHERIT+=\"toaster buildhistory\"" toaster.conf | 236 | addtoConfiguration toaster.conf "INHERIT+=\"toaster buildhistory\"" $TOASTER_BRBE |
232 | if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then | 237 | if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then |
233 | echo "Failed ${CMD}." | 238 | echo "Failed ${CMD}." |
234 | return 4 | 239 | return 4 |
@@ -248,10 +253,12 @@ case $CMD in | |||
248 | # set fail safe stop system on terminal exit | 253 | # set fail safe stop system on terminal exit |
249 | trap stop_system SIGHUP | 254 | trap stop_system SIGHUP |
250 | echo "Successful ${CMD}." | 255 | echo "Successful ${CMD}." |
256 | return 0 | ||
251 | else | 257 | else |
252 | # failed start, do stop | 258 | # failed start, do stop |
253 | stop_system | 259 | stop_system |
254 | echo "Failed ${CMD}." | 260 | echo "Failed ${CMD}." |
261 | return 1 | ||
255 | fi | 262 | fi |
256 | # stop system on terminal exit | 263 | # stop system on terminal exit |
257 | set -o monitor | 264 | set -o monitor |