a review
Due to the fast iteration speed of Petalinux, it has strict regulations on the operating system version and dependent libraries required for its own installation environment. If you are not careful, the installation may fail. Therefore, it is recommended to strictly install the relevant documents for installation (UG1144 version 2021.2 ) .
Under different operating systems, the specific dependent libraries required for installation are in the following files, and the download link is:
https://support.xilinx.com/s/article/000032521?language=en_US
Two installation process
2.1 Download the installation package
Petalinux2021.2 installation package: download path
2.2 Install dependent libraries
Under ubuntu20.04.2
sudo apt-get install iproute2 gawk python3 python build-essential gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget git-core diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib automake zlib1g:i386 screen pax gzip cpio python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 -y
Or use the official script file:
https://support.xilinx.com/s/article/73296?language=en_US
I personally tested the following problems when installing in ubuntu20.04.5. Modifying the official source, Tsinghua source, Ali source, etc., including trying other manual installation methods, did not solve the problem. Finally, reinstall the system to ubuntu20.04.2 and execute the above script for one-time installation success.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:9.2) but it is not going to be installed
Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The solutions that can be tried are as follows, but there are many packages with similar problems:
apt-get install aptitude
aptitude install build-essential
Under CentOS7.9
sudo yum install net-tools gawk make wget tar bzip2 gzip python3 unzip perl patch diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3-pip python3-GitPython python3-jinja2 python3-pexpect xz which SDL-devel xterm autoconf libtool.x86_64 zlib-devel automake glib2-devel zlib ncurses-devel openssl-devel dos2unix flex bison glibc.i686 glibc.x86_64 screen pax glibc-devel.i686 compat-libstdc++-33.i686 libstdc++.i686 libstdc++.x86_64
Install GitPython and jinja2
pip3 install GitPython jinja2
Petalinux2021.2 needs to install a higher version of gcc (6 or above), taking 8 as an example
yum install centos-release-scl
yum install devtoolset8-gcc*
gcc -v
2.3 Install petalinux2021.2
Modify the execution permission of the installation file
chmod 755 .petalinux-v2021.2-final-installer.run
Create a folder in the directory you want to install (with a non-root identity, Petalinux needs to be installed under a non-root user), after the creation is complete, enter the folder, in this folder
./<安装路径>/petalinux-v2021.2-final-installer.run --dir ./
In the confirmation of the license agreement, directly press the "Enter" key, and then press "q" to exit, and then select "y" to accept whether to accept or not.
three use
3.1 Switch to the bash environment
Open a new terminal, enter
bash
Switch to the bash environment.
3.2.gcc version switching
Switch to the gcc version, enter
scl enable devtoolset-8 bash
gcc -v
3.3. source
Load the Petalinux operating environment,
source /<安装路径>/setting.sh
So far, has entered the Petalinux environment
Four supplements
4.1 gcc automatically switches versions
It should be noted that the enablement of the scl command is only temporary, and the original system gcc version will be restored after exiting the shell or restarting.
If you want to use gcc 8 for a long time:
echo “source /opt/rh/devtoolset-8/enable” >>/etc/profile
4.2 petalinux automatic source
Modify the ~/.bashrc file: .bashrc is the initialization configuration script of the terminal. This script will be executed every time a new terminal is opened, and the environment variable configuration script will be added to it to complete the automatic configuration when it is opened.
$ gedit ~/.bashrc
Add source /<installation path>/petalinux/settings.sh in the last line