LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   If I install the kernel source package, do I need the headers? (http://www.linuxquestions.org/questions/slackware-14/if-i-install-the-kernel-source-package-do-i-need-the-headers-482039/)

TSquaredF 09-09-2006 11:06 PM

If I install the kernel source package, do I need the headers?
 
My normal practice, when a new kernel is released in testing, is to download all of the kernel packages & install them, as a backup, & also as a starting point for my customized kernel. I have a config file that I copy into the new sources & compile a custom kernel for my desktop & laptop. This is the kernel that I use on a regular basis. My question is: Since I have all the kernel source loaded, do I really need the header package? I have gotten along very well in the past without any kernel packages, if I compiled the kernel myself. Anyone have any ideas?
Regards,
Bill

sunman 09-10-2006 12:15 AM

I -think- that I recall reading someplace on the forums here about how you should never install kernel headers that are different from what your system was built against, to avoid having library issues. I never have myself and haven't had any problems with anything, but I'm no expert :)

drkstr 09-10-2006 12:16 AM

Technicly no, but it's poor design. Pat put them in a seperate package for a reason.

regards,
...dkrstr

TSquaredF 09-10-2006 08:45 AM

sunman:
Quote:

I -think- that I recall reading someplace on the forums here about how you should never install kernel headers that are different from what your system was built against
Yes, the kernel-headers.WARNING file in the Testing directory of -current says that, too, but I have found that compiling the most recent nvidia driver requires the 2.6 series headers.
Since there was a shiny new kernel package released yesterday, I think I will just put in the source, compile my kernel, get it working, remove everything else, then try to compile the nvidia drivers & a couple of other drivers I need & see what happens. I'll let you know.
Regards,
Bill

TSquaredF 09-10-2006 07:12 PM

OK, here is what I did.
1) Downloaded the most recent 2.6 series kernel in -current/extra.
2) Installed only the kernel source package.
3) Copied in my config files and ran 'make oldconfig', then 'make menuconfig'. (I take out a little more every time I go through one of these iterations, some day I'll have the resultant kernel down the way I want it.)
4) Ran 'make', then 'make modules_install'.
5) Copied the kernel files to /boot.
6) Booted several times to ensure that the new kernel worked, then modified my GRUB menu.lst file to boot automagically from the new kernel.
7) Removed any traces of old kernels/kernel packages.
8) Compiled the nvidia driver module. This process gave me a warning I hadn't seen before, but no errors & the driver works well, so no problem.
9) Compiled the kqemu module for this kernel. This worked normally, no hassles.
As a relult of the above tests, I think I'll not load any further kernel modules & just see how things work.
Regards,
Bill

drkstr 09-11-2006 02:02 AM

Make sure to keep the original header package installed or you will run into problems compiling programs later down the road. That is, unless you want to recompile GCC and glibc for your new kernel version.

regards,
...drkstr

hsimah 09-11-2006 05:13 AM

I am running a 2.6.17.9 kernel I compiled, but I still have my 2.6.16.9 kernel headers I got from /testing a whing ago. I uninstalled them on my other machine and something broke (this was back in January) so I have just left them there in case.

What exactly do the headers do?

TSquaredF 09-11-2006 02:40 PM

drkstr:
Quote:

Make sure to keep the original header package installed or you will run into problems compiling programs later down the road. That is, unless you want to recompile GCC and glibc for your new kernel version.
Please explain this. I compiled the only kernel on this system, using the GCC and glibc that are installed. The kernel compiled against them, right? Anything else I compile will compile against them, right? I can see & understand the above if I were using a precompiled kernel, but I'm not. Help please.

hsimah
Quote:

What exactly do the headers do?
I guess this is the point of my original post. My impression is that they provide code needed for compiling, if the sources aren't present. BUT, that could be wrong.
Regards,
Bill

drkstr 09-11-2006 02:42 PM

You need to keep the 2.4.x headers installed. The headers are used by GCC when compiling programs and it will expect to find the headers it was compiled against. If you need to compile something specific to your kernel (such as a kernel modules), it will look for the headers installed in the /usr/src/linux-<version>. The most common method is to follow the link '/lib/modules/<version #>/source'. However, If you are compiling a regular program, it will usually look for headers GCC was compiled against in /usr/include/linux (IE. The headers package).

regards,
...drkstr

TSquaredF 09-11-2006 03:00 PM

Ok, now I understand. I wasn't aware that two different paths could be followed. I will put the 2.4 series headers back in. Thank you for enlightening my ignorance.
Regards,
Bill

evilDagmar 09-12-2006 08:22 AM

Actually, the kernel-headers package that should be installed is the one matching the kernelt that was present when glibc was compiled, not gcc.

The result is the same--do not replace the 2.4.x kernel headers even tho' you might be using a 2.6.x kernel.

I have no idea what that one person did to make the nVidia drivers not compile correctly, since I've (within the last week) installed the latest nVidia driver on both a 10.2 box and a -current box running kernel 2.6.17.11.

drkstr 09-12-2006 09:43 AM

Yes, I mentioned that in my earlier post, but if you want to get technical, your entire "toolchain" (binutils, gcc, & glibc) should be compiled against the same kernel headers.

http://www.linuxfromscratch.org

regards,
...drkstr

TSquaredF 09-12-2006 11:08 AM

Thanks, folks, I appreciate the help.
Regards,
Bill
"me, I just bear up to my bewilderedness.."
Lyle Lovett, "Bears"


All times are GMT -5. The time now is 01:45 PM.