编译Linux内核kernel时遇到的问题与解决方案

问题1:scripts/sign-file.c:25:10: fatal error: openss1/opensslv.h: No such file or directory

image-20211129212256785

解决方法:

sudo apt-get install libssl-dev

问题2:/bin/sh: 1: flex: not found

image-20211129212528597

解决方法

sudo apt-get install flex

问题3:/bin/sh: 1: bison: not found

image-20211129212703451

解决方法

image-20211129212734278

sudo apt-get install bison -y

问题4:/hone/ysz/Desktop/os/linux-5.15.5/tools/objtool/include/objtool/elf.h:10:10: fatal error: gelf.h: No such file or directory

解决方法

sudo apt-get install libelf-dev

问题5:make[1]😗**No rule to nake target ‘debian/canonical-certs.pew’, needed by ‘certs/x509_certificate_list’.Stop.

image-20211129213507940

解决方法

编辑.config文件
vim .config

将文件中的CONFIG_SYSTEM_TRUSTED_KEYS置空如下

CONFIG_SYSTEM_TRUSTED_KEYS=""

(打开文件后输入“/”查找其所在的命令行)

之后make clean再make

问题6:arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support

解决方法

sudo apt-get install binutils

问题7:sed: can’t read modules.order : No such file or directory

解决方法

查看文件名是否存在空格,删掉空格就可以正常运行了(别问为什么,我也不知道)

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐