summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/kernel-devsrc.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2020-07-17 08:56:34 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-20 08:37:35 +0100
commit532ae127c52c9f7b1d2e4ca5cbca91881d23a2ac (patch)
tree98b04b2a525297eb8f2d6d268b84d2656bee0629 /meta/recipes-kernel/linux/kernel-devsrc.bb
parent3a95e171d3eaa6ab143d4f422c98a0ac7ad31761 (diff)
downloadopenembedded-core-contrib-532ae127c52c9f7b1d2e4ca5cbca91881d23a2ac.tar.gz
kernel-devsrc: fix on-target module build for v5.8+
The kernel build is now more sensitive to changing build inputs, like the compiler, linker, source tree location, versions, file timestamps, etc. When a difference is detected, the kernel build invokes a syncconfig to update/regenerate files as required. That process may prompt, and hence breaks automated tested and other workflows. By default, we don't want this to happen so we make sure that auto* timestamps are newer or equal to the .config timestap, we ensure that autoconf.h is in the filesystem and that we've substituted the cross tools used to build the kernel with the names that will be on the target. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/linux/kernel-devsrc.bb')
-rw-r--r--meta/recipes-kernel/linux/kernel-devsrc.bb16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 5940cc90ea..0c98535f75 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -108,6 +108,11 @@ do_install() {
fi
cp -a include $kerneldir/build/include
+
+ # we don't usually copy generated files, since they can be rebuilt on the target,
+ # but without this file, we get a forced syncconfig run in v5.8+, which prompts and
+ # breaks workflows.
+ cp -a --parents include/generated/autoconf.h $kerneldir/build 2>/dev/null || :
)
# now grab the chunks from the source tree that we need
@@ -249,6 +254,17 @@ do_install() {
# Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf
+ # make sure these are at least as old as the .config, or rebuilds will trigger
+ touch -r $kerneldir/build/.config $kerneldir/build/include/generated/autoconf.h 2>/dev/null || :
+ touch -r $kerneldir/build/.config $kerneldir/build/include/config/auto.conf* 2>/dev/null || :
+
+ if [ -e "$kerneldir/build/include/config/auto.conf.cmd" ]; then
+ sed -i 's/ifneq "$(CC)" ".*-linux-gcc.*$/ifneq "$(CC)" "gcc"/' "$kerneldir/build/include/config/auto.conf.cmd"
+ sed -i 's/ifneq "$(LD)" ".*-linux-ld.bfd.*$/ifneq "$(LD)" "ld"/' "$kerneldir/build/include/config/auto.conf.cmd"
+ sed -i 's/ifneq "$(CC_VERSION_TEXT)".*\(gcc.*\)"/ifneq "$(CC_VERSION_TEXT)" "\1"/' "$kerneldir/build/include/config/auto.conf.cmd"
+ sed -i 's/ifneq "$(srctree)" ".*"/ifneq "$(srctree)" "."/' "$kerneldir/build/include/config/auto.conf.cmd"
+ fi
+
# make the scripts python3 safe. We won't be running these, and if they are
# left as /usr/bin/python rootfs assembly will fail, since we only have python3
# in the RDEPENDS (and the python3 package does not include /usr/bin/python)