]> git.ozlabs.org Git - next-scripts/blobdiff - do_build
update to_build_host a bit
[next-scripts] / do_build
index a90373dc057d5cf6a4dec55b86a73374a743bb3a..a898bbaff6ec0e01e90928da8d0c78e0e21425cb 100755 (executable)
--- a/do_build
+++ b/do_build
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 tree=
 if [ "$1" ]; then
@@ -6,30 +6,44 @@ if [ "$1" ]; then
        shift
 fi
 
-tools_dir=$(cd $(dirname "$0"); pwd)
-. "$tools_dir/common.sh"
+# shellcheck source=common.sh
+. "$(dirname "$0")/common.sh"
 
 set -e
 
 bparent=$(dirname "$build_dir")
 
-line="$(tail -n 1 $SHA1_FILE)"
+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
+       if [ "$tree" != "$stree" ]; then
+               printf 'That is not the last tree merged (%s v %s)\n' "$tree" "$stree" 1>&2
                exit 1
-       }
+       fi
 else
        tree="$stree"
 fi
 obdir="$bparent/old/$tree"
 
-cmd="firejail --profile=$bin_dir/build.profile /bin/sh"
-[ "$build_host" ] &&
+cmd="/bin/sh"
+if [ "$build_host" ]; then
        cmd="ssh root@$build_host unshare -n su $(id -u -n)"
+fi
+
+log_regex='/^[[: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
+s/^(WARNING: (modpost: )?(drivers\/built-in|vmlinux)\.o\(\.[^+]*\+0x)[[:xdigit:]]+(\): Section mismatch in reference from .*)$/\1XXXX\4/
+/^Warning: Kernel ABI header at /d
+/^[[:space:]]+PERF_VERSION = /d
+s/^(Parsed description of) [[:digit:]]+ (helper function)/\1 X \2/
+s/^[[:xdigit:]]+([[:space:]]+R_PPC64_(ADDR64|REL32)[[:space:]].*)$/XXX\1/'
 
 $cmd <<-EOF
 
@@ -49,19 +63,7 @@ $cmd <<-EOF
        [ -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
+               sed -E -e '$log_regex' | grep -vxFf $bparent/log-ignore
        }
 
        show_log() {
@@ -85,7 +87,7 @@ $cmd <<-EOF
                        echo "\$sep"
                        echo " log \$b increased number of lines"
                        echo "\$sep"
-                       pushover "linux-next: \$arch \$conf log got bigger"
+                       linux-next-notify "\$arch \$conf log got bigger"
                        if [ -f $obdir/\$b ]; then
                                diff -u $obdir/\$b \$log 2>&1 | less
                        else
@@ -106,36 +108,17 @@ $cmd <<-EOF
        log_x86=\$d.log
        make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=\$d -s allmodconfig || exit 1
        echo "Forking x86 build ..."
-       /usr/bin/time make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=\$d -j"$j_factor" -O -s > \$log_x86 2>&1 &
+       /usr/bin/time make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=\$d -j100 -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
-       make ARCH=powerpc O=\$d -s ppc64_defconfig || exit 1
-       echo "Forking powerpc build ..."
-       /usr/bin/time make ARCH=powerpc 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
-       make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=\$d -s multi_v7_defconfig || exit 1
-       echo "Forking arm build ..."
-       /usr/bin/time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- 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
+       # the -Wno-psabi is to suppress
+       #       note: the layout of aggregates containing vectors with 8-byte alignment has changed in GCC 5
+       # warnings until at least gcc 12 when the warning will be removed
+       /usr/bin/time make -C tools/perf -f Makefile.perf -s -O -j40 O=\$d EXTRA_CFLAGS=-Wno-psabi > \$log_perf 2>&1
        rc=\$?
 
        if [ \$rc -ne 0 ]; then
@@ -143,9 +126,7 @@ $cmd <<-EOF
                echo "ERROR: perf build failed - log follows"
                echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
                cat \$log_perf
-               kill \$x86_64_pid
-               kill \$ppc64_pid
-               kill \$arm_pid
+               kill \$x86_64_pid || true
                killall make
                rm .scmversion
                exit 1
@@ -153,37 +134,46 @@ $cmd <<-EOF
                show_log native perf \$log_perf
        fi
 
-       wait \$arm_pid
+       echo Building: powerpc ppc64_defconfig
+       d="$bparent/powerpc_ppc64_defconfig"
+       [ -d \$d ] || mkdir \$d || exit 1
+       log_ppc=\$d.log
+       make ARCH=powerpc O=\$d -s ppc64_defconfig || exit 1
+       /usr/bin/time make ARCH=powerpc O=\$d -j40 -O -s > \$log_ppc 2>&1
        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
+               echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+               echo "ERROR: powerpc ppc64_defconfig build failed - log follows"
+               echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+               cat \$log_ppc
+               kill \$x86_64_pid || true
                killall make
                rm .scmversion
                exit 1
        else
-               show_log arm multi_v7_defconfig \$log_arm
+               show_log powerpc ppc64_defconfig \$log_ppc
        fi
 
-       wait \$ppc64_pid
+       echo Building: arm multi_v7_defconfig
+       d="$bparent/arm_multi_v7_defconfig"
+       [ -d \$d ] || mkdir \$d || exit 1
+       log_arm=\$d.log
+       make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=\$d -s multi_v7_defconfig || exit 1
+       /usr/bin/time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=\$d -j40 -O -s > \$log_arm 2>&1
        rc=\$?
 
        if [ \$rc -ne 0 ]; then
-               echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-               echo "ERROR: powerpc ppc64_defconfig build failed - log follows"
-               echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-               cat \$log_ppc
-               kill \$x86_64_pid
+               echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+               echo "ERROR: arm multi_v7_defconfig build failed - log follows"
+               echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+               cat \$log_arm
+               kill \$x86_64_pid || true
                killall make
                rm .scmversion
                exit 1
        else
-               show_log powerpc ppc64_defconfig \$log_ppc
+               show_log arm multi_v7_defconfig \$log_arm
        fi
 
        wait \$x86_64_pid