How to copy kernel headers?

Dave Hylands dhylands at gmail.com
Tue Dec 13 13:39:43 EST 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111213/7f0c9e4d/attachment.html 


More information about the Kernelnewbies mailing list