Using Linux Kernel Headers for module development

I'm trying to add support for Razer Anansi to the Linux Razer project. I just can't figure out how to get access to Kernel Headers. I require linux/usb/input.h, as well as a few other headers, which I don't see under /usr/include/linux. How would I go about getting this header?

1 Like
#find / -type f -name input.h

If you don't find it that way, on my system (Arch Linux) the file /usr/include/linux/input.h is part of the linux-api-headers. On your distro it should be something similar.

Yeah, I'm running Ach as well. Alright, it's under `/usr/lib/modules/${uname - r} /build/includes/linux/usb/input.h' (I don't have the computer up so the actual path might be slightly different)

'/usr/include/linux/input.h' is actually a different header.

I need to play around with my cmake build settings slightly since the compiler is still trying to use the standard path for Linux headers. I believe I need to have cmake call kbuild to correctly build Linux kernel modules. (with a less complicated cmake) I'm only using cmake for this since I prefer CLion for c/c++ development. Anyone have any idea where I should start for getting cmake to play nicely with kernel development?