如何在iMX6S上交叉编译内核驱动程序?

时间:2020-07-16 06:43:51

标签: c linux cross-compiling kernel-module

我正在使用内核版本为4.9.88的iMX6S-EVK ARMV7。我正在写一些简单的内核驱动程序。我还下载了linux 4.9.88内核。但是当我编译时,出现了这个错误:

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.

CC [M]
/home/user1/Desktop/exploringBB/extras/kernel/gpio_test/gpio_test.o
In file included from <command-line>:0:0:
././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h:
No such file or directory compilation terminated.

这是我的Makefile:

KERNEL ?= /home/user1/Desktop/linux 
ARCH ?= arm 
CROSS_COMPILE ?= arm-linux-gnueabihf- 
obj-m+=hello.o
all: 
make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL) M=$(PWD) modules 
clean: 
make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL) M=$(PWD) clean

我执行以下命令进行构建:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

我错过了什么吗?我现在该怎么办?

0 个答案:

没有答案