If I install the kernel source package, do I need the headers?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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
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
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
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
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.
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.
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
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).
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.