Include/Linux/Autoconf. h or include/config/auto. conf are missing.

Source: Internet
Author: User

A simple device driver is developed:

Arm_hello.c

#include <linux/module.h>static int hello_init(void){    printk("Hello, I am coming !\n");    return 0;}static void hello_exit(void){    printk("Goodbye, I Love Linux ! I Love ARM ! \n");}module_init(hello_init);module_exit(hello_exit);

Makefile:

#--------------------------for ARM----------------------------------CROSS_COMPILE := /opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-CC :=$(CROSS_COMPILE)gccKERNEL_DIR := /opt/FriendlyARM/mini2440/linux-2.6.32.2#------------------------------------------------------------------obj-m :=ARM_hello.oPWD := $(shell pwd)all:make -C $(KERNEL_DIR) M=$(PWD) modulesclean:rm -fr *.o *.ko *.mod.o *.mod.c .*.cmd *.order *.*s *~ .tmp*

Run

$ Sudo make

The following error occurs:

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.

Everything on the internet is about how to compile the kernel and make menuconfig. At that time, I did not dare to compile the kernel at will, for fear of killing the system.

Later, I suddenly remembered that I had not fully read the manual. So I went to the manual to compile the kernel, which is the ARM kernel, it is necessary to create a kernel compiling environment similar to arm on the PC, that is, the cross compiling environment. Therefore, compile the kernel of arm according to the manual.

The specific operations are described in my other blog post: errors in the Cross-compilation environment during kernel Compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.