[OE-core] kernel: building target-arch scripts/* to include in kernel-headers package

Koen Kooi koen at dominion.thruhere.net
Tue Jun 26 16:27:36 UTC 2012


Op 26 jun. 2012, om 17:58 heeft Darren Hart het volgende geschreven:

> 
> 
> On 06/25/2012 10:19 PM, Khem Raj wrote:
>> On Mon, Jun 25, 2012 at 4:33 PM, Darren Hart <dvhart at linux.intel.com> wrote:
>>> I'm working on a patch series to provide a kernel-headers package which
>>> allows for the compilation of Linux kernel modules on the target. I
>>> currently have something working, but it requires that I first build the
>>> scripts/* binaries on the target, prior to trying to build a module.
>>> 
>>>       # cd /usr/src/kernel-headers
>>>       # make scripts
>>> 
>>> Then I can build modules:
>>> 
>>>       # cd /home/root/hello-mod/files
>>>       # export KERNEL_SRC=/usr/src/kernel-headers
>>>       # make
>>> 
>>> And test:
>>> 
>>>       # insmod hello.ko
>>>       # rmmod hello.ko
>>>       # dmesg | tail -n2
>>>       Hello World!
>>>       Goodbye Cruel World!
>>> 
>>> I would like to package the target-arch scripts binaries with the
>>> kernel-headers package, but I'm not sure how to go about building both
>>> the native and the target binaries as part of the kernel building
>>> process. Does it make sense to build these as part of the do_install()
>>> task after I've moved the files from the linux recipe's workdir and
>>> removed the host-arch binaries from scripts?
>>> 
>> 
>> the hostprogs there are a bit hairy. you could set HOSTCC to point to
>> cross compiler and build scripts dir in some O=foo after copying
>> .config into it but the problem would be that build system expects the
>> hosttools in build tree at exact same location
>> e.g. fixdep would be needed even to build other hosttools e.g.
>> recordmcount etc. and thats where you have to patch kbuild such that
>> it could reference another fixdep tool which then will be built for
>> the host you are compiling kernel on.
>> 
> 
> Ewe, what a mess.
> 
> Another option would be to add:
> 
>        # cd /usr/src/kernel-headers
>        # make scripts
> 
> To the kernel-headers post-inst script. =

or you could document it and have people do it manually.

regards,

Koen



More information about the Openembedded-core mailing list