首页 > 解决方案 > Yocto:使用 Bitbake 构建图像时出错

问题描述

我正在尝试按照Yocto中描述的图像构建说明进行操作。我做了完全相同的事情,另外我为图像构建释放了多达 150GB 的存储空间。但是,当我运行时bitbake imx-image-core,出现以下错误:

Initialising tasks: 100% |##################################################| Time: 0:00:03
Sstate summary: Wanted 2482 Found 0 Missed 2482 Current 82 (0% match, 3% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
WARNING: bjam-native-1.71.0-r0 do_fetch: Failed to fetch URL https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2, attempting MIRRORS if available
WARNING: cwautomacros-native-20110201-r0 do_fetch: Failed to fetch URL https://downloads.sourceforge.net/cwautomacros.berlios/cwautomacros-20110201.tar.bz2, attempting MIRRORS if available
WARNING: socat-1.7.3.3-r0 do_fetch: Failed to fetch URL http://www.dest-unreach.org/socat/download/socat-1.7.3.3.tar.bz2, attempting MIRRORS if available
WARNING: linux-imx-headers-5.4-r0 do_fetch: Failed to fetch URL git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=imx_5.4.70_2.3.0, attempting MIRRORS if available
WARNING: llvm-project-source-9.0.1-9.0.1-r0 do_fetch: Failed to fetch URL git://github.com/llvm/llvm-project;protocol=https;branch=release/9.x, attempting MIRRORS if available
ERROR: llvm-project-source-9.0.1-9.0.1-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; unset _PYTHON_SYSCONFIGDATA_NAME; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1974"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/sami/edm_yocto/sources/poky/scripts:/home/sami/edm_yocto/build-xwayland/tmp/work-shared/llvm-project-source-9.0.1-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/home/sami/edm_yocto/build-xwayland/tmp/work-shared/llvm-project-source-9.0.1-r0/recipe-sysroot/usr/bin/crossscripts:/home/sami/edm_yocto/build-xwayland/tmp/work-shared/llvm-project-source-9.0.1-r0/recipe-sysroot-native/usr/sbin:/home/sami/edm_yocto/build-xwayland/tmp/work-shared/llvm-project-source-9.0.1-r0/recipe-sysroot-native/usr/bin:/home/sami/edm_yocto/build-xwayland/tmp/work-shared/llvm-project-source-9.0.1-r0/recipe-sysroot-native/sbin:/home/sami/edm_yocto/build-xwayland/tmp/work-shared/llvm-project-source-9.0.1-r0/recipe-sysroot-native/bin:/home/sami/edm_yocto/sources/poky/bitbake/bin:/home/sami/edm_yocto/build-xwayland/tmp/hosttools"; export HOME="/home/sami"; LANG=C git -c core.fsyncobjectfiles=0 clone --bare --mirror https://github.com/llvm/llvm-project /home/sami/edm_yocto/downloads//git2/github.com.llvm.llvm-project --progress failed with exit code 128, output:
Cloning into bare repository '/home/sami/edm_yocto/downloads//git2/github.com.llvm.llvm-project'...
remote: Enumerating objects: 5546825, done.        
remote: Counting objects: 100% (2383/2383), done.        
remote: Compressing objects: 100% (1430/1430), done.        
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

ERROR: llvm-project-source-9.0.1-9.0.1-r0 do_fetch: Fetcher failure for URL: 'git://github.com/llvm/llvm-project;protocol=https;branch=release/9.x'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/sami/edm_yocto/build-xwayland/tmp/work-shared/llvm-project-source-9.0.1-r0/temp/log.do_fetch.22673
ERROR: Task (/home/sami/edm_yocto/sources/meta-clang/recipes-devtools/clang/llvm-project-source.bb:do_fetch) failed with exit code '1'
ERROR: linux-imx-headers-5.4-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; unset _PYTHON_SYSCONFIGDATA_NAME; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1974"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/sami/edm_yocto/sources/poky/scripts:/home/sami/edm_yocto/build-xwayland/tmp/work/aarch64-mx8mm-poky-linux/linux-imx-headers/5.4-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/home/sami/edm_yocto/build-xwayland/tmp/work/aarch64-mx8mm-poky-linux/linux-imx-headers/5.4-r0/recipe-sysroot/usr/bin/crossscripts:/home/sami/edm_yocto/build-xwayland/tmp/work/aarch64-mx8mm-poky-linux/linux-imx-headers/5.4-r0/recipe-sysroot-native/usr/sbin:/home/sami/edm_yocto/build-xwayland/tmp/work/aarch64-mx8mm-poky-linux/linux-imx-headers/5.4-r0/recipe-sysroot-native/usr/bin:/home/sami/edm_yocto/build-xwayland/tmp/work/aarch64-mx8mm-poky-linux/linux-imx-headers/5.4-r0/recipe-sysroot-native/sbin:/home/sami/edm_yocto/build-xwayland/tmp/work/aarch64-mx8mm-poky-linux/linux-imx-headers/5.4-r0/recipe-sysroot-native/bin:/home/sami/edm_yocto/sources/poky/bitbake/bin:/home/sami/edm_yocto/build-xwayland/tmp/hosttools"; export HOME="/home/sami"; LANG=C git -c core.fsyncobjectfiles=0 clone --bare --mirror https://source.codeaurora.org/external/imx/linux-imx.git /home/sami/edm_yocto/downloads//git2/source.codeaurora.org.external.imx.linux-imx.git --progress failed with exit code 128, output:
Cloning into bare repository '/home/sami/edm_yocto/downloads//git2/source.codeaurora.org.external.imx.linux-imx.git'...
remote: Enumerating objects: 24, done.        
remote: Counting objects: 100% (24/24), done.        
remote: Compressing objects: 100% (22/22), done.        
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

ERROR: linux-imx-headers-5.4-r0 do_fetch: Fetcher failure for URL: 'git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=imx_5.4.70_2.3.0'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/sami/edm_yocto/build-xwayland/tmp/work/aarch64-mx8mm-poky-linux/linux-imx-headers/5.4-r0/temp/log.do_fetch.5664
ERROR: Task (/home/sami/edm_yocto/sources/meta-imx/meta-bsp/recipes-kernel/linux/linux-imx-headers_5.4.bb:do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3098 tasks of which 945 didn't need to be rerun and 2 failed.

Summary: 2 tasks failed:
  /home/sami/edm_yocto/sources/meta-clang/recipes-devtools/clang/llvm-project-source.bb:do_fetch
  /home/sami/edm_yocto/sources/meta-imx/meta-bsp/recipes-kernel/linux/linux-imx-headers_5.4.bb:do_fetch
Summary: There were 7 WARNING messages shown.
Summary: There were 4 ERROR messages shown, returning a non-zero exit code.

我看到错误来自克隆这个 repo:git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=imx_5.4.70_2.3.0

当我手动克隆这个 repo 时,我工作得很好,但是当我运行 bitbake 时,它​​一次又一次地产生相同的错误。我该如何解决这个问题?这实际上是来自这个回购吗?

谢谢

标签: linuxgityoctobitbake

解决方案


构建中的问题来自 2 个 git-repositoriesllvm-projectlinux-imx-headers. 之前的答案中提出了多种解决方案:

  1. 确保此处安装所需的主机包部分中提到的所有要求都安装在您的主机中,并且您正在如上所述的 Ubuntu18 或 Ubuntu20 上运行。(如果您在不同的版本上运行,您可能会遇到此类意外问题)。

  2. 可能是缺少 openssl 包的问题(git error: RPC failed; curl 56 GnuTLS recv error (-54): Error in pull function

    sudo apt update && sudo apt install openssl curl gnutls-bin

  3. 您可能需要升级 http post 缓冲区,检查 远程端在 git 克隆时意外挂断

  4. 它可能只是一个糟糕的网络连接,比如repo 同步卡在 99%,因为频繁的互联网断开连接

最后一件事,当您再次尝试构建时,首先尝试通过将选项添加-c cleansstate到 bitbake 构建命令来清理状态缓存,如下所示:

bitbake -c cleansstate imx-image-core

然后再次执行正常的构建命令

bitbake imx-image-core

推荐阅读