On Tue, Apr 21, 2020 at 5:37 AM Dan Callaghan <dan.callag...@opengear.com> wrote: > > 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. >
The design is that, make-mod-scripts is what provides those files, we don't want to copy them, since it is an ever incomplete list (more so in the past, but the concept still holds). > 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 Why can't we fix the dependency ? We chased a few of these around when the mod-scripts recipe was introduced, and this just looks like a variant we missed. Bruce > > Signed-off-by: Dan Callaghan <dan.callag...@opengear.com> > --- > 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 > > -- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#137340): https://lists.openembedded.org/g/openembedded-core/message/137340 Mute This Topic: https://lists.openembedded.org/mt/73168943/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-