#!/bin/sh tree= if [ "$1" ]; then tree=$1 shift fi tools_dir=$(cd $(dirname "$0"); pwd) . "$tools_dir/common.sh" set -e bparent=$(dirname "$build_dir") line="$(tail -n 1 $SHA1_FILE)" # strip everything after the first tab character stree=${line%% *} if [ "$tree" ]; then [ "$tree" = "$stree" ] || { echo "That is not the last tree merged ($tree v $stree)" 1>&2 exit 1 } else tree="$stree" fi obdir="$bparent/old/$tree" cmd="/bin/sh" [ "$build_host" ] && cmd="ssh root@$build_host unshare -n su $(id -u -n)" $cmd <<-EOF echo Building on \$(hostname) echo \$PATH | grep -q "\$HOME/bin" || export PATH="\$HOME/bin:\$PATH" export LANG=C cd "$build_dir" || exit 1 export CCACHE_DIR="$bparent/.ccache" export TMPDIR="$bparent/tmp" git reset --hard next || exit 1 touch .scmversion || exit 1 [ -d "$obdir" ] || mkdir -p "$obdir" || exit 1 sanitise_log() { sed -r ' /^[[:space:]]+$/d /^[.[:digit:]]+user [.[:digit:]]+system [:.[:digit:]]+elapsed [[:digit:]]+%CPU \([[:digit:]]+avgtext\+[[:digit:]]+avgdata [[:digit:]]+maxresident\)k$/d /^[[:digit:]]+inputs\+[[:digit:]]+outputs \([[:digit:]]+major\+[[:digit:]]+minor\)pagefaults [[:digit:]]+swaps$/d /^Setup is [[:digit:]]+ bytes \(padded to [[:digit:]]+ bytes\)\.$/d /^System is [[:digit:]]+ kB$/d /^CRC [[:xdigit:]]+$/d /^Kernel: arch\/x86\/boot\/bzImage is ready \(#[[:digit:]]+\)$/d /^WARNING: vmlinux\.o\(\.text\+0x[[:xdigit:]]+\): Section mismatch in reference from /d /^WARNING: drivers\/built-in\.o\(\.text\+0x[[:xdigit:]]+\): Section mismatch in reference from /d /^Warning: Kernel ABI header at /d /^[[:space:]]+PERF_VERSION = /d ' | grep -vxFf $bparent/log-ignore } show_log() { arch=\$1 conf=\$2 log=\$3 sep='======================================================================' echo "\$sep" echo " \$arch \$conf build OK - log follows" echo "\$sep" cat \$log b=\$(basename \$log) olen=0 if [ -f $obdir/\$b ]; then olen=\$(sanitise_log <$obdir/\$b | wc -l) fi len=\$(sanitise_log <\$log | wc -l) if [ \$len -gt \$olen ]; then echo "\$sep" echo " log \$b increased number of lines" echo "\$sep" pushover "linux-next: \$arch \$conf log got bigger" if [ -f $obdir/\$b ]; then diff -u $obdir/\$b \$log 2>&1 | less else diff -u /dev/null \$log 2>&1 | less fi fi if [ \$len -gt 0 ]; then (sanitise_log <\$log; cat $bparent/log-ignore ) | sort -u >$bparent/log-ignore.tmp mv $bparent/log-ignore.tmp $bparent/log-ignore fi mv \$log $obdir/\$b } echo Building: x86_64 allmodconfig d="$bparent/x86_64_allmodconfig" [ -d \$d ] || mkdir \$d || exit 1 log_x86=\$d.log cross -n -N -a x86_64 -c "$gcc_version" O=\$d -s allmodconfig || exit 1 echo "Forking x86 build ..." /usr/bin/time cross -n -N -a x86_64 -c "$gcc_version" O=\$d -j"$j_factor" -O -s > \$log_x86 2>&1 & x86_64_pid=\$! echo Building: powerpc ppc64_defconfig d="$bparent/powerpc_ppc64_defconfig" [ -d \$d ] || mkdir \$d || exit 1 log_ppc=\$d.log cross -n -N -a powerpc64 -k powerpc -c "$gcc_ppc_version" O=\$d -s ppc64_defconfig || exit 1 echo "Forking powerpc build ..." /usr/bin/time cross -n -N -a powerpc64 -k powerpc -c "$gcc_ppc_version" O=\$d -j"$j_factor" -O -s > \$log_ppc 2>&1 & ppc64_pid=\$! echo Building: arm multi_v7_defconfig d="$bparent/arm_multi_v7_defconfig" [ -d \$d ] || mkdir \$d || exit 1 log_arm=\$d.log cross -n -N -a arm -c "$gcc_version" O=\$d -s multi_v7_defconfig || exit 1 echo "Forking arm build ..." /usr/bin/time cross -n -N -a arm -c "$gcc_version" O=\$d -j"$j_factor" -O -s > \$log_arm 2>&1 & arm_pid=\$! echo Building: perf d="$bparent/perf" [ -d \$d ] || mkdir \$d || exit 1 log_perf=\$d.log echo "Forking perf build ..." /usr/bin/time make -C tools/perf -f Makefile.perf -s -O -j"$j_factor" O=\$d > \$log_perf 2>&1 & perf_pid=\$! wait \$perf_pid rc=\$? if [ \$rc -ne 0 ]; then echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "ERROR: perf build failed - log follows" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" cat \$log_perf kill \$x86_64_pid kill \$ppc64_pid kill \$arm_pid killall make rm .scmversion exit 1 else show_log native perf \$log_perf fi wait \$arm_pid rc=\$? if [ \$rc -ne 0 ]; then echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "ERROR: arm multi_v7_defconfig build failed - log follows" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" cat \$log_arm kill \$x86_64_pid kill \$ppd64_pid killall make rm .scmversion exit 1 else show_log arm multi_v7_defconfig \$log_arm fi wait \$ppc64_pid rc=\$? if [ \$rc -ne 0 ]; then echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "ERROR: powerpc ppc64_defconfig build failed - log follows" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" cat \$log_ppc kill \$x86_64_pid killall make rm .scmversion exit 1 else show_log powerpc ppc64_defconfig \$log_ppc fi wait \$x86_64_pid rc=\$? if [ \$rc -ne 0 ]; then echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "ERROR: x86_64 allmodconfig build failed - log follows" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" cat \$log_x86 rm .scmversion exit 1 else show_log x86_64 allmodconfig \$log_x86 fi rm .scmversion EOF