summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
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:38 +0100
commit60d3f65d1c7ba248a9394edd07198818b0dee5ee (patch)
tree72c97d3c52bcad33d3bace444f05fff2d69b87cf /meta/recipes-kernel
parent8cbe99b64f6f6ee13f154760aed4aa0815a6dfac (diff)
downloadpoky-60d3f65d1c7ba248a9394edd07198818b0dee5ee.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. (From OE-Core rev: 532ae127c52c9f7b1d2e4ca5cbca91881d23a2ac) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-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() {
108 fi 108 fi
109 109
110 cp -a include $kerneldir/build/include 110 cp -a include $kerneldir/build/include
111
112 # we don't usually copy generated files, since they can be rebuilt on the target,
113 # but without this file, we get a forced syncconfig run in v5.8+, which prompts and
114 # breaks workflows.
115 cp -a --parents include/generated/autoconf.h $kerneldir/build 2>/dev/null || :
111 ) 116 )
112 117
113 # now grab the chunks from the source tree that we need 118 # now grab the chunks from the source tree that we need
@@ -249,6 +254,17 @@ do_install() {
249 # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. 254 # Copy .config to include/config/auto.conf so "make prepare" is unnecessary.
250 cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf 255 cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf
251 256
257 # make sure these are at least as old as the .config, or rebuilds will trigger
258 touch -r $kerneldir/build/.config $kerneldir/build/include/generated/autoconf.h 2>/dev/null || :
259 touch -r $kerneldir/build/.config $kerneldir/build/include/config/auto.conf* 2>/dev/null || :
260
261 if [ -e "$kerneldir/build/include/config/auto.conf.cmd" ]; then
262 sed -i 's/ifneq "$(CC)" ".*-linux-gcc.*$/ifneq "$(CC)" "gcc"/' "$kerneldir/build/include/config/auto.conf.cmd"
263 sed -i 's/ifneq "$(LD)" ".*-linux-ld.bfd.*$/ifneq "$(LD)" "ld"/' "$kerneldir/build/include/config/auto.conf.cmd"
264 sed -i 's/ifneq "$(CC_VERSION_TEXT)".*\(gcc.*\)"/ifneq "$(CC_VERSION_TEXT)" "\1"/' "$kerneldir/build/include/config/auto.conf.cmd"
265 sed -i 's/ifneq "$(srctree)" ".*"/ifneq "$(srctree)" "."/' "$kerneldir/build/include/config/auto.conf.cmd"
266 fi
267
252 # make the scripts python3 safe. We won't be running these, and if they are 268 # make the scripts python3 safe. We won't be running these, and if they are
253 # left as /usr/bin/python rootfs assembly will fail, since we only have python3 269 # left as /usr/bin/python rootfs assembly will fail, since we only have python3
254 # in the RDEPENDS (and the python3 package does not include /usr/bin/python) 270 # in the RDEPENDS (and the python3 package does not include /usr/bin/python)