Linux – How to create Linux Kernel Headers from Linux Kernel Source

header-filekernel-moduleslinux-kernel

I'm working with Tiny Core Linux and attempting to install Vmware Tools, which of course needs the Kernel Headers :-).

It does not appear they have the Kernel Headers readily available in a package, but they do have the kernel source. As a result I downloaded that source, and I'm attempting to create headers from it, but I have no clue what I'm doing.

In the googling I ran into, it sounded like:

make headers_install

Might do what I need it to do, and this is in fact a proper make target, but it errors out on me with the following:

tc@box:/usr/src/linux-3.16.6$ make headers_install
  CHK     include/generated/uapi/linux/version.h
  HOSTCC  arch/x86/tools/relocs_32.o
In file included from arch/x86/tools/relocs_32.c:1:0:
arch/x86/tools/relocs.h:17:32: fatal error: tools/le_byteshift.h: No such file or directory
 #include <tools/le_byteshift.h>
                                ^
compilation terminated.
scripts/Makefile.host:134: recipe for target 'arch/x86/tools/relocs_32.o' failed
make[1]: *** [arch/x86/tools/relocs_32.o] Error 1
arch/x86/Makefile:181: recipe for target 'archscripts' failed
make: *** [archscripts] Error 2

Am I on the right track here, and I'm just missing a dependency or something, or am I completely on the wrong track?

Any pointers someone can give me on how to proceed next? It looks like "tools/le_byteshift.h" is somehow missing, but I'm not sure where to begin isolating what package that is even from to get this to work properly.

How does one make the kernel headers from the source? Any pointers greatly appreciated!

Best Answer

From Mark Plotnick’s comment:

VMware tools want the actual kernel header files, not the sanitized ones that make headers_install generates. Just type in the full path to the include directory in your kernel source tree when the vmware-config-tools.pl script prompts you for it. And make sure the kernel source exactly matches the kernel you're running. Successive kernel versions will sometimes change the layout of data structures.

Related Question