【分享】检查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

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 69564
# https://china.xilinx.com/support/answers/69564.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从本地下载文件,不从网络下载,从而进行离线编译。

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

上一篇:#vim 编辑器注释看不见 #修改vim 注释颜色 #修改vim主题


下一篇:cmake:macro,function中ARGV,ARGN参数的区别