LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-10-2017, 04:59 PM   #1
Time4Tea
LQ Newbie
 
Registered: Oct 2017
Posts: 16

Rep: Reputation: Disabled
When to update linux kernel headers?


When is it necessary to update the linux kernel headers, especially for a source-based distribution (Gentoo, LFS, etc.)?

In particular, the Linux From Scratch (LFS) page for installing the kernel says that the installed headers should 'always be the ones against which glibc was compiled' and should never be replaced under any circumstances.

So, does that mean that if I install kernel version 4.12.7 now, and then upgrade it to a newer version later (say 4.13.1), that I should keep the 4.12.7 kernel headers installed? In that case, will the newer rev kernel still be fully compatible with the 4.12.7 headers?

If so, how far does this header compatibility go? For example, if I have a package-based distro that comes with kernel version 3.13, is it ok for me to upgrade to kernel version 4.13.1 and it will still be compatible with the 3.13 headers?

Thanks in advance!
 
Old 10-11-2017, 05:32 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,690

Rep: Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886
Quote:
Originally Posted by Time4Tea View Post
When is it necessary to update the linux kernel headers, especially for a source-based distribution (Gentoo, LFS, etc.)?

In particular, the Linux From Scratch (LFS) page for installing the kernel says that the installed headers should 'always be the ones against which glibc was compiled' and should never be replaced under any circumstances.

So, does that mean that if I install kernel version 4.12.7 now, and then upgrade it to a newer version later (say 4.13.1), that I should keep the 4.12.7 kernel headers installed? In that case, will the newer rev kernel still be fully compatible with the 4.12.7 headers?

If so, how far does this header compatibility go? For example, if I have a package-based distro that comes with kernel version 3.13, is it ok for me to upgrade to kernel version 4.13.1 and it will still be compatible with the 3.13 headers?

Thanks in advance!
That's the theory. Kernel headers are kept separate from kernel source and separately installed. In practise, a new distro install/upgrade should mean a new set of headers, because you're updating glibc. In the past I hit bother in kernel building when I transitioned from 2.x.x kernels to 3.x.x ones, and I took it as a hint do do a full reinstall. I forget what I did with glibc. Your toolchain is: kernel headers; glibc; gcc.

When updating headers, I used the latest conveniently available kernel source; I don't download a bleeding edge source for the headers. A new kernel is mainly inclined to mean new drivers for obscure stuff, and (these days) Arm cpus, and a little less of yesterday's technology.
 
Old 10-11-2017, 09:08 AM   #3
Time4Tea
LQ Newbie
 
Registered: Oct 2017
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks for your reply, business_kid. So, if I get this right, it's ok for the headers to not be exactly the same version as the kernel, but if I ever want to change/update the headers for any reason, I should re-compile glibc against those headers?

Quote:
When updating headers, I used the latest conveniently available kernel source; I don't download a bleeding edge source for the headers.
Sorry, could you clarify what you mean by 'latest conveniently available kernel source?'
 
Old 10-11-2017, 11:53 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 8,690

Rep: Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886
Quote:
Sorry, could you clarify what you mean by 'latest conveniently available kernel source?'
Whatever source is on the distro, which also will usually have the matching kernel headers installed.
 
Old 10-11-2017, 04:17 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,681
Blog Entries: 4

Rep: Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023Reputation: 3023
Also notice that most headers, most of the time, don't actually change. Certainly not the ones glibc might be interested in . . .

And, if any of those do change, you'll probably need to rebuild glibc.
 
  


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
Update to new kernel, do I need to build new kernel headers? deretsigernu Slackware 4 06-27-2017 04:32 AM
[SOLVED] Currents Mkinitrd update for issues with LUKS disks and When to delete old kernel/headers/modules from boot? bamunds Slackware 7 09-24-2016 04:46 PM
[SOLVED] Apt-get update question on Linux headers jraz Ubuntu 9 11-22-2011 03:18 AM
I Can't Update To The Most Recent Kernel/Headers davidx Linux - Software 18 10-19-2008 10:57 PM
INstalling Kernel Headers to update nvidia driver plbowler Mandriva 5 09-14-2006 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:51 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration