[linux-yocto] Build Kernel module on target
Darren Hart
dvhart at linux.intel.com
Fri Aug 17 13:41:50 PDT 2012
On 08/17/2012 11:11 AM, Bodke, Kishore K wrote:
>
>
>> -----Original Message-----
>> From: Darren Hart [mailto:dvhart at linux.intel.com]
>> Sent: Thursday, August 16, 2012 5:00 PM
>> To: Bodke, Kishore K
>> Cc: linux-yocto at yoctoproject.org
>> Subject: Re: Build Kernel module on target
>>
>>
>>
>> On 08/16/2012 04:31 PM, Bodke, Kishore K wrote:
>>> Hi Darren,
>>
>> Hi Kishore,
>>
>>> I am trying to build the Kernel Module on the target with sdk image.
>>> I get the below error for all the kernel modules I am building.
>>>
>>> == Build lib/librte_eal/linuxapp/igb_uio
>>>
>>> make: *** /lib/modules/3.4.6-yocto-standard/build: No such file or
>>> directory. Stop.
>>>
>>> make[7]: *** [igb_uio.ko] Error 2
>>>
>>> Makefile has the kernel source directory set like below.
>>>
>>> RTE_KERNELDIR = /lib/modules/$(shell uname -r)/build
>>>
>>> And I see there is no build directory there in
>>> /lib/modules/3.4.6-yocto-standard .
>>>
>>> I changed the RTE_KERNELDIR to
>>>
>>> RTE_KERNELDIR =/usr/src/kernel
>>
>> Correct.
>
> Why Yocto does not have /lib/modules/$(shell uname -r)/build?
> Generally /lib/modules/$(shell uname -r)/build is where EVERY kernel
module goes to look for kernel headers to build against.
No reason. That would be a good addition. Please send a patch or open a
bug with
the request.
>
>>
>>> This time it went further to build the kernel module but failed for the
>>>
>>> /usr/src/kernel/scripts/recordmcount: No such file or directory
>>>
>>> I saw the ${STAGING_KERNEL_DIR} for the recordmcount. There is no such
>> file
>>> I think we need scripts/recordmcount to be a part of the final image?
>>
>> This is an unfortunate result of the kernel building those "scripts" for
>> the host, which we can't deploy to the target. We intentionally remove
>> them. To build on the target, you must first build the "scripts":
>>
>> $ cd /usr/src/kernel
>> $ make scripts
>>
>> Then try to build your modules.
>
> If I had to build the same module using recipe via bitbake, I get the same
> error.
You shouldn't. If you do, it's a bug either in the module building
mechanism of oe-core or with your module recipe.
> Unfortunately I cannot inherit module in my recipe.
You really need to.
> The reason being,
> it is building for the local host if I do inherit module. I had to export the
> kernel source directory to ${STAGING_KERNEL_DIR}, then it gave the same
> scripts/recordmcount not found error.
That's a bug in your module Makefiles I suspect.
Finally - note that we are discussing linux-yocto classes and recipes -
this discussion belongs on the oe-core list, not the linux-yocto list
which is about the various linux-yocto*.git source repositories (the
kernel sources themselves).
Thanks,
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel
More information about the linux-yocto
mailing list