summaryrefslogtreecommitdiff
path: root/tcwg_kernel-build.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-15 16:00:20 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-16 14:55:14 +0000
commit267741394c0b7d904f0892f5a51c04d55833950d (patch)
treef9f83959e50473928055330ef67d4976ae2bdc00 /tcwg_kernel-build.sh
parentcbebf4a738aec13c43a75b3f3c103754fa30cfbc (diff)
tcwg_kernel-build.sh: Stabilize kernel build for ccache
Kernel likes to include auto-generated stuff into main headers, which completely breaks ccache optimizations. KBUILD_BUILD_TIMESTAMP is the big one, it's different between builds from the same sources. SUBLEVEL and EXTRAVERSION change often enough to break large bisections. Same for LOCALVERSION. We save kernel.release in artifacts/ to have a record of release strings. Change-Id: I06ed87c554481b5202cde517ee4fbaa6c25e454b
Diffstat (limited to 'tcwg_kernel-build.sh')
-rwxr-xr-xtcwg_kernel-build.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh
index fdabf218..555e552c 100755
--- a/tcwg_kernel-build.sh
+++ b/tcwg_kernel-build.sh
@@ -143,10 +143,11 @@ build_linux ()
# Use binutils, etc from $bin
export PATH="$bin:$PATH"
- # Use ccache only when bisecting linux. Otherwise the compiler is
- # new in every build and we would only clobber ccache volume.
+ # Use ccache only when bisecting linux (or preparing to).
+ # Otherwise the compiler is new in every build and we would
+ # only clobber ccache volume.
local ccache=""
- if [ x"${rr[mode]}" = x"bisect" -a x"${rr[current_project]}" = x"linux" ]; then
+ if [ x"${rr[mode]}" != x"jenkins-full" -a x"${rr[current_project]}" = x"linux" ]; then
ccache="ccache"
fi
cat > $(pwd)/bin/${rr[target]}-cc <<EOF
@@ -156,7 +157,7 @@ EOF
chmod +x $(pwd)/bin/${rr[target]}-cc
# Define make variables.
- local opts="CC=$(pwd)/bin/${rr[target]}-cc"
+ local opts="CC=$(pwd)/bin/${rr[target]}-cc SUBLEVEL=0 EXTRAVERSION=-bisect"
if [ x"${rr[target]}" != x"$(uname -m)" ]; then
opts="$opts ARCH=$(print_kernel_target ${rr[target]})"
opts="$opts CROSS_COMPILE=$(print_gnu_target ${rr[target]})-"
@@ -168,11 +169,15 @@ EOF
make $opts distclean
make $opts ${rr[linux_config]}
+ sed -i -e 's:CONFIG_LOCALVERSION_AUTO=y:# CONFIG_LOCALVERSION_AUTO is not set:' .config
+ set +f; rm -f localversion*; set -f
+ make $opts oldconfig
ccache -z
- make $opts -j$(nproc --all) -s -k &
+ KBUILD_BUILD_TIMESTAMP=0 make $opts -j$(nproc --all) -s -k &
local res=0 && wait $! || res=$?
ccache -s
+ cp include/config/kernel.release $run_step_artifacts/
return $res
)
}