From: Michael Tremer Date: Wed, 8 Jul 2009 19:43:47 +0000 (+0200) Subject: A hand of fixes on icecream. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94b1893ed6eabd28dbecfdd551eb47aaac794388;p=ipfire-3.x.git A hand of fixes on icecream. --- diff --git a/make.sh b/make.sh index 8c8ad8a08..bb6c94d17 100755 --- a/make.sh +++ b/make.sh @@ -50,9 +50,14 @@ toolchain_build() { # We can't skip packages in toolchain stage SAVE_SKIP_PACKAGE_LIST=$SKIP_PACKAGE_LIST SKIP_PACKAGE_LIST= + + # Disable icecc in here + SAVE_ICECC=$ICECC + ICECC=off + iceccd_stop toolchain_make stage1 - # make distcc first so that CCACHE_PREFIX works immediately + # make icecc first so that CCACHE_PREFIX works immediately toolchain_make icecc toolchain_make ccache toolchain_make binutils PASS=1 @@ -65,6 +70,15 @@ toolchain_build() { toolchain_make gcc PASS=2 toolchain_make binutils PASS=2 toolchain_make test-toolchain PASS=2 + + ICECC=$SAVE_ICECC + unset SAVE_ICECC + + ICECC_CC="${TOOLS_DIR}/bin/gcc" \ + ICECC_CXX="${TOOLS_DIR}/bin/g++" \ + icecc_build_native ${ICECC_TOOLCHAIN} + iceccd_start + toolchain_make ncurses toolchain_make attr toolchain_make acl @@ -93,10 +107,6 @@ toolchain_build() { toolchain_make xz toolchain_make strip - ICECC_CC="${TOOLS_DIR}/bin/gcc" \ - ICECC_CXX="${TOOLS_DIR}/bin/g++" \ - icecc_build_native ${ICECC_TOOLCHAIN} - export PATH=$ORG_PATH SKIP_PACKAGE_LIST=$SAVE_SKIP_PACKAGE_LIST unset SAVE_SKIP_PACKAGE_LIST } diff --git a/tools/make-cluster b/tools/make-cluster index d9a34978b..bc131bef7 100644 --- a/tools/make-cluster +++ b/tools/make-cluster @@ -34,7 +34,7 @@ function iceccd_start() { return fi local toolchain=${1} - ICECC_VERSION=${toolchain} iceccd -s minerva.ipfire.org -d -m ${ICECC_JOBS-5} + ICECC_VERSION=${toolchain} iceccd -d -s ${ICECC_SCHEDULER} -m ${ICECC_JOBS-5} } function iceccd_stop() { diff --git a/tools/make-compilers b/tools/make-compilers index 8c266bc15..a55ba9cfe 100755 --- a/tools/make-compilers +++ b/tools/make-compilers @@ -29,143 +29,3 @@ ccache_stats() { beautify message FAIL fi } - -distcc_mon() { - - # run gnome thing if we can... - if [ -n "$DISPLAY" ]; then - monitor=$(which distccmon-gnome 2>/dev/null) - if [ -n "$monitor" ]; then - DISTCC_DIR=$BASEDIR/distcc $monitor & - return 0 - fi - fi - - INTERVAL=1 # in seconds - - if [ -e $BASEDIR/distcc ]; then - while sleep $INTERVAL; do - clear - echo "$NAME - Distcc monitor - Cancel with ctrl+c" - echo - PATH=$PATH:build_${TARGET}/${TOOLS_DIR}/usr/bin \ - DISTCC_DIR=${BASEDIR}/distcc \ - distccmon-text - done - else - echo -n "You can't access the statistics if you didn't run ./make.sh build" - beautify message FAIL - fi -} - -distccd_start() { - echo -n "Running distcc daemon" - - if [ "$DISTCC_PORT" == "0" ]; then - beautify message DISA - return - fi - - TOOLS_DIR=$TOOLS_DIR DISTCC_PORT=$DISTCC_PORT DISTCC_JOBS=$DISTCC_JOBS \ - LOGFILE=$BASEDIR/log_${TARGET}/_build.00-distccd.log \ - $BASEDIR/tools/make-compilers & - if [ "$?" -eq "0" ]; then - beautify message DONE - else - beautify message FAIL - fi -} - -distccd_stop() { - echo -n "Stopping distcc daemon" - killall distccd &>/dev/null - if [ "$?" -eq "0" ]; then - beautify message DONE - else - beautify message FAIL - fi -} - -distccd_restart() { - distccd_stop - distccd_start -} - -distcc_get_hosts() { - if [ -n "$DISTCC_HOSTS" ]; then - logger --distcc "[INFO] Using local hosts: $DISTCC_HOSTS" - echo "$DISTCC_HOSTS" > $BASEDIR/distcc/hosts - return 0 - fi - logger --distcc "[INFO] Getting hosts..." - for i in $($BASEDIR/tools/buildspy uuid=$UUID action=get distcc=raw); do - logger --distcc "[INFO] Got host: $i" - echo "$i" | distcc_test_hosts >> $BASEDIR/distcc/hosts_new - done - if [ -s "$BASEDIR/distcc/hosts_new" ]; then - mv $BASEDIR/distcc/hosts{_new,} - fi -} - -distcc_test_hosts() { - while read i; do - if [ "${i}" = "localhost" ] || [ "${i:0:2}" = "--" ]; then - echo ${i} - continue - fi - - i=${i%,lzo} - host=$(awk -F: '{ print $1 }' <<<${i}) - jobs=${i##*/} - port=$(awk -F: '{ print $2 }' <<<${i} | awk -F/ '{ print $1 }') - ip=$($BASEDIR/tools/resolver $host 2>/dev/null) - [ -n "$ip" ] || continue - - if ping -c3 -w5 ${ip} &>/dev/null; then - if [ -n "$(which nc 2>/dev/null)" ]; then - if (echo | nc -w 15 ${ip} ${port} 2>/dev/null); then - echo "${ip}:${port}/${jobs},lzo # ${host}" - else - echo "# Host $host ($ip) is reachable but distcc does not respond." - fi - continue - fi - echo "${ip}:${port}/${jobs},lzo # ${host}" - else - echo "# Host $host ($ip) is not reachable." - fi - done -} - -distcc_reload() { - local NOW=$(date "+%s") - [ -z "$DISTCC_RELOAD_TIMESTAMP" ] && DISTCC_RELOAD_TIMESTAMP=$NOW - - # Exit if last reload is less than 5 minutes ago - if [ $(( $DISTCC_RELOAD_TIMESTAMP + 300 )) -ge $NOW ]; then - return 0 - fi - - logger --distcc "[INFO] Reloading distcc..." - distcc_get_hosts - DISTCC_RELOAD_TIMESTAMP=$NOW -} - -if [ "$(basename $0)" == "make-compilers" ]; then - # Exit, when distccd is already running - pidof distccd &>/dev/null && exit - - # Run distccd - DISTCCD_PATH=$TOOLS_DIR/bin \ - $TOOLS_DIR/usr/bin/distccd --daemon --allow 0.0.0.0/0 \ - --user nobody --nice 10 --jobs $DISTCC_JOBS --port $DISTCC_PORT \ - --log-file $LOGFILE --stats --job-lifetime 600 \ - --stats-port $(( $DISTCC_PORT + 1 )) &>/dev/null - - # When $TOOLS_DIR is not available (esp. gcc) --> exit - while pidof distccd >/dev/null && [ -x $TOOLS_DIR/bin/gcc ]; do - sleep 10 - done - - killall distccd &>/dev/null -fi diff --git a/tools/make-constants b/tools/make-constants index 95015fe56..257d9355b 100644 --- a/tools/make-constants +++ b/tools/make-constants @@ -57,6 +57,9 @@ PARALLELISMFLAGS=-j$(( $(grep processor < /proc/cpuinfo | wc -l) * 2 + 1 )) # Default hostname HOSTNAME=$(hostname -f || hostname) +# Default scheduler +ICECC_SCHEDULER="minerva.ipfire.org" + ############################################################################### # # Read the local configuration to override the environment variables @@ -158,6 +161,3 @@ IMAGES_DIR=/images # Files that indicates that we are running or failed RUNNING=$BASEDIR/.running FAILED=$BASEDIR/.failed - -ICECC=off # icecc is currently disabled -ICECC_SCHEDULER=$(${BASEDIR}/tools/resolver ${ICECC_SCHEDULER} 2>/dev/null) diff --git a/tools/make-include b/tools/make-include index c68f3aab5..a2da3610e 100644 --- a/tools/make-include +++ b/tools/make-include @@ -279,6 +279,13 @@ toolchain_make() { KVER="${KVER}" \ EMB="${EMB}" \ \ + CCACHE_DIR="${BASEDIR}/ccache" \ + CCACHE_PREFIX="${CCACHE_PREFIX}" \ + CCACHE_HASHDIR="${CCACHE_HASHDIR}" \ + ICECC="${ICECC}" \ + $([ -n "${ICECC_VERSION}" ] && echo ICECC_VERSION="${ICECC_TOOLCHAIN}") \ + USE_SCHEDULER="${ICECC_SCHEDULER}" \ + \ LINKER="${LINKER}" \ MACHINE="${MACHINE}" \ MACHINE_REAL="${MACHINE_REAL}" \ @@ -351,8 +358,8 @@ ipfire_make() { CCACHE_DIR="/usr/src/ccache" \ CCACHE_PREFIX="${CCACHE_PREFIX}" \ CCACHE_HASHDIR="${CCACHE_HASHDIR}" \ - ICECC="${ICECC}" \ - ICECC_VERSION="${ICECCD_TOOLCHAIN}" \ + $([ -n "${ICECC_VERSION}" ] && echo ICECC_VERSION="${ICECC_TOOLCHAIN}") + ICECC_VERSION="${ICECC_TOOLCHAIN}" \ USE_SCHEDULER="${ICECC_SCHEDULER}" \ \ LINKER="${LINKER}" \ diff --git a/tools/make-interactive b/tools/make-interactive index 4fa0e827e..a47b86eb9 100644 --- a/tools/make-interactive +++ b/tools/make-interactive @@ -156,7 +156,6 @@ toolchain) # Check if host can build the toolchain check_toolchain - distcc_get_hosts & toolchain_build stdumount