野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4424|回复: 9

[求助] linux内核编译不通过

[复制链接]
发表于 2023-3-9 13:57:58 | 显示全部楼层 |阅读模式
编译提示如下:


root@dzw-virtual-machine:/usr/ebf_linux_kernel_6ull_depth1# ./make_deb.sh
make[1]: 进入目录“/usr/ebf_linux_kernel_6ull_depth1/build_image/build”
  GEN     ./Makefile
#
# configuration written to .config
#
make[1]: 离开目录“/usr/ebf_linux_kernel_6ull_depth1/build_image/build”
make[1]: 进入目录“/usr/ebf_linux_kernel_6ull_depth1/build_image/build”
  GEN     ./Makefile
scripts/kconfig/conf  --syncconfig Kconfig
  GEN     ./Makefile
  Using /usr/ebf_linux_kernel_6ull_depth1 as source for kernel
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
scripts/dtc/dtc-lexer.lex.c: In function ‘yylex’:
scripts/dtc/dtc-lexer.lex.c:1118:1: error: ‘dtc’ undeclared (first use in this function)
1118 | dtc-lexer.lex.c_shipped   return DT_REF;
      | ^~~
scripts/dtc/dtc-lexer.lex.c:1118:1: note: each undeclared identifier is reported only once for each function it appears in
scripts/dtc/dtc-lexer.lex.c:1118:5: error: ‘lexer’ undeclared (first use in this function)
1118 | dtc-lexer.lex.c_shipped   return DT_REF;
      |     ^~~~~
scripts/dtc/dtc-lexer.lex.c:1118:24: error: expected ‘;’ before ‘return’
1118 | dtc-lexer.lex.c_shipped   return DT_REF;
      |                        ^  ~~~~~~
      |                        ;
make[3]: *** [scripts/Makefile.host:107:scripts/dtc/dtc-lexer.lex.o] 错误 1
make[2]: *** [/usr/ebf_linux_kernel_6ull_depth1/scripts/Makefile.build:544:scripts/dtc] 错误 2
make[1]: *** [/usr/ebf_linux_kernel_6ull_depth1/Makefile:1067:scripts] 错误 2
make[1]: *** 正在等待未完成的任务....
make[1]: 离开目录“/usr/ebf_linux_kernel_6ull_depth1/build_image/build”
make: *** [Makefile:146:sub-make] 错误 2
make[1]: 进入目录“/usr/ebf_linux_kernel_6ull_depth1/build_image/build”
/bin/bash /usr/ebf_linux_kernel_6ull_depth1/scripts/package/mkdebian
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -b -nc -uc
dpkg-buildpackage: 警告: 使用超级用户命令
dpkg-buildpackage: info: 源码包 linux-upstream
dpkg-buildpackage: info: 源码版本 1stable
dpkg-buildpackage: info: source distribution bionic
dpkg-buildpackage: info: 源码修改者 root <root@dzw-virtual-machine>
dpkg-buildpackage: info: 主机架构 armhf
dpkg-source --before-build .
debian/rules build
make KERNELRELEASE=4.19.35-carp-imx6 ARCH=arm         KBUILD_BUILD_VERSION=1stable KBUILD_SRC=
  GEN     ./Makefile
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
scripts/dtc/dtc-lexer.lex.c: In function ‘yylex’:
scripts/dtc/dtc-lexer.lex.c:1118:1: error: ‘dtc’ undeclared (first use in this function)
1118 | dtc-lexer.lex.c_shipped   return DT_REF;
      | ^~~
scripts/dtc/dtc-lexer.lex.c:1118:1: note: each undeclared identifier is reported only once for each function it appears in
scripts/dtc/dtc-lexer.lex.c:1118:5: error: ‘lexer’ undeclared (first use in this function)
1118 | dtc-lexer.lex.c_shipped   return DT_REF;
      |     ^~~~~
scripts/dtc/dtc-lexer.lex.c:1118:24: error: expected ‘;’ before ‘return’
1118 | dtc-lexer.lex.c_shipped   return DT_REF;
      |                        ^  ~~~~~~
      |                        ;
make[8]: *** [scripts/Makefile.host:107:scripts/dtc/dtc-lexer.lex.o] 错误 1
make[7]: *** [/usr/ebf_linux_kernel_6ull_depth1/scripts/Makefile.build:544:scripts/dtc] 错误 2
make[6]: *** [/usr/ebf_linux_kernel_6ull_depth1/Makefile:1067:scripts] 错误 2
make[5]: *** [Makefile:146:sub-make] 错误 2
make[4]: *** [Makefile:24:__sub-make] 错误 2
make[3]: *** [debian/rules:4:build] 错误 2
dpkg-buildpackage: 错误: debian/rules build subprocess returned exit status 2
make[2]: *** [/usr/ebf_linux_kernel_6ull_depth1/scripts/package/Makefile:80:bindeb-pkg] 错误 2
make[1]: *** [/usr/ebf_linux_kernel_6ull_depth1/Makefile:1365:bindeb-pkg] 错误 2
make[1]: 离开目录“/usr/ebf_linux_kernel_6ull_depth1/build_image/build”
make: *** [Makefile:146:sub-make] 错误 2


回复

使用道具 举报

发表于 2023-3-9 20:59:16 | 显示全部楼层
什么版本的ubuntu
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-10 15:04:04 | 显示全部楼层

22.04.1版本
回复 支持 反对

使用道具 举报

发表于 2023-3-11 08:52:24 | 显示全部楼层

不要用22版本的,不行的,换网盘18.04的ubuntu,网盘->6、开发软件
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-11 22:11:05 | 显示全部楼层
おおおじ。 发表于 2023-3-11 08:52
不要用22版本的,不行的,换网盘18.04的ubuntu,网盘->6、开发软件

好的,谢谢!等我换了再试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-13 18:39:37 | 显示全部楼层
おおおじ。 发表于 2023-3-11 08:52
不要用22版本的,不行的,换网盘18.04的ubuntu,网盘->6、开发软件

也不行。
执行sudo ./make_deb.sh有以下的错误:
make KERNELRELEASE=4.19.35-carp-imx6 ARCH=arm         KBUILD_BUILD_VERSION=1stable KBUILD_SRC=
make[5]: *** /usr/ebf_linux_kernel_6ull_depth1: 没有那个文件或目录。 停止。
Makefile:24: recipe for target '__sub-make' failed
make[4]: *** [__sub-make] Error 2
debian/rules:4: recipe for target 'build' failed
make[3]: *** [build] Error 2
dpkg-buildpackage: 错误: debian/rules build subprocess returned exit status 2
/home/book/embedfire/ebf_linux_kernel_6ull_depth1/scripts/package/Makefile:79: recipe for target 'bindeb-pkg' failed
make[2]: *** [bindeb-pkg] Error 2
/home/book/embedfire/ebf_linux_kernel_6ull_depth1/Makefile:1365: recipe for target 'bindeb-pkg' failed
make[1]: *** [bindeb-pkg] Error 2
make[1]: 离开目录“/home/book/embedfire/ebf_linux_kernel_6ull_depth1/build_image/build”
Makefile:146: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-13 20:06:12 | 显示全部楼层
おおおじ。 发表于 2023-3-11 08:52
不要用22版本的,不行的,换网盘18.04的ubuntu,网盘->6、开发软件


野火论坛202303132006067265..png
回复 支持 反对

使用道具 举报

发表于 2023-3-13 23:23:53 | 显示全部楼层
确认下步骤:
sudo apt install make gcc-arm-linux-gnueabihf gcc bison flex libssl-dev dpkg-dev lzop
git clone  https://gitee.com/Embedfire/ebf_linux_kernel_6ull_depth1.git
cd /ebf_linux_kernel_6ull_depth1

sudo make mrproper
sudo ./make_deb.sh
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-16 17:51:47 | 显示全部楼层
おおおじ。 发表于 2023-3-13 23:23
确认下步骤:
sudo apt install make gcc-arm-linux-gnueabihf gcc bison flex libssl-dev dpkg-dev lzop
g ...

重新创建虚拟机之后,就可以了,感谢!
回复 支持 反对

使用道具 举报

发表于 2023-7-25 12:42:09 | 显示全部楼层
激昂旋律 发表于 2023-3-16 17:51
重新创建虚拟机之后,就可以了,感谢!

兄弟具体怎么做我也遇到同意的问题了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-3-29 00:51 , Processed in 0.043258 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表