How to copy kernel headers?

autif khan autif.mlist at gmail.com
Tue Dec 13 14:00:41 EST 2011


Yeah, I left a lot of (what I thought irrelevant) information out. But
as I am researching more and more, It looks like, I will have to suck
it up and compile the kernel module on the build machine and not the
target.

Here are the details.

I have sufficient disk space and processing power to build simple
stuff like kernel modules on the machine. But not the entire kernel
(takes too much space) or other packages (like mono or ruby - they
take a lot of space and time).

The hardware is an Intel E640 processor with propriety video driver -
Intel provides a script that I did not want to mess with. This script
does not allow for cross compiling - it assumes that the driver is
being deployed on the build machine - it uses the build machine's
kernel (uname -r) etc.

So, what I will need to do is to rewrite the script to allow for
compiling for a different target.

I was hoping that there is a simple way to generate the contents of
/usr/src/linux-header-2.6.xx.x using some make make command or
something else (apt/yum/whatever). These are about 82MB, whereas the
entire build directory is about 1.8GB.

However, it looks unlikely that I will be able to do this. I will see
what I can do about writing the Intel script.

On another note - we chose x86 processor so that we do not have to go
thru the nightmare or cross compiling mono and ruby for our target
embedded system. It is not fun to do that :-)

Thanks

Autif

On Tue, Dec 13, 2011 at 1:39 PM, Dave Hylands <dhylands at gmail.com> wrote:
> Hi Autif,
>
> On Tue, Dec 13, 2011 at 8:55 AM, autif khan <autif.mlist at gmail.com> wrote:
>>
>> I have linux kernel source in a directory (say) /home/autif/linux-2.6.29.4
>> I can make xconfig followed by make bzImage, followed by make modules
>>
>> Now, I can install the modules using "make modules_install
>> INSTALL_MOD_PATH=/home/autif/2.6.29.4.modules" - This works
>> beautifully, without any issue.
>>
>> I have tried to install the kernel headers using "make headers_install
>> INSTALL_HDR_PATH=/home/autif/2.6.29.4.headers"
>>
>> I can tar and extract these modules and headers on some other computer
>> (target computer) at the right location. Meaning that modules are
>> extracted to /lib/modules/2.6.29.4/ and "build" is symlinked to
>> /usr/src/linux-headers-2.6.29.4 - where I extracted the headers.
>>
>> However, I only get the include directory.
>>
>> When I try to build a driver on the target computer, there is
>> complaint that I do not have a Makefile in
>> /usr/src/linux-headers-2.6.29.4
>
>
> I'm confused. You said you don't have enough resources to build on your
> target, but then you're trying to build on the target?
>
> I deal with ARM, and typically build on x86, which is a process called
> cross-compiling. You can also cross-compile and have x86 as a target.
>
> Then you'd build the modules on your build machine and deploy the .ko files
> on your target. You don't need the headers on the target, just on your build
> machine.
>
>> The build produces something like 1.5 GB of files and this is too much
>> for my target system. I am reluctant to build the driver on the build
>> system and want to build it on target. Both build and target are i386
>> systems (one a full blown Debian based), the other something somewhat
>> based on LFS.
>>
>> So, my short problem is - what make command I need to execute to
>> install the build dependencies (including headers, Makefiles and other
>> stuff that may be required by the driver) to copy that stuff over to a
>> custom directory (say /home/autif/2.6.29.4.build_dependencies) so that
>> I can tar it up and extract is on my target system at (say)
>> /usr/src/linux-2.6.29.4
>
>
> As far as I know, you need to install the entire kernel source tree in order
> to build anything. Part of this comes from the config stuff, which uses the
> Kconfig files scattered all over the tree.
>
> I'd like to be able to build external modules on my gumstix (I can natively
> compile user-mode code) with only some type of minimal install of stuff from
> the kernel, but I haven't found any easy way to create that minimal set of
> stuff. So if anybody knows of a way, I'm interested as well.
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.davehylands.com



More information about the Kernelnewbies mailing list