04.2, 4.8.0-36-generic kernel, I'm failing to compile a module using only linux headers because of missing files that are included in the kernel source, I've downloaded the kernel source using apt-get source linux-image-$(uname -r)
Makefile
obj-m+=modyy.o
all:
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean
content of /lib/modules/$(uname -r)/build
$ ls -al /lib/modules/$(uname -r)/build
lrwxrwxrwx 1 root root 39 27 14:37 /lib/modules/4.8.0-36-generic/build -> /usr/src/linux-headers-4.8.0-36-generic
Compilation failure
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
WARNING: Symbol version dump ./Module.symvers is missing; modules have no dependencies and modversions.
I tried to create link from /lib/modules/4.8.0-36-generic/build the kernel source /usr/src/linux-hwe-4.8.0
but it compilation failed, Is that the correct method to compile using the kernel source?
How can I compile the module using the kernel source?
Thanks.
linux-headers-4.8.0-36-genericpackages.ubuntu.com/xenial-updates/… ? You simply can't use symlink to kernel source, as the source have no configuration files needed to build the modules to the current kernel (And it is hard to recreate needed configs exactly for your kernel). - osgx