Error:
ERROR: Kernel configuration is invalid. include/linux/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. WARNING: Symbol version dump /usr/src/linux-2.6.32/Module.symvers is missing; modules will have no dependencies and modversions.
simply because the source code of the kernel has been downloaded and compiled earlier.
This is how you should compile any kernel module.
After loading the kernel source, you must prepare it to add any modules to it.
Copy the old “config-xxxx” file from the / boot / directory to the new kernel source directory and rename it as “.config”.
Then run "make oldconfig", which will take a backup of .config in .config.old and regenerate a new .config based on the new kernel source. Just enter "ENTER" for all the default settings (many of them).
Next, you need to do “make” (and wait for a while) - it will generate a new kernel file “vmlinux” along with many other files that are read by the compilation process of the modules.
Now you can go to the directory where the source code of the kernel module is located, and based on the following Makefile:
obj-m += hello-1.o default: modules modules: make -C /kernel_source/ M=$(PWD) modules clean: make -C /kernel_source/ M=$(PWD) clean
Together with the Makefile are your header file and the source file, which is hello-1.c, located together.
Just "make" and your kernel modules should be generated successfully.
source share