October 2017
Intermediate to advanced
586 pages
14h 8m
English
Before you can build an external module, you need to have a complete and precompiled kernel source tree. The kernel source tree version must be the same as the kernel you'll load and use your module with. There are two ways to obtain a prebuilt kernel version:
sudo apt-get update sudo apt-get install linux-headers-$(uname -r)
This will install only headers, not the whole source tree. Headers will then be installed in /usr/src/linux-headers-$(uname -r). On my computer, it is /usr/src/linux-headers-4.4.0-79-generic/. There will be a symlink, /lib/modules/$(uname -r)/build, pointing to the previously installed headers. ...