I have a kernel module which uses Kbuild infra and expects it from prebuild kernel tree in staging area. I am building it using a recipe for it. However the problem is that the prebuilt kernel staged in staging area does not have scripts/ dir which is prebuilt so the module ends up with errors like yocto/poky/build/tmp-eglibc/sysroots/qemux86-64/usr/src/kernel/scripts/recordmcount: No such file or directory I think we are removing quite a bit with make -C $kerneldir _mrproper_scripts from kernel.bbclass that the resulting tree is not good enough for cross building external modules.
The reason we clean scripts is that the binaries there are for the host and should not be deployed to the target. If you inherit from module.bbclass, it should be running do_make_scripts() to account for this.
yes I am inheriting module.bbclass using inherit module in the external module recipe but I also pass EXTRA_OEMAKE = "-C ${STAGING_KERNEL_DIR} M=${B} prefix=${D}" MAKE_TARGETS = "modules" is MAKE_TARGETS definition an issue with do_make_scripts ?
OK I have found the issue and posted a patch to fix it. http://lists.linuxtogo.org/pipermail/openembedded-core/2013-January/034951.html
commit 62285873e2a6b9375a96a3de7a500205aeb18fb3 Author: Khem Raj <raj.khem@gmail.com> Date: Sat Jan 26 22:20:45 2013 -0800 module-base.bbclass: Call make instead of oe_runmake in do_make_scripts