LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-13-2021, 03:03 PM   #1
wigums
Member
 
Registered: Oct 2013
Location: Detroit
Distribution: slackware and raspbian
Posts: 126

Rep: Reputation: Disabled
kernel-headers


if youre not supposed to blacklist kernel headers package (re: comment in /etc/slackpkg/blacklist) but im running the /testing 5.11.x kernel do i go ahead and run the 5.11.x headers and indeed blacklist them since im manually doing the kernel upgrades??
 
Old 04-13-2021, 03:08 PM   #2
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
For me the best solution is to have both kernels. LTS 5.10.x and 5.11.x
 
Old 04-13-2021, 03:14 PM   #3
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
It seems to me likely that more people than not use stock kernels so "headers" are for them. I build my own. I blacklist headers. Works fine.
 
Old 04-13-2021, 06:01 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
See this thread.

Medium story short, it probably doesn't matter what you do. The kernel headers have remained pretty stable for the past many years and it's unlikely that it'll matter what one you have installed. I still have the 4.4.x headers installed on my 14.2 system, but I'm running the 5.10 kernel. That's 5 years of major kernel releases from my headers to what I'm running and I've not run into a single problem tied to it.
 
4 members found this post helpful.
Old 04-13-2021, 07:49 PM   #5
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,969

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
I run with the kernel-header version of the kernel version I am using. Right now it's 5.11.13. I have 5.11.12 and 5.10.29 installed.
 
Old 04-13-2021, 08:55 PM   #6
nullptr
Member
 
Registered: Nov 2019
Posts: 50

Rep: Reputation: Disabled
https://wiki.gentoo.org/wiki/Linux-headers
Quote:
A common question regarding linux-headers is whether you need to keep them synced with your kernel version. The answer is no.
 
1 members found this post helpful.
Old 04-14-2021, 02:20 AM   #7
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
The sentence go on
Quote:
You can have a newer linux-headers version then your running kernel binary.
 
Old 04-14-2021, 05:01 AM   #8
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
I still hold with the mantra that headers should be older than the used kernel and be kept the same as used at glibc build time.

It seems obvious to me that newer headers could expose unsupported features when it's the other way around. Older headers mean that new features may not be available for use, but that's far less likely to break anything which gives any consideration to backward compatibility.

My 2c,
 
1 members found this post helpful.
Old 04-14-2021, 05:15 AM   #9
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,783

Rep: Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460
Quote:
Originally Posted by nullptr View Post
A common question regarding linux-headers is whether you need to keep them synced with your kernel version. The answer is no.
Quote:
Originally Posted by igadoter View Post
You can have a newer linux-headers version then your running kernel binary.
Those are from the glibc wiki, telling which linux-headers should be used when compiling glibc. If you build glibc, use the newest linux-headers available so your glibc will be able to use the latest kernel features, if available. It does not matter which kernel you run when building glibc, and it does not matter on which kernel you will use the new glibc.

The kernel hardly gets new features for glibc when the latest number of the kernel version changes during a stable kernel version series, so kernel-headers-5.11.0 is as good as kernel-headers-5.11.14 for building glibc. But if you build glibc against kernel-headers-5.10.x, you might miss some new feature. If linux-5.11 introduced some new feature that glibc can use, and glibc is built against kernel-headers-5.11.x, the feature is available when running on kernel >= 5.11, but glibc works ok with kernel 5.10 and older, too, but without that feature.

If you are not building glibc yourself, use whatever kernel-headers.

Last edited by Petri Kaukasoina; 04-14-2021 at 05:20 AM.
 
1 members found this post helpful.
Old 04-14-2021, 05:29 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
I was always told that if you use a pre-built glibc (as most users do) and you want to compile other software against it, then you should always use the kernel headers against which that version of glibc was built, regardless of what kernel you are actually running. Because the build scripts might access the kernel headers directly and they should not find anything in them that might conflict with the values assumed by glibc.
 
Old 04-14-2021, 05:30 AM   #11
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,783

Rep: Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460Reputation: 1460
Quote:
Originally Posted by GazL View Post
headers be kept the same as used at glibc build time
I have followed this (although it probably does not matter).
 
Old 04-14-2021, 05:51 AM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Yeah, I think it's one of those in practice vs in theory, situations, but IMO best to play it safe.

In CRUX the headers are part of the glibc package itself: glibc 2.32 and headers from 5.4.72, so they're a little bit behind what Slackware current is shipping.
 
Old 04-14-2021, 06:10 AM   #13
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
If I understand correctly, kernel headers is just an inclusive name for kernel source unpacked in /usr/src. So if one builds his kernels rather than relying on a kernel package by definition the proper "kernel headers" (AND "headers" actually built with the running GCC) exist. "A rose by any other name still smells as sweet".
 
Old 04-14-2021, 06:36 AM   #14
walecha
Member
 
Registered: Jan 2010
Location: Malang, +62
Distribution: slackware
Posts: 174

Rep: Reputation: 42
Actually Linux kernel header for the running kernel can be found in /sys/kernel/kheaders.tar.xz. Slackware already ship it as module. You can load it using modprobe and then extract it into some dir and using it for your build.
Code:
grep -i CONFIG_IKHEADERS /boot/config-generic-* 
CONFIG_IKHEADERS=m
 
1 members found this post helpful.
Old 04-14-2021, 06:36 AM   #15
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by enorbet View Post
If I understand correctly, kernel headers is just an inclusive name for kernel source unpacked in /usr/src. So if one builds his kernels rather than relying on a kernel package by definition the proper "kernel headers" (AND "headers" actually built with the running GCC) exist.
Not quite. The kernel headers are part of the source tarball. They get installed by using a make install_headers instruction. If you are just building a kernel for use (for example to take advantage of a new hardware driver) you wouldn't normally install the headers at all, only the bz image and the modules.
 
  


Reply



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
Why Does Linux Headers Keep Including Too Many Headers? minivy Linux - Kernel 2 12-07-2011 02:16 PM
Confused: Which headers are "The Headers"? Couling Linux - Software 4 06-15-2010 01:29 PM
Zypper wants to dl the wrong kernel headers... YaST doesnt have current headers zorb SUSE / openSUSE 2 11-28-2009 11:12 AM
Difference between packages linux-headers-foo and linux-headers-foo-generic? jhwilliams Ubuntu 1 10-19-2009 05:04 AM

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

All times are GMT -5. The time now is 05:42 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
Open Source Consulting | Domain Registration