]>
git.ipfire.org Git - ipfire-3.x.git/blob - tools/make-buildspy
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2008 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
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/>. #
20 ###############################################################################
22 BUILD_SPY_FILENAME
=$BASEDIR/.build_spy
23 BUILD_SPY_PID
=$BUILD_SPY_FILENAME.pid
29 if [ "$COMMAND" = "start" ]; then
30 BASEDIR
=$BASEDIR UUID
=$UUID NAME
=$NAME VERSION
=$VERSION \
31 LOGFILE
="$BASEDIR/log_${TARGET}/_build.00-buildspy.log" \
32 $BASEDIR/tools
/make-buildspy
&
33 elif [ "$COMMAND" = "exit" ]; then
34 echo -n "BUILDSPY_EXIT " >> $BUILD_SPY_FILENAME
36 echo -n "${COMMAND}=$* " >> $BUILD_SPY_FILENAME
40 build_spy_send_profile
() {
41 build_spy target
${TARGET}
42 build_spy hostname
${HOSTNAME}
43 build_spy distcc
${DISTCC_PORT-3632}
44 build_spy
jobs ${DISTCC_JOBS}
45 build_spy cpu $
(grep ^model\ name
/proc
/cpuinfo |
head -n1 | \
46 awk -F: '{ print $2 }' |
$BASEDIR/tools
/base64
)
47 build_spy machine $
(uname
-m)
48 build_spy toolchain
"${NAME}-${TOOLCHAINVERSION}"
51 if [ "$(basename $0)" == "make-buildspy" ]; then
52 if [ -f "$BUILD_SPY_PID" ]; then
55 echo $$
> $BUILD_SPY_PID
58 DATA
+=$
(cat $BUILD_SPY_FILENAME 2>/dev
/null || true
)
61 for command in $DATA; do
62 if [ "$command" = "BUILDSPY_EXIT" ]; then
68 if [ -n "$DATA" ] && \
69 $BASEDIR/tools
/buildspy \
70 action
=set uuid
=$UUID $DATA >> $LOGFILE 2>&1; then
76 if [ "$BUILDSPY_EXIT" = "1" ]; then
82 rm -f $BUILD_SPY_FILENAME $BUILD_SPY_PID