目次

Zynq

Petalinux

ドキュメントに記載しいるバージョンには従っておいたほうが吉
今回はPetelinux2019.2にする.
PetaLinux ツール資料リファレンスガイド UG1144 (v2019.2) 2019 年 10 月 30 日
Zybo Z7-20でPetalinux2019をビルドして動かす(1) petalinuxをインストール

petalinuxのインストール

/opt/pkg/petalinuxにインストールしたい.

yuki@YUKI-DESKTOP:/opt/pkg$ ls -l
total 4
drwxr-xr-x 2 root root 4096 Mar 21 14:05 petalinux
 
sudo chgrp yuki /opt/pkg && sudo chgrp yuki /opt/pkg/petalinux && sudo chown yuki /opt/pkg && sudo chown yuki /opt/pkg/petalinux
 
yuki@YUKI-DESKTOP:/opt/pkg$ ls -l
total 4
drwxr-xr-x 2 yuki yuki 4096 Mar 21 14:05 petalinux

/opt/pkg/petalinuxに権限を付与できたので早速インストールしようと思ったが色々足りなくてエラー出た.今日はここまで

sudo apt install diffstat
sudo apt install xterm
sudo apt install net-tools #netstatのため
 
 
sudo apt-get install -y gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib build-essential libsdl1.2-dev libglib2.0-dev zlib1g:i386 screen pax gzip gawk
 
apt-get install tofrodos gawk xvfb git libncurses5-dev tftpd zlib1g-dev zlib1g-dev:i386  \
libssl-dev flex bison chrpath socat autoconf libtool texinfo gcc-multilib \
libsdl1.2-dev libglib2.0-dev screen pax

Pythonをインストールした. デフォでやったらそのままPython2が入った.

yuki@YUKI-DESKTOP:~$ python
 
Command 'python' not found, did you mean:
 
  command 'python3' from deb python3
  command 'python' from deb python-is-python3
 
yuki@YUKI-DESKTOP:~$ sudo apt install python
[sudo] password for yuki: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'
The following package was automatically installed and is no longer required:
  libllvm10
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python2
  python2-minimal python2.7 python2.7-minimal
Suggested packages:
  python2-doc python-tk python2.7-doc binfmt-support
The following NEW packages will be installed:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python-is-python2
  python2 python2-minimal python2.7 python2.7-minimal
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 3819 kB of archives.
After this operation, 16.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libpython2.7-minimal amd64 2.7.18-1~20.04.1 [335 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 python2.7-minimal amd64 2.7.18-1~20.04.1 [1285 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 python2-minimal amd64 2.7.17-2ubuntu4 [27.5 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libpython2.7-stdlib amd64 2.7.18-1~20.04.1 [1887 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 python2.7 amd64 2.7.18-1~20.04.1 [248 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 libpython2-stdlib amd64 2.7.17-2ubuntu4 [7072 B]
Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 python2 amd64 2.7.17-2ubuntu4 [26.5 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 python-is-python2 all 2.7.17-4 [2496 B]
Fetched 3819 kB in 3s (1266 kB/s)           
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 123306 files and directories currently installed.)
Preparing to unpack .../0-libpython2.7-minimal_2.7.18-1~20.04.1_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.18-1~20.04.1) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../1-python2.7-minimal_2.7.18-1~20.04.1_amd64.deb ...
Unpacking python2.7-minimal (2.7.18-1~20.04.1) ...
Selecting previously unselected package python2-minimal.
Preparing to unpack .../2-python2-minimal_2.7.17-2ubuntu4_amd64.deb ...
Unpacking python2-minimal (2.7.17-2ubuntu4) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../3-libpython2.7-stdlib_2.7.18-1~20.04.1_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.18-1~20.04.1) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../4-python2.7_2.7.18-1~20.04.1_amd64.deb ...
Unpacking python2.7 (2.7.18-1~20.04.1) ...
Selecting previously unselected package libpython2-stdlib:amd64.
Preparing to unpack .../5-libpython2-stdlib_2.7.17-2ubuntu4_amd64.deb ...
Unpacking libpython2-stdlib:amd64 (2.7.17-2ubuntu4) ...
Setting up libpython2.7-minimal:amd64 (2.7.18-1~20.04.1) ...
Setting up python2.7-minimal (2.7.18-1~20.04.1) ...
Linking and byte-compiling packages for runtime python2.7...
Setting up python2-minimal (2.7.17-2ubuntu4) ...
Selecting previously unselected package python2.
(Reading database ... 124053 files and directories currently installed.)
Preparing to unpack .../python2_2.7.17-2ubuntu4_amd64.deb ...
Unpacking python2 (2.7.17-2ubuntu4) ...
Selecting previously unselected package python-is-python2.
Preparing to unpack .../python-is-python2_2.7.17-4_all.deb ...
Unpacking python-is-python2 (2.7.17-4) ...
Setting up libpython2.7-stdlib:amd64 (2.7.18-1~20.04.1) ...
Setting up python2.7 (2.7.18-1~20.04.1) ...
Setting up libpython2-stdlib:amd64 (2.7.17-2ubuntu4) ...
Setting up python2 (2.7.17-2ubuntu4) ...
Setting up python-is-python2 (2.7.17-4) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
yuki@YUKI-DESKTOP:~$ python --version
Python 2.7.18
yuki@YUKI-DESKTOP:~$ 

Pythonインストールできたし再チャレンジ

yuki@YUKI-DESKTOP:~/Downloads$ ./petalinux-v2019.2-final-installer.run /opt/pkg/petalinux/
INFO: Checking installation environment requirements...
WARNING: This is not a supported OS
INFO: Checking free disk space
INFO: Checking installed tools
environment: line 301: ((: 10#30+ > 10#24: syntax error: operand expected (error token is "> 10#24")
environment: line 305: ((: 10#30+ < 10#24: syntax error: operand expected (error token is "< 10#24")
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
INFO: Checking installer checksum...
INFO: Extracting PetaLinux installer...
 
LICENSE AGREEMENTS
 
PetaLinux SDK contains software from a number of sources.  Please review
the following licenses and indicate your acceptance of each to continue.
 
You do not have to accept the licenses, however if you do not then you may 
not use PetaLinux SDK.
 
Use PgUp/PgDn to navigate the license viewer, and press 'q' to close
 
Press Enter to display the license agreements
Do you accept Xilinx End User License Agreement? [y/N] > y
Do you accept Webtalk Terms and Conditions? [y/N] > y
Do you accept Third Party End User License Agreement? [y/N] > y
INFO: Installing PetaLinux...
*********************************************
WARNING: PetaLinux installation directory: /opt/pkg/petalinux/. is not empty!
*********************************************
Please input "y" to continue to install PetaLinux in that directory?[n]y
INFO: Checking PetaLinux installer integrity...
INFO: Installing PetaLinux SDK to "/opt/pkg/petalinux/."
INFO: Installing aarch64 Yocto SDK to "/opt/pkg/petalinux/./components/yocto/source/aarch64"...
INFO: Installing arm Yocto SDK to "/opt/pkg/petalinux/./components/yocto/source/arm"...
INFO: Installing microblaze_full Yocto SDK to "/opt/pkg/petalinux/./components/yocto/source/microblaze_full"...
INFO: Installing microblaze_lite Yocto SDK to "/opt/pkg/petalinux/./components/yocto/source/microblaze_lite"...
INFO: PetaLinux SDK has been installed to /opt/pkg/petalinux/.
yuki@YUKI-DESKTOP:~/Downloads$ 

インストーできた…

パスを通す.

yuki@YUKI-DESKTOP:~/Downloads$ source /opt/pkg/petalinux/settings.sh 
PetaLinux environment set to '/opt/pkg/petalinux'
WARNING: /bin/sh is not bash! 
bash is PetaLinux recommended shell. Please set your default shell to bash.
WARNING: This is not a supported OS
INFO: Checking free disk space
INFO: Checking installed tools
environment: line 301: ((: 10#30+ > 10#24: syntax error: operand expected (error token is "> 10#24")
environment: line 305: ((: 10#30+ < 10#24: syntax error: operand expected (error token is "< 10#24")
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
yuki@YUKI-DESKTOP:~/Downloads$ 

/bin/sh に設定されているコマンドがdashというやつになってる. bashに変更しておく.

yuki@YUKI-DESKTOP:~/Downloads$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Apr 23  2020 /bin/sh -> dash
 
yuki@YUKI-DESKTOP:~/Downloads$ echo $SHELL
/bin/bash
yuki@YUKI-DESKTOP:~/Downloads$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Apr 23  2020 /bin/sh -> dash
yuki@YUKI-DESKTOP:~/Downloads$ sudo dpkgreconfigure dash
sudo: dpkgreconfigure: command not found
yuki@YUKI-DESKTOP:~/Downloads$ sudo dpkg-reconfigure dash
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
Adding 'diversion of /bin/sh to /bin/sh.distrib by bash'
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash'
yuki@YUKI-DESKTOP:~/Downloads$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Mar 21 20:53 /bin/sh -> bash

tftpサーバ関係をインストールする.

yuki@YUKI-DESKTOP:~/Downloads$ sudo apt install tftpd-hpa tftp-hpa
Reading package lists... Done
Building dependency tree       
Reading state information... Done
tftpd-hpa is already the newest version (5.2+20150808-1ubuntu4).
The following package was automatically installed and is no longer required:
  libllvm10
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  tftp-hpa
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 19.0 kB of archives.
After this operation, 63.5 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 tftp-hpa amd64 5.2+20150808-1ubuntu4 [19.0 kB]
Fetched 19.0 kB in 1s (19.3 kB/s)                    
Selecting previously unselected package tftp-hpa.
(Reading database ... 124091 files and directories currently installed.)
Preparing to unpack .../tftp-hpa_5.2+20150808-1ubuntu4_amd64.deb ...
Unpacking tftp-hpa (5.2+20150808-1ubuntu4) ...
Setting up tftp-hpa (5.2+20150808-1ubuntu4) ...
Processing triggers for man-db (2.9.1-1) ...

↑やったけどこれいらんかったっぽい

petalinuxでプロジェクトを作ってビルドしてみる

Petalinux 2019.2はUbuntu18.04じゃないとうまくビルドできない(公式にもそう書いてある)
最初WSL2でUbuntu20.04でインストールしたので試しにUbuntu20.04にPetalinux2019.2をインストールしてそでプロジェクト作ってビルドできるか試した. → ダメだった.おとなしくドキュメントの指示するバージョンに従っておこう.

Zybo Z7-20でPetalinux2019をビルドして動かす(2) ~Petalinuxのビルドと実行~

Ubuntu20.04

Petelinuxのプロジェクトはビルドできなかったけどログを載せとく.

yuki@YUKI-DESKTOP:~/Downloads$ source /opt/pkg/petalinux/settings.sh
PetaLinux environment set to '/opt/pkg/petalinux'
WARNING: This is not a supported OS
INFO: Checking free disk space
INFO: Checking installed tools
environment: line 301: ((: 10#30+ > 10#24: syntax error: operand expected (error token is "> 10#24")
environment: line 305: ((: 10#30+ < 10#24: syntax error: operand expected (error token is "< 10#24")
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
yuki@YUKI-DESKTOP:~/Downloads$  echo $PETALINUX
/opt/pkg/petalinux

これでpetalinuxへのパスが通った.

yuki@YUKI-DESKTOP:~$ petalinux-config
ERROR: You are not inside a PetaLinux project. Please specify a PetaLinux project!
Configures the project or the specified component with menuconfig.
 
Usage:
  petalinux-config [options] {--component <COMPONENT> |--get-hw-description[=SRC]}
 
Options:
  -h, --help                      show function usage
  -p, --project <PROJECT>         path to PetaLinux SDK project.
                                  default is the working project
  --silentconfig      		  takes the default configuration and skips the GUI.
  -c, --component <COMPONENT>     Specify the component
                                  If no component is specified, it will do
                                  top level project configuration .
                                  If you specify a component,it will
                                  configure it with menuconfig and saves
                                  users config fragments in meta-user.
                                  E.g. -c rootfs, -c busybox
  --get-hw-description [SRC]      get hardware description.
                                  if [SRC] is specified, look in that
                                  location for an Vivado export to SDK directory.
                                  Otherwise, this MUST be run from
                                  WITHIN the vivado export to SDK directory.
  --defconfig [DEFCONFIG_TARGET]  defconfig the specified component.
                                  It applies to kernel and u-boot.
  -v, --verbose                   verbose mode
 
Note: There is no validation for configurable components. User can provide
      any component, bitbake will throw error for invalid components.
yuki@YUKI-DESKTOP:~$ 
yuki@YUKI-DESKTOP:~/peta/firstProject$ petalinux-config -v --get-hw-description ~/peta
INFO: Getting hardware description...
INFO: Rename design_1_wrapper.xsa to system.xsa
[INFO] generating Kconfig for project
INFO: [Hsi 55-2053] elapsed time for repository (/opt/pkg/petalinux/tools/xsct/data/embeddedsw) loading 0 seconds
[INFO] menuconfig project
ERROR: Failed to menu config project component 
ERROR: Failed to config project.
ERROR: Get hw description Failed!.

は?

ターミナルのウィンドウサイズをある程度大きくしておくこと.
プロジェクトディレクトリ内のbuild/config.logを見ると

パッケージが足りなかったみたい

sudo apt install libncursesw5
petalinux-config -v --get-hw-description ~/peta
INFO: Getting hardware description...
INFO: Rename design_1_wrapper.xsa to system.xsa
[INFO] generating Kconfig for project
INFO: [Hsi 55-2053] elapsed time for repository (/opt/pkg/petalinux/tools/xsct/data/embeddedsw) loading 0 seconds
[INFO] menuconfig project
 
 
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'#
# configuration written to /home/yuki/peta/firstProject/project-spec/configs/rootfs_config
#
[INFO] generating petalinux-user-image.bb

一通り設定ができたのでやっとビルドする.

yuki@YUKI-DESKTOP:~/peta/firstProject$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake petalinux-user-image
WARNING: Host distribution "ubuntu-20.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |##################################################################################################################################################################################| Time: 0:00:04Loaded 3979 entries from dependency cache.
Parsing recipes: 100% |################################################################################################################################################################################| Time: 0:00:05Parsing of 2893 .bb files complete (2892 cached, 1 parsed). 3980 targets, 169 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
WARNING: Your host glibc verson (2.31) is newer than that in uninative (2.28). Disabling uninative so that sstate is not corrupted.
Initialising tasks: 100% |#############################################################################################################################################################################| Time: 0:00:04Checking sstate mirror object availability: 100% |#####################################################################################################################################################| Time: 0:00:08Sstate summary: Wanted 239 Found 2 Missed 474 Current 648 (0% match, 73% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: libgpg-error-native-1.32-r0 do_compile: oe_runmake failed
ERROR: libgpg-error-native-1.32-r0 do_compile: Function failed: do_compile (log file is located at /home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/temp/log.do_compile.16513)
ERROR: Logfile of failure stored in: /home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/temp/log.do_compile.16513
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 8
| make  all-recursive
| make[1]: Entering directory '/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/build'
| Making all in m4
| make[2]: Entering directory '/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/build/m4'
| make[2]: Nothing to be done for 'all'.
| make[2]: Leaving directory '/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/build/m4'
| Making all in src
| make[2]: Entering directory '/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/build/src'
| gcc  -I. -I../../libgpg-error-1.32/src -o mkerrcodes ../../libgpg-error-1.32/src/mkerrcodes.c
| gcc  -DHAVE_CONFIG_H -I. -I../../libgpg-error-1.32/src -I..   -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include  -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include -O2 -pipe -Wall -Wpointer-arith -Wno-psabi -fvisibility=hidden -c -o gen-posix-lock-obj.o ../../libgpg-error-1.32/src/gen-posix-lock-obj.c
| cp gpg-error-config gpgrt-config
| cat ../../libgpg-error-1.32/src/gpg-error.def.in >_gpg-error.def.h
| echo "/*dummy*/" > mkw32errmap.map.c
| gcc  -E -I. -I../../libgpg-error-1.32/src -I..   _gpg-error.def.h | \
|   grep -v '^#' >gpg-error.def
| rm _gpg-error.def.h
| ./mkerrcodes | gawk -f ../../libgpg-error-1.32/src/mkerrcodes2.awk >code-from-errno.h
| gawk: ../../libgpg-error-1.32/src/mkerrcodes2.awk:94: warning: regexp escape sequence `\#' is not a known regexp operator
| ../x86_64-linux-libtool  --tag=CC   --mode=link gcc   -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include -O2 -pipe -Wall -Wpointer-arith -Wno-psabi -fvisibility=hidden  -L/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/lib -L/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/lib -Wl,-rpath-link,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/lib -Wl,-O1 -o gen-posix-lock-obj gen-posix-lock-obj.o
| x86_64-linux-libtool: link: gcc -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include -O2 -pipe -Wall -Wpointer-arith -Wno-psabi -fvisibility=hidden -Wl,-rpath-link -Wl,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link -Wl,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/lib -Wl,-rpath -Wl,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/lib -Wl,-rpath -Wl,/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/lib -Wl,-O1 -o gen-posix-lock-obj gen-posix-lock-obj.o  -L/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/lib -L/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/lib
| ./gen-posix-lock-obj >lock-obj-pub.native.h
| :
| ./mkheader linux-gnu x86_64-pc-linux-gnu  ../../libgpg-error-1.32/src/gpg-error.h.in \
|                    ../config.h 1.32-unknown 0x012000 >gpg-error.h
| cp gpg-error.h gpgrt.h
| make  all-am
| make[3]: Entering directory '/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/build/src'
| gcc  -DHAVE_CONFIG_H -I. -I../../libgpg-error-1.32/src -I..  -DPKGDATADIR=\"/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/share/libgpg-error\" -DLOCALEDIR=\"/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/share/locale\"  -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include  -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include -O2 -pipe -Wall -Wpointer-arith -Wno-psabi -fvisibility=hidden -c -o gpg_error-strsource-sym.o `test -f 'strsource-sym.c' || echo '../../libgpg-error-1.32/src/'`strsource-sym.c
| gcc  -DHAVE_CONFIG_H -I. -I../../libgpg-error-1.32/src -I..  -DPKGDATADIR=\"/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/share/libgpg-error\" -DLOCALEDIR=\"/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/share/locale\"  -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include  -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include -O2 -pipe -Wall -Wpointer-arith -Wno-psabi -fvisibility=hidden -c -o gpg_error-strerror-sym.o `test -f 'strerror-sym.c' || echo '../../libgpg-error-1.32/src/'`strerror-sym.c
| gcc  -DHAVE_CONFIG_H -I. -I../../libgpg-error-1.32/src -I..  -DPKGDATADIR=\"/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/share/libgpg-error\" -DLOCALEDIR=\"/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/share/locale\"  -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include  -isystem/home/yuki/peta/firstProject/build/tmp/work/x86_64-linux/libgpg-error-native/1.32-r0/recipe-sysroot-native/usr/include -O2 -pipe -Wall -Wpointer-arith -Wno-psabi -fvisibility=hidden -c -o gpg_error-gpg-error.o `test -f 'gpg-error.c' || echo '../../libgpg-error-1.32/src/'`gpg-error.c
NOTE: Tasks Summary: Attempted 763 tasks of which 522 didn't need to be rerun and 1 failed.
 
Summary: 1 task failed:
  virtual:native:/opt/pkg/petalinux/components/yocto/source/arm/layers/core/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb:do_compile
Summary: There were 2 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build project

だめだった.
エラーのログファイルの中身 → petalinux-buildのエラーログファイル

エラー内容を読むと,libgpg-erorのビルドに失敗してる模様.
また,警告でglibcのバージョンが新しすぎると言われている.Ubuntu20.04に入っっているglibcは2.31だけど,petalinux 2019.2で必要なのは2.28の模様.
glibのバージョン確認は以下のコマンド

yuki@YUKI-DESKTOP:~/peta/firstProject$ /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.2) stable release version 2.31.
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 9.3.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

Xilinx Vivado 2019.1 and Petalinux 2019.1 on Fedora Core 31
glibcのバージョン違いが原因なら下げてやろうと思ったが,軽く調べた感じだとglibのバージョンを下げるのはやばそうという内容の物が多い.
Linuxの知識が全然ないままここに足突っ込んでもろくなことにならないので,glibcのバージョンを下げることは諦める. となると,petalinux2019.2をビルドしたかったらUbuntu18.04に環境構築が正解か?

Ubuntu18.04

きちんとビルドできた.

yuki@YUKI-DESKTOP:~/peta/firstProject$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake petalinux-user-image
Loading cache: 100% |########################################################################################################################################################################################################################################################| Time: 0:00:01
Loaded 3978 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################################################################################################################################| Time: 0:00:06
Parsing of 2893 .bb files complete (2885 cached, 8 parsed). 3980 targets, 169 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |###################################################################################################################################################################################################################################################| Time: 0:00:05
Checking sstate mirror object availability: 100% |###########################################################################################################################################################################################################################| Time: 0:00:12
Sstate summary: Wanted 887 Found 711 Missed 352 Current 0 (80% match, 0% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3219 tasks of which 2362 didn't need to be rerun and all succeeded.
INFO: Copying Images from deploy to images
INFO: Creating /home/yuki/peta/firstProject/images/linux directory
NOTE: Failed to copy built images to tftp dir: /tftpboot
[INFO] successfully built project

その後パッケージ化というやつをやって成果物を作る

yuki@YUKI-DESKTOP:~/peta/firstProject$ petalinux-package --boot --force --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --u-boot
INFO: File in BOOT BIN: "/home/yuki/peta/firstProject/images/linux/zynq_fsbl.elf"
INFO: File in BOOT BIN: "/home/yuki/peta/firstProject/images/linux/system.bit"
INFO: File in BOOT BIN: "/home/yuki/peta/firstProject/images/linux/u-boot.elf"
INFO: Generating Zynq binary package BOOT.BIN...
 
 
****** Xilinx Bootgen v2019.2
  **** Build date : Oct 23 2019-22:59:42
    ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.
 
INFO: Binary is ready.
WARNING: Unable to access the TFTPBOOT folder /tftpboot!!!
WARNING: Skip file copy to TFTPBOOT folder!!!