dkms icon indicating copy to clipboard operation
dkms copied to clipboard

Support for using /proc/kheaders.tar.xz

Open z3ntu opened this issue 5 years ago • 3 comments

Starting with Linux 5.2-rc1, the option Enable kernel header artifacts through /proc/kheaders.tar.xz (IKHEADERS_PROC) is available in the kernel configuration. I think it would be good to use this, if available.

The commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43d8ce9d65a54846d378545770991e65838981e0

z3ntu avatar May 24 '19 18:05 z3ntu

And it's moved to a new position already (or soon) ;)

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f7b101d33046a837c2aa4526cef28a3c785d7af2

New location: /sys/kernel/kheaders.tar.xz

z3ntu avatar Jun 03 '19 16:06 z3ntu

Note: https://cateee.net/lkddb/web-lkddb/IKHEADERS_PROC.html

scaronni avatar May 22 '22 19:05 scaronni

@scaronni This link is from before the commit linked in my second comment. It's now in sysfs. See https://github.com/torvalds/linux/blob/master/init/Kconfig#L707-L714 and https://cateee.net/lkddb/web-lkddb/IKHEADERS.html

z3ntu avatar May 23 '22 10:05 z3ntu

Quickly looking at this - the new sys location commit has landed a while ago.

Is seems like the option is a module (not a built-in), and not many distros enable it. So in order to use it, one needs to modprobe, which does not sound great.

Comparing the files it ships against the ones otherwise available by the respective "headers" package (5.15.115 for example), we have:

  • around 6k files, where over 5.7k of those differ - the comments are stripped out, but didn't confirm if there's anything subtle/important that has disappeared
  • another 50 non-header files are missing - kconfig/kbuild/makefiles without which one cannot easily build modules

So it seems to me that even if we add support for this corner-case, it will serve only a small subset of dkms modules. That said I'm inclined that we should close this.

Of course, feel free to correct me and provide an example where the usual headers package cannot (or should not) be used and kheaders.tar.xz is the only reasonable option. Happy to reopen in that case.

evelikov avatar Jun 06 '23 16:06 evelikov