LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware, which kernel headers should be where? (https://www.linuxquestions.org/questions/slackware-14/slackware-which-kernel-headers-should-be-where-4175520752/)

systemloc 10-01-2014 10:26 AM

Slackware, which kernel headers should be where?
 
I've never understood kernel headers well, and the few web explanations weren't great, so I need a few clarifications.


I understand that a compiled kernel provides headers to provide userspace access to kernel functions. Userspace libs (including glibc) and programs compiled against theses headers.

Now I believe that the kernel headers that the userspace is compiled against should never change, and that if they are changed, this would necessitate recompiling every lib and binary on the system to be technically correct and safe. Correct?

So in the case that I upgrade a distro by a version number (for example, slackware 14.0 to 14.1 via slackpkg), the kernel headers must be updated as well, because all of the prebuilt binaries will have been built against that new distro version kernel header package. Correct?

If the above is true, this should mean that any custom software such as slackbuilds packages need to be recompiled. Correct?

Also, if I understand correctly, if one builds a new kernel from source, the original older kernel headers should not change, correct? Out of curiosity, how does the linker know how to link system calls to a new and different installed kernel?

I'm asking in part because I like to know how things work. More practically, I am upgrading my slackware 14.0 box to 14.1 using slackpkg. I want to make sure I treat the headers appropriately. I always run a custom kernel and like to know that I'm doing things correctly.

Philip Lacroix 10-02-2014 11:43 AM

Hello. This document by Eric Hameleers (member of the Slackware team) explains very well how the kernel headers are related to glibc, to the kernel itself and to the software included in a given release of the distribution.

Building a Linux Kernel from source: Slackware kernel-headers package

If you are going from 14.0 to 14.1, the upgrade will include a new version of glibc which was compiled using newer kernel headers. For this reason you should upgrade the headers package as well.

onebuck 10-03-2014 12:09 PM

Moderator Response
 
Moved: This thread is more suitable in <Slackware> and has been moved accordingly to help your thread/question get the exposure it deserves.

rkelsen 10-05-2014 06:48 PM

Quote:

Originally Posted by systemloc (Post 5247531)
Now I believe that the kernel headers that the userspace is compiled against should never change, and that if they are changed, this would necessitate recompiling every lib and binary on the system to be technically correct and safe. Correct?

No. Have a look at how old some of Slackware's binary packages are. There are very few packages which must be recompiled as a result of an upgrade.
Quote:

Originally Posted by systemloc (Post 5247531)
So in the case that I upgrade a distro by a version number (for example, slackware 14.0 to 14.1 via slackpkg), the kernel headers must be updated as well

Yes.
Quote:

Originally Posted by systemloc (Post 5247531)
because all of the prebuilt binaries will have been built against that new distro version kernel header package. Correct?

No, they haven't.
Quote:

Originally Posted by systemloc (Post 5247531)
If the above is true, this should mean that any custom software such as slackbuilds packages need to be recompiled. Correct?

No, not necessarily.
Quote:

Originally Posted by systemloc (Post 5247531)
Also, if I understand correctly, if one builds a new kernel from source, the original older kernel headers should not change, correct?

Yes, your understanding is correct. The existing kernel-headers package should stay in place, even if the running kernel is a newer version.
Quote:

Originally Posted by systemloc (Post 5247531)
I'm asking in part because I like to know how things work. More practically, I am upgrading my slackware 14.0 box to 14.1 using slackpkg. I want to make sure I treat the headers appropriately. I always run a custom kernel and like to know that I'm doing things correctly.

You really only need to worry about any of this if you're writing (or compiling) your own drivers or other low level software.

BCarey 10-05-2014 08:39 PM

Quote:

Originally Posted by systemloc (Post 5247531)
If the above is true, this should mean that any custom software such as slackbuilds packages need to be recompiled. Correct?

You will need to recompile some of these packages, but not because of the kernel headers, rather because some of the libraries linked to will have changed versions enough to need a recompile.

Brian


All times are GMT -5. The time now is 05:41 AM.