LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Where are kernel header files? (https://www.linuxquestions.org/questions/debian-26/where-are-kernel-header-files-538137/)

sheintze 03-16-2007 06:42 PM

Where are kernel header files?
 
I'm running debian etch RC4 in VMWare on top of windows. As part of VMware, one is supposed to install something called vmware-tools.

The installation script for vmware tools is posing the question below. I checked and don't have such a directory. How should I respond to this question?

Thanks,
Siegfried
---------------------------------------------------------------------------
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include]

Brian1 03-16-2007 07:03 PM

Not sure of Debian installs but kernel sources are installed in /usr/src and then go by kernel name from there. Example
/usr/src/linux-2.6.20/include

Might search to see if Debian installs kernel source during the install. If not then more than likely it is on the install cds.

Brian

sheintze 03-16-2007 07:14 PM

What apt-get command to install /usr/src files?
 
Quote:

Originally Posted by Brian1
Might search to see if Debian installs kernel source during the install. If not then more than likely it is on the install cds.
Brian

I don't have that directory. Inside /usr/src is /usr/src/rpm. What apt-get command do I need to use?

I used the netinst cd so it is probably not there.

Thanks,
Siegfried

Brian1 03-16-2007 07:22 PM

I would say on Debian site the file for matching the kernel that is running will be there to install. To find kernel version run the command ' uname -r '.

Brian

Quakeboy02 03-16-2007 08:25 PM

Kernel sources, by definition are at /lib/modules/`uname -r`/source/include. However, if you didn't compile the kernel yourself, then there is no-one at that address. What you have to do is install the linux-headers package for your kernel. Probably "linux-headers-2.6.18-3", since it's etch.

eco2geek 03-17-2007 01:18 AM

Headers and source are two different packages.

To install the kernel headers, you can apt-get install linux-headers-`(uname -r)` and they'll be installed in /usr/src/linux-headers-<your_kernel_version>. (If, for example, you want to use the proprietary nvidia installer, you'll need the headers.)

To get the source for the entire kernel, you can apt-get install linux-source and apt will grab the source for your currently running kernel. Installing this package just dumps a tarball (for example, "linux-source-2.6.18.tar.bz2") into /usr/src. You have to extract it yourself. (If, for example, you want to recompile your kernel, you'll need the sources.)

Junior Hacker 03-17-2007 04:50 AM

The headers get installed in /usr/src/linux-headers-xxxx. Follow eco2geek's first sample command. There will actually be two packages installed, one called "linux-headers-2.6.18" the other called "linux-headers-2.6.18-xxxx", the latter depends on the current running kernel.

The headers are used to compile drivers against the current running kernel, the source is used for compiling a kernel, (normally).


All times are GMT -5. The time now is 01:00 AM.