I'm trying to build module.
But here's some issues.
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 will have no dependencies and modversions.`
And here's my makefile
ifeq ($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
.PHONY: modules modules_install clean
else
# called from kernel build system: just declare what our modules are
obj-m := hello.o hellop.o seq.o jit.o jiq.o sleepy.o complete.o \
silly.o faulty.o kdatasize.o kdataalign.o
endif
I tried building like this:
export KERNELDIR=/path/to/extern/linux/source
make
How can I solve this problem?
To configure the kernel, change to /usr/src/linux and enter the command make config. Choose the features you want supported by the kernel. Usually, There are two or three options: y, n, or m. m means that this device will not be compiled directly into the kernel, but loaded as a module.
The Linux kernel configuration is usually found in the kernel source in the file: /usr/src/linux/. config .
config file in the root directory of the kernel tree. The configuration file itself can be generated by issuing the make menuconfig command.
Okay, so I would try to re-install the linux-headers. Tell me if this works! Or if it didn't!
in a terminal(bash presumably):
root privileges required!
if you're not root:
sudo apt install --reinstall linux-headers-$(uname -r)
sudo reboot
# or now: add a now
If you already are root:
apt install --reinstall linux-headers-$(uname -r)
and then reboot
# or now: add a now
If you get it couldn't find any package, (or similar) (from apt)
try apt update
and re-try the above.
I don't know if this could be of any help, but - check /var/log/kern.log
for any messages
I solved this problem with the following commands:
.config
file with kernel configuration. Copy it to kernel-source
directory (e.g.: build/tmp/work-shared/lmm-corei7/kernel-source
).make prepare
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With