Kernel configuration is invalid. include/linux/autoconf.h or include/config/auto.conf are m

来源:互联网 发布:微信 视频编辑软件知乎 编辑:程序博客网 时间:2024/05/02 04:34
[cpp] view plaincopy
  1. #include <linux/init.h>  
  2. #include <linux/module.h>  
  3. MODULE_LICENSE("Dual BSD/GPL");  
  4.   
  5. static int hello_init(void)  
  6. {  
  7.    printk(KERN_ALERT "Hello, world\n");  
  8.    return 0;  
  9. }  
  10.    
  11. static void hello_exit(void)  
  12. {  
  13.    printk(KERN_ALERT "Goodbye, cruel world\n");  
  14.    return 0;  
  15. }  
  16.   
  17. module_init(hello_init);  
  18. module_exit(hello_exit);  

Makefile:

[plain] view plaincopy
  1. KERNELDIR=/opt/EmbedSky/linux-2.6.30.4     
  2. PWD:=$(shell pwd)     
  3. INSTALLDIR=$(PWD)      
  4. CC=arm-linux-gcc    
  5. obj-m := hello.o     
  6. modules:     
  7.     $(MAKE) -C $(KERNELDIR) M=$(PWD) modules     
  8. clean:     
  9.     rm -rf *.o *.ko *.mod.c *.markers *.order *.symvers     
  10. .PHONY:modules clean    

make的时候出现如下错误:

[plain] view plaincopyprint?
  1. make[1]: Entering directory `/opt/EmbedSky/linux-2.6.30.4'  
  2.   
  3.   ERROR: Kernel configuration is invalid.  
  4.          include/linux/autoconf.h or include/config/auto.conf are missing.  
  5.          Run 'make oldconfig && make prepare' on kernel src to fix it.  
  6.   
  7.   
  8.   WARNING: Symbol version dump /opt/EmbedSky/linux-2.6.30.4/Module.symvers  
  9.            is missing; modules will have no dependencies and modversions.  

原来是内核没有编译, 果断配置内核, 然后make

内核编译完之后, 再到hello模块那里make


0 0
原创粉丝点击