前言
在利用 petalinux 工具开发 Zynq的时候,先前已经安装、配置好相关的环境和工作目录,但是之后执行 petalinux 命令报错命令没找到的错误。
解决方案
- 安装 Petalinux 要考虑安装位置,对于 Petalinux 这种体积庞大的工具,笔者的安装路径如下:
zzz@ubuntu-GCP1820-SS:xilinx$ cd /home/zzz/opt/pkg/petalinux/2019.2/
zzz@ubuntu-GCP1820-SS:2019.2$ ls
components doc etc settings.csh settings.sh tools
zzz@ubuntu-GCP1820-SS:2019.2$
- 出现 petalinux 命令找不到的错误,就需要执行上面的 settings.sh脚本,笔者使用别名简记 “执行setting.sh脚本”:
zzz@ubuntu-GCP1820-SS:2019.2$
zzz@ubuntu-GCP1820-SS:2019.2$ tail ~/.bashrc
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
alias sptl='source /home/zzz/opt/pkg/petalinux/2019.2/settings.sh'
export PATH=$PATH:/home/zzz/xilinx/xilinx_petalinux/gcc-arm-linux/gcc-arm-none-eabi-8-2019-q3-update//bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/zzz/xilinx/xilinx_petalinux/gcc-arm-linux/gcc-arm-none-eabi-8-2019-q3-update/lib
zzz@ubuntu-GCP1820-SS:2019.2$
- 进入到笔者的 petalinux 工程路径下,在这里先执行 settings.sh脚本,之后就可以使用 petalinux-build 编译整个 Petalinux 工程了:
zzz@ubuntu-GCP1820-SS:xilinx$ cd /home/zzz/petalinux/xilinx
zzz@ubuntu-GCP1820-SS:xilinx$ ls
build components config.project images project-spec
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ sptl
PetaLinux environment set to '/home/zzz/opt/pkg/petalinux/2019.2'
WARNING: /bin/sh is not bash!
bash is PetaLinux recommended shell. Please set your default shell to bash.
INFO: Checking free disk space
INFO: Checking installed tools
INFO: Checking installed development libraries
INFO: Checking network and other services
WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide" for its impact and solution
zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake petalinux-user-image
Loading cache: 100% |
Loaded 3987 entries from dependency cache.
Parsing recipes: 100% |
Parsing of 2901 .bb files complete (2899 cached, 2 parsed). 3988 targets, 155 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |
Checking sstate mirror object availability: 100% |
Sstate summary: Wanted 124 Found 22 Missed 204 Current 856 (17% match, 89% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3462 tasks of which 3454 didn't need to be rerun and all succeeded.
INFO: Copying Images from deploy to images
[Errno 13] Permission denied: '/tftpboot/Image'
NOTE: Successfully copied built images to tftp dir: /tftpboot
[INFO] successfully built project
zzz@ubuntu-GCP1820-SS:xilinx$
|