I'm attempting to add a kernel module on a Raspbian Debian installation for an SDIO-based wifi module driver( found here: https://hackaday.io/post/28712)

The stable image comes with kernel 4.1, so first I upgraded the kernel(the uname -r command now reports the kernel version as 4.2.7-v7+).

So I run

git clone https://github.com/al177/esp8089.git cd esp8089 make

However, the "make" command returns the "Kernel build tree not found" error. The kernel was compiled from source, but can't find the build tree. I'm in a bit over my head with this.


1 Answer 1


The error you're seeing is caused because it's looking for the build directory in the kernel source. In the instructions I've linked below, that's step 3.

I have described the steps you need to take here: https://raspberrypi.stackexchange.com/a/38991/19435 if you have not used rpi-update to update your kernel.

And that was actually a 'specialized' version of the guide I've written here: https://github.com/diederikdehaas/cknow.org/blob/master/rpi/compile-kernel-module-on-raspberrypi.md which describes the procedure for when you have not used rpi-update but also if you have.

The guide assumes you're compiling on the RPi, thus no cross compiling.

I realize it's customary to provide at least summary in an answer, but that's not possible. It contains several steps which need to be followed 'to the letter'.

It would've been rather easy if the raspberrypi foundation would provide a linux-headers-<version> package, like Debian does, and I've really tried, but thus far unsuccesful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.