Bug 3787 - unable to build external kernel modules with linux-yocto 3.4
Summary: unable to build external kernel modules with linux-yocto 3.4
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: kernel (show other bugs)
Version: 1.4
Hardware: All Multiple
: Medium+ normal
Target Milestone: 1.4 M4
Assignee: Darren Hart
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-01-24 05:19 UTC by Khem Raj
Modified: 2013-02-28 05:01 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2013-01-24 05:19:03 UTC
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.
Comment 1 Darren Hart 2013-01-24 05:55:20 UTC
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.
Comment 2 Khem Raj 2013-01-24 06:16:17 UTC
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 ?
Comment 3 Khem Raj 2013-01-27 06:57:22 UTC
OK I have found the issue and posted a patch to fix it. 

http://lists.linuxtogo.org/pipermail/openembedded-core/2013-January/034951.html
Comment 4 Darren Hart 2013-02-28 05:01:58 UTC
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