LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   kernel-headers (https://www.linuxquestions.org/questions/slackware-14/kernel-headers-4175693631/)

wigums 04-13-2021 03:03 PM

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??

igadoter 04-13-2021 03:08 PM

For me the best solution is to have both kernels. LTS 5.10.x and 5.11.x

enorbet 04-13-2021 03:14 PM

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.

bassmadrigal 04-13-2021 06:01 PM

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.

chrisretusn 04-13-2021 07:49 PM

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.

nullptr 04-13-2021 08:55 PM

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.

igadoter 04-14-2021 02:20 AM

The sentence go on
Quote:

You can have a newer linux-headers version then your running kernel binary.

GazL 04-14-2021 05:01 AM

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,

Petri Kaukasoina 04-14-2021 05:15 AM

Quote:

Originally Posted by nullptr (Post 6240797)
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 (Post 6240853)
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.

hazel 04-14-2021 05:29 AM

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.

Petri Kaukasoina 04-14-2021 05:30 AM

Quote:

Originally Posted by GazL (Post 6240885)
headers be kept the same as used at glibc build time

I have followed this (although it probably does not matter).

GazL 04-14-2021 05:51 AM

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.

enorbet 04-14-2021 06:10 AM

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".

walecha 04-14-2021 06:36 AM

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


hazel 04-14-2021 06:36 AM

Quote:

Originally Posted by enorbet (Post 6240913)
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.


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