LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   headers (https://www.linuxquestions.org/questions/linux-newbie-8/headers-334300/)

stabu 06-16-2005 02:56 PM

headers
 
When installing modules, I'm frequently asked for headers, kernel headers that is.

Often, their names have to be as specific as hell.

But what happens if you've recompiled, or (even easier) renamed your kernel so that what uname -r says is no longer right?

Are headers so specific to a certain (distro) kernel? Can they be generated with the appropriate source and config file? What are they in any case? some sort of executive summary of the kernel? They have me a quandry, that's for sure.

Matir 06-16-2005 03:40 PM

Headers are a bunch of files (ending in .h, for header) that essentially describe the programming functions available to userspace programs. (OK, I lied a bit, they also describe things internal to the kernel, but that's only needed for kernel compilation).

Basically, the headers say: "I have this function available, and this function, and this value" and so forth.

Now, on to your question:
If you have kernel source (or headers) for the proper revision installed, the exact name should not be terribly important.

If your current kernel is 2.6.11, have some 2.6.11 headers installed. Just make sure the symlink /lib/modules/`uname -r`/build points to the installed headers, and you should be good to go.

foo_bar_foo 06-16-2005 03:51 PM

Quote:

Originally posted by Matir


If your current kernel is 2.6.11, have some 2.6.11 headers installed. Just make sure the symlink /lib/modules/`uname -r`/build points to the installed headers, and you should be good to go.

i think that's actually suposed to be the real build directory not just bare source files but i wouldn't swear to it.

But what happens if you've recompiled, or (even easier) renamed your kernel so that what uname -r says is no longer right?

uname -r is always the current running kernel which is what you need for compiling kernel space junk like modules. it can't be wrong or made wrong in any way (the kernel knows who it is)

stabu 06-16-2005 04:47 PM

so maitr you're saying that header files only depend on the version kernel you're using? i.e. the distro doesn't matter? (given that your /lib/modules/.../build symlink is correctly pointed).

That's a revelation. I thought that headers would at least be distro-dependent and even kernel-recompile dependent.

I take your points foo_bar_foo, thanks.


All times are GMT -5. The time now is 12:17 PM.