data += "&action=%s" % (action,)
if action == "set":
- data += "&key=%s&val=%s" % (sys.argv[2], sys.argv[3])
+ key = sys.argv[2]
+ val = ""
+ for i in sys.argv[3:]:
+ if len(val):
+ val += " "
+ val += i
+ data += "&key=%s&val=%s" % (key, val)
elif action == "error":
LOGFILE = os.environ["LOGFILE"]
f.close()
data += "&log=%s" % (log,)
-###############################################################################
-# Create urlgrabber instance #
-###############################################################################
g = URLGrabber(user_agent = "IPFireBuildSpy/3.x",)
try:
gobj = g.urlread(URL, data=data)
sys.exit(1)
sys.exit(0)
-
-###############################################################################
--- /dev/null
+#!/bin/bash
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+# A small helper to make the git functions comfortable #
+# #
+###############################################################################
+
+build_spy() {
+ python $BASEDIR/tools/buildspy $* >/dev/null 2>&1 &
+} # End of build_spy
+
+build_spy_send_profile() {
+ MEM_SIZE=$[ $(grep "^MemTotal:" /proc/meminfo | awk '{ print $2 }') * 1024 ]
+
+ CPU_CNT=$(grep "^processor" < /proc/cpuinfo | wc -l)
+ CPU_MHZ=$(grep "^cpu MHz" --max-count=1 /proc/cpuinfo | awk -F': ' '{ print $2 }')
+ CPU_MIPS=$[ $(grep "^bogomips" --max-count=1 /proc/cpuinfo | awk '{ print $3 }' | awk -F. '{ print $1 }') * ${CPU_CNT} ]
+ CPU_NAME=$(grep "^vendor_id" --max-count=1 /proc/cpuinfo | awk -F': ' '{ print $2 }' | tr '\n' ' '; \
+ grep "^model name" --max-count=1 /proc/cpuinfo | awk -F': ' '{ print $2 }')
+
+ build_spy set hostname $(hostname -f || hostname)
+ sleep 1
+ build_spy set cpu_mhz $CPU_MHZ
+ sleep 1
+ build_spy set cpu_mips $CPU_MIPS
+ sleep 1
+ build_spy set cpu_name $CPU_NAME
+ sleep 1
+ build_spy set mem_size $MEM_SIZE
+ sleep 1
+ build_spy set distcc ${DISTCC_PORT-3632}
+}
# #
################################################################################
+. $BASEDIR/tools/make-buildspy
+
evaluate() {
if [ "$?" -eq "0" ]; then
beautify message DONE
exit 1
} # End of exiterror()
-build_spy() {
- UUID=${UUID} LOGFILE=${LOGFILE} \
- python $BASEDIR/tools/buildspy $* >/dev/null 2>&1 &
-} # End of build_spy
-
################################################################################
# This is the function that sets the environment of a chroot and enters it #
################################################################################
echo -ne "Building for ${BOLD}${TARGET} (${MACHINE}) on ${MACHINE_REAL}${NORMAL}\n"
- build_spy set hostname $(hostname -f)
+ build_spy_send_profile &
build_spy compiling
if [ -f $BASEDIR/log_${MACHINE}/02_base/stage2-LFS ]; then