mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
8cbe99b64f
commit
60d3f65d1c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user