LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-01-2014, 10:26 AM   #1
systemloc
LQ Newbie
 
Registered: Oct 2014
Posts: 8

Rep: Reputation: Disabled
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.

Last edited by onebuck; 10-03-2014 at 12:08 PM. Reason: correct subject title to be specific
 
Old 10-02-2014, 11:43 AM   #2
Philip Lacroix
Member
 
Registered: Jun 2012
Distribution: Slackware
Posts: 441

Rep: Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574
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.

Last edited by Philip Lacroix; 10-02-2014 at 11:56 AM. Reason: typo
 
1 members found this post helpful.
Old 10-03-2014, 12:09 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
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.
 
Old 10-05-2014, 06:48 PM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,440
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by systemloc View Post
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 View Post
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 View Post
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 View Post
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 View Post
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 View Post
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.
 
Old 10-05-2014, 08:39 PM   #5
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by systemloc View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[kernel-headers-3.2.45-x86-3] OR [kernel-headers-3.2.45_smp-x86-3]? Sefid par Slackware 3 07-24-2013 09:59 AM
[SOLVED] After upgrading to kernel 3.8 module-assistant can't find kernel headers (Debian Sid) Hungry ghost Debian 9 05-16-2013 07:59 PM
Trying to install ethernet adapter driver, not finding kernel-devel or kernel-headers oneFishtwoFish Red Hat 5 08-31-2010 06:24 PM
Zypper wants to dl the wrong kernel headers... YaST doesnt have current headers zorb SUSE / openSUSE 2 11-28-2009 11:12 AM
Automatic removal of kernel headers package when kernel packages are removed bgoodr Debian 3 12-30-2008 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration