dkms
dkms copied to clipboard
Support for using /proc/kheaders.tar.xz
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
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
Note: https://cateee.net/lkddb/web-lkddb/IKHEADERS_PROC.html
@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
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.