字元驅動裝置踩坑

天才是從醒悟開始的發表於2020-12-03

1.編譯原始碼出現:

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 /root/linux-3.5.0/Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
/root/linux-3.5.0/scripts/Makefile.modpost:42: include/config/auto.conf: No such file or directory
make[2]: *** No rule to make target `include/config/auto.conf'.  Stop.
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/root/linux-3.5.0'
make: *** [default] Error 2

解決方案:進入原始碼目錄中執行以下語句

make oldconfig && make prepare

執行完後又出現了錯誤: linux-核心匯入配置 lexer.lex.c錯誤

解決方法:

sudo apt-get install bison
sudo apt-get install flex

然後又出現錯誤: fatal error: openssl/opensslv.h: No such file or directory

解決方法:

sudo apt-get install libssl-dev

嗯,又有錯誤。。。。:Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" 

解決方法:

apt install libelf-dev

 

相關文章