5 ms·
> embed the kernel headers within the kernel image itself and make it available through the sysfs virtual filesystem (usually mounted at /sys) as a compressed a
by kumbel 7y ago
> embed the kernel headers within the kernel image itself and make it available through the sysfs virtual filesystem (usually mounted at /sys) as a compressed archive file (/sys/kernel/kheaders.tar.xz)
eeww
- quotemstr 7y agoWhy eww?
- forgottenpass 7y agoFile this one under: kludges to get around openly user-hostile userland.
- MBCook 7y agoHow so? Seems like an elegant enough solution to ensure you always have the right headers to build modules against the currently running kernel.
- deleted 7y ago[deleted]
- AnIdiotOnTheNet 7y agoAn elegant solution would be not having that problem in the first place.
- forgottenpass 7y agoIsn't kernel header availability a solved problem on any linux system that isn't busy pretending not to be built on linux?
- danudey 7y agoThe nice thing about this is that you can keep kernel headers around in a much smaller format on-disk, while still making them available separately as a package if you want. A few problems this solves: 1. Neither user nor tool knows specifically how to install the headers for specifically this version of the kernel. 2. Manually installing a header package on e.g. Ubuntu marks it as manually selected, meaning it doesn't get cleaned up with an 'autoremove'; selecting a generic kernel headers package (like linux-headers-4.14-generic or something) means that every time your system auto-updates the kernel package version (which happens by default on, for example, AWS IIRC, and happens a lot) you end up with yet another copy of the kernel headers, and then you blow your I/O budget uninstalling them. 3. It removes one extra step to running e.g. an eBPF program, or building an e.g. out-of-tree kernel module, so make scripts can now start to take advantage of that. For example: # Get headers if modprobe kernel_headers; then <unpack the tgz> else <scan through /usr/src, /usr/local/src, etc. for what looks like the right version, or fail> fi
- tssva 7y agoThe article goes into detail as to why this actually can't be used to build modules against the currently running kernel.
- sigjuice 7y agoDid you read the article? Or even the title? How is userland involved in any of this?
- d33 7y agoWhy tarred and compressed though? If it wasn't, one could point a compiler directly at it.
- WhatIsDukkha 7y agoIt goes into that, at length, in the article.
- dang 7y ago"Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something." https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html