Missing linux-headers

Scott J. Crouch scottjcrouch at gmail.com
Sun Oct 9 21:11:23 EDT 2022


On 9/10/22 17:10, neutrino network wrote:
> This is a test on a patched kernel. The patch has an API for userspace programs.

Ok, ignore what I said earlier.  Headers necessary for using the user-space API
are exported with the *user-space* headers.  That's the stuff sitting in
<kernel_src>/include/uapi/ (and some other parts).

> Trying to install headers with "sudo yum -y install kernel-headers" returns that headers are already installed even its removal reinstall the old kernel headers
>  Triedalso "yum install kernel-headers-$(uname -r)|| " !

These are indeed the user-space headers.  However, if your kernel patch is
private, then any changes to the user-space headers won't be in there.

If you're instead relying on kernel headers from the kernel source (which is
not something you would normally do), then you need to tell gcc with something 
like "-I</path/to/header-files>".  (If this is what you're actually trying to
do, then ignore what I've said below.)

> How can my application point to the kernel source, does it require settings in glibc?
> 
> Tried "make headers_install" in kernel source but still faced the error issue ! btw if a destination directory is passed e.g "make headers_install INSTALL_HDR_PATH=/usr/include", i found that "net" directory is missing in the destination directory it only place some files and not all, am i using it correctly?

"make INSTALL_HDR_PATH="/usr/local" headers_install" is probably what you want
(note I didn't put "include/" in the path).  Depending on how the toolchain is
configured, it should be looking for headers in /usr/local/include first,
/usr/include/ second (you can see what it's doing with "cpp -v").

Hope that helps,

Scott.



More information about the Kernelnewbies mailing list