Re: Missing linux-headers

2022-10-09 Thread Scott J. Crouch
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
/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".  (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.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Missing linux-headers

2022-10-07 Thread Scott J. Crouch
On 8/10/22 15:01, neutrino network wrote:
> How to update linux-headers for kernel (6.0.0) compiled from source in centos?
> 
> System has kernel 4.18 headers while kernel is 6.0, however userspace program 
> generates  error e.g*fatal error: linux/mutex.h: No such file or directory*

linux/mutex.h is a kernel header.  User-space programs don't use those.

Are you trying to compile an out-of-tree module by any chance?  If so, you 
should
probably install the kernel development headers packaged by your distribution,
and point your makefile to those (or you can just point it to the directory 
where
you built your kernel).

Hope that helps.

Scott.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies