专栏首页hank【分享】检查build.log, 解决petalinux的编译错误“ERROR: Failed to create workspace directory”

【分享】检查build.log, 解决petalinux的编译错误“ERROR: Failed to create workspace directory”

问题

修改PetaLinux工程的配置文件project-spec/meta-user/conf/petalinuxbsp.conf后,编译出现下列错误,报告“ERROR: Failed to create workspace directory”。

hankf@XSZGS4:/proj/hankf/zcu106/v202/zcu106-v202-bsp-proj$ petalinux-build
INFO: Sourcing build tools
[INFO] Building project

[INFO] Sourcing build environment

[INFO] Generating workspace directory
ERROR: Failed to create workspace directory
ERROR: Failed to build project

分析和解决

于是检查PetaLinux工程的编译日志文件build/build.log,搜索其中的ERROR。检查ERROR开始的内容,发现一行“ERROR: ParseError at project-spec/meta-user/conf/petalinuxbsp.conf:69: unparsed line”。说明petalinuxbsp.conf有错误。检查petalinuxbsp.conf,发现PREMIRRORS_prepend缺少了一个结束的引号。恢复PREMIRRORS_prepend的结束引号,PetaLinux工程又能正常编译了。

编译日志文件build/build.log如下:

[INFO] Building project
[INFO] Sourcing build environment
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
INFO: Sourcing build tools

### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'.

Other commonly useful commands are:
 - 'devtool' and 'recipetool' handle common recipe tasks
 - 'bitbake-layers' handles common layer tasks
 - 'oe-pkgdata-util' handles common target package tasks
[INFO] Generating workspace directory
NOTE: Starting bitbake server...
ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 43963 at 2020-12-01 07:17:48.614021 ---
ERROR: ParseError at /proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/project-spec/meta-user/conf/petalinuxbsp.conf:69: unparsed line: 'PREMIRRORS_prepend = " git://.*/.* file:///opt/Xilinx/peta/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/downloads/    http://.*/.* file:///opt/Xilinx/peta/downloads/   https://.*/.*  file:///opt/Xilinx/peta/downloads/ git://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/    http://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   https://.*/.*  file:///opt/Xilinx/peta/2020.2/downloads/ '
ERROR: ParseError at /proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/project-spec/meta-user/conf/petalinuxbsp.conf:69: unparsed line: 'PREMIRRORS_prepend = " git://.*/.* file:///opt/Xilinx/peta/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/downloads/    http://.*/.* file:///opt/Xilinx/peta/downloads/   https://.*/.*  file:///opt/Xilinx/peta/downloads/ git://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/    http://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   https://.*/.*  file:///opt/Xilinx/peta/2020.2/downloads/ '
ERROR: ParseError at /proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/project-spec/meta-user/conf/petalinuxbsp.conf:69: unparsed line: 'PREMIRRORS_prepend = " git://.*/.* file:///opt/Xilinx/peta/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/downloads/    http://.*/.* file:///opt/Xilinx/peta/downloads/   https://.*/.*  file:///opt/Xilinx/peta/downloads/ git://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/    http://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   https://.*/.*  file:///opt/Xilinx/peta/2020.2/downloads/ '

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 43963 at 2020-12-01 07:17:48.614021 ---
ERROR: ParseError at /proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/project-spec/meta-user/conf/petalinuxbsp.conf:69: unparsed line: 'PREMIRRORS_prepend = " git://.*/.* file:///opt/Xilinx/peta/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/downloads/    http://.*/.* file:///opt/Xilinx/peta/downloads/   https://.*/.*  file:///opt/Xilinx/peta/downloads/ git://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/    http://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   https://.*/.*  file:///opt/Xilinx/peta/2020.2/downloads/ '
ERROR: ParseError at /proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/project-spec/meta-user/conf/petalinuxbsp.conf:69: unparsed line: 'PREMIRRORS_prepend = " git://.*/.* file:///opt/Xilinx/peta/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/downloads/    http://.*/.* file:///opt/Xilinx/peta/downloads/   https://.*/.*  file:///opt/Xilinx/peta/downloads/ git://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/    http://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   https://.*/.*  file:///opt/Xilinx/peta/2020.2/downloads/ '
ERROR: ParseError at /proj/hankf/zcu106/v202/zcu106-v202-bsp-proj/project-spec/meta-user/conf/petalinuxbsp.conf:69: unparsed line: 'PREMIRRORS_prepend = " git://.*/.* file:///opt/Xilinx/peta/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/downloads/    http://.*/.* file:///opt/Xilinx/peta/downloads/   https://.*/.*  file:///opt/Xilinx/peta/downloads/ git://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   ftp://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/    http://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   https://.*/.*  file:///opt/Xilinx/peta/2020.2/downloads/ '

ERROR: Failed to build project

结论

PetaLinux工程编译遇到问题时,先看看build/build.log和其它log文件的信息,在检查相关文件,多半能找到解决办法。

其它

petalinuxbsp.conf文件中引起错误的部分,修正如下:

#=============================
#
# https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/60129817/Xilinx+Yocto+Builds+without+an+Internet+Connection
# Xilinx Yocto Builds without an Internet Connection
#
# DL_DIR ?= "${TOPDIR}/downloads"
DL_DIR ?= "/opt/Xilinx/peta/2020.2/downloads"
# SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
SSTATE_DIR ?= "/opt/Xilinx/peta/2020.2/sstate/aarch64"
BB_NO_NETWORK = "1"


# ===============================================
# AR 71798
# https://www.xilinx.com/support/answers/71198.html
PREMIRRORS_prepend = " \
git://.*/.* file:///opt/Xilinx/peta/downloads/   \
ftp://.*/.* file:///opt/Xilinx/peta/downloads/    \
http://.*/.* file:///opt/Xilinx/peta/downloads/   \
https://.*/.*  file:///opt/Xilinx/peta/downloads/ \
git://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   \
ftp://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/    \
http://.*/.* file:///opt/Xilinx/peta/2020.2/downloads/   \
https://.*/.*  file:///opt/Xilinx/peta/2020.2/downloads/ \
"

上述内容,使PetaLinux从本地下载文件,不从网络下载,从而进行离线编译。

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Xilinx VCU-TRD 2019.2 编译文件分享

    本文也发布到了 https://www.cnblogs.com/hankfu/p/12719917.html 和 https://www.jianshu.com...

    hankfu
  • 【分享】PetaLinux 工程的离线编译

    PetaLinux基于Yocto,编译Linux内核、文件系统等,非常庞大,需要的软件很多。如果从网络下载,可能消耗比较长的时间。 本文基于Xilinx Pe...

    hankfu
  • 【分享】在MPSoC ZCU106单板上运行Docker

    根据文档Docker on Zynq Ultrascale+ (Xilinx Yocto Flow),在PetaLinux工程的文件project-spec/m...

    hankfu
  • 算法系列(三)

      那么接下来就是选择排序:   选择排序就是先选数组中最大的一个,再选剩下中的最大一个,如此反复直到最后一个,其思想就是平时我们的一般正常的排序思想。 接下来...

    欢醉
  • 让每个家庭都拥有一个“钢铁侠”管家

    比尔·盖茨在1997年建成的豪宅“未来之屋”,让智能家居进入了大家的视线。电影《钢铁侠》则进一步满足了我们对智能家居的想象,“钢铁侠”托尼·史塔克以老管家的名字...

    BestSDK
  • LeetCode 1533. Find the Index of the Large Integer(二分查找)

    We have an integer array arr, where all the integers in arr are equal except for...

    Michael阿明
  • 嵌入式 Linux 的学习新路线

    很多人喜欢从系统启动流程开始学习:先学习裸机,裸机集合起来就是 u-boot,再学习内核移植、驱动开发,接下来学习根文件系统,最后学习 APP 开发。

    韦东山
  • 笔试编程 | 二分查找、数组、排序

    最近有小伙伴后台留言需要准备一些面试相关的文章,其实在面试相关的文章准备笔者早有打算。在春节后,笔者会针对大数据领域相关的求职面试准备一些面试题,同时分享一些面...

    大数据学习与分享
  • 十大经典排序算法最强总结(含Java、Python码实现)

    所谓排序,就是使一串记录,按照其中的某个或某些关键字的大小,递增或递减的排列起来的操作。排序算法,就是如何使得记录按照要求排列的方法。排序算法在很多领域得到相当...

    郭耀华
  • 第二十四节:Java语言基础-讲解数组的综合应用

    选择排序是第一个人和后续排序的人进行比较,若第一个人大于第二个人,就进行交换,那么这时第一人就是最小的,然后这时的第一个人和第三个人进行比较,若这时的第一个人大...

    达达前端

扫码关注云+社区

领取腾讯云代金券