We need to copy include/config/auto.conf into ${STAGING_KERNEL_BUILDDIR}
to avoid module compilation errors like this:

    | make[1]: Entering directory 
'build/tmp-glibc/work-shared/machine/kernel-source'
    | make[2]: Entering directory 
'build/tmp-glibc/work-shared/machine/kernel-build-artifacts'
    |
    |   ERROR: Kernel configuration is invalid.
    |          include/generated/autoconf.h or include/config/auto.conf are 
missing.
    |          Run 'make oldconfig && make prepare' on kernel src to fix it.
    |
    | make[2]: *** 
[build/tmp-glibc/work-shared/machine/kernel-source/Makefile:641: 
include/config/auto.conf] Error 1

We also need scripts/basic/fixdep to avoid errors like this:

    | make[1]: Entering directory 
'build/tmp-glibc/work-shared/machine/kernel-source'
    | make[2]: Entering directory 
'build/tmp-glibc/work-shared/machine/kernel-build-artifacts'
    |   CC [M]  
build/tmp-glibc/work/vendor-linux/tehuti-module/0.3.6-r0/git/TLK10232_phy_Linux.o
    | /bin/sh: scripts/basic/fixdep: No such file or directory
    | make[3]: *** 
[build/tmp-glibc/work-shared/machine/kernel-source/scripts/Makefile.build:303: 
build/tmp-glibc/work/vendor-linux/tehuti-module/0.3.6-r0/git/TLK10232_phy_Linux.o]
 Error 127

And scripts/mod/modpost to avoid errors like this:

    |   Building modules, stage 2.
    |   MODPOST 1 modules
    | /bin/sh: scripts/mod/modpost: No such file or directory
    | make[3]: *** 
[build/tmp-glibc/work-shared/machine/kernel-source/scripts/Makefile.modpost:92: 
__modpost] Error 127

Most of the time, the absence of these files is masked by the
make-mod-scripts recipe's do_configure task, which causes a whole bunch
of extra files to be built into ${STAGING_KERNEL_BUILDDIR} (including
these two). Typically make-mod-scripts will be built before any kernel
modules, and so it didn't matter that do_shared_workdir was missing
these files.

However the problem will be evident if you do certain sequences of
tasks, for example a complete build first (so that make-mod-scripts is
already built), then:

    bitbake linux-yocto my-kernel-module -c clean
    bitbake my-kernel-module -c install

Signed-off-by: Dan Callaghan <[email protected]>
---
 meta/classes/kernel.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a724645466..5a49d01aa5 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -452,6 +452,7 @@ do_shared_workdir () {
        cp .config $kerneldir/
        mkdir -p $kerneldir/include/config
        cp include/config/kernel.release 
$kerneldir/include/config/kernel.release
+       cp include/config/auto.conf $kerneldir/include/config/
        if [ -e certs/signing_key.x509 ]; then
                # The signing_key.* files are stored in the certs/ dir in
                # newer Linux kernels
@@ -460,6 +461,10 @@ do_shared_workdir () {
        elif [ -e signing_key.priv ]; then
                cp signing_key.* $kerneldir/
        fi
+       mkdir -p $kerneldir/scripts/basic
+       cp scripts/basic/fixdep $kerneldir/scripts/basic/
+       mkdir -p $kerneldir/scripts/mod
+       cp scripts/mod/modpost $kerneldir/scripts/mod/
 
        # We can also copy over all the generated files and avoid special cases
        # like version.h, but we've opted to keep this small until file creep 
starts
-- 
2.21.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#137339): 
https://lists.openembedded.org/g/openembedded-core/message/137339
Mute This Topic: https://lists.openembedded.org/mt/73168943/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to