Petalinux installation process and common problem solving under Ubuntu

1. Introduction

Since the ZYNQ ARM side needs to be tested for Linux development in the near future, Petalinux tools need to be used for customization, so this article briefly summarizes the Petalinux installation process, and explains and solves some problems encountered during the installation process.
Petalinux is an embedded Linux custom software developed by Xilinx, which simplifies the development of Linux systems by working with Vivado. Developers can customize u-boot, Linux kernel and Linux applications through Petalinux, and can add new kernels, device drivers, applications and libraries, as well as launch and test software protocols on full-system emulators or physical hardware via network or JTAG The stack completes all operations from system startup to execution.
The Xilinx official website provides the Petalinux download address Petalinux Download and the installation guide Petalinux Reference Guide . For the specific installation process, please refer to the installation guide.

2. Petalinux installation process

  1. Download the Petalinux suite installation package petalinux-v<version number>-final-installer.run from the official website . Taking 2017.4 as an example, put the installation package in the Download directory:

insert image description here

  1. Add executable permissions to the installation package:
	sudo chmod +x petalinux-v2017.4-final-installer.run

insert image description here

  1. Install the corresponding dependent packages, otherwise it will prompt that there are no relevant dependencies during the installation process. The specific dependent packages can be found in the reference guide :

Please add a picture description

Ubuntu system:

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

Redhat/CentOS system

sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch diffutils \
diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat perl-Data-Dumper \
perl-Text-ParseWords perl-Thread-Queue python34-pip xz which SDL-devel xterm autoconf \
libtool zlib-devel automake glib2-devel zlib ncurses-devel openssl-devel dos2unix flex \
bison glibc.i686 screen pax glibc-devel.i686 compat-libstdc+-33.i686 libstdc+.i686

Wait for the installation to complete:

Please add a picture description

  1. Install python and tftp server, otherwise it will affect the installation, the specific impact will be introduced in detail in the third part:
	sudo apt-get install -y python tftpd-hpa

insert image description here

  1. Create the Petalinux installation directory, this article is created in the /opt/ directory:
	sudo mkdir -p /opt/petalinux/2017.4/

insert image description here

  1. Change the permission owner for the installation path, the opt directory is under root, and associate the installation directory with the user name:
	sudo chown carson /opt/petalinux/2017.4/

insert image description here

  1. Run the installation command at the location of the installation package to complete the installation of Petalinux in non-administrator mode :
	./petalinux-v2017.4-final-installer.run /opt/petalinux/2017.4/

insert image description here

  1. During the installation process, a series of license agreement interface will pop up, press Enter to enter the interface, q to exit the agreement, and y to agree to the content of the agreement:

Enter to read the agreement:

insert image description here

The 'q' key quits the protocol:

insert image description here

'y' agrees to the content of the agreement:

insert image description here

The 'q' key quits the protocol:

insert image description here

'y' agrees to the content of the agreement:

insert image description here

The 'q' key quits the protocol:

insert image description here

'y' agrees to the content of the agreement and waits for the installation to complete:

insert image description here

3. Installation common problems and solutions

1. An error message "ERROR: You are PetaLinux installation guide - required tools and libraries package section for detailed information" is reported during the installation process

insert image description here

Cause of the problem: The dependent package is not fully installed, and the related dependent package is missing, for example, the python library is missing here:

Solution: Follow the prompts to install the corresponding installation package:

	sudo apt-get install -y python

2. The installation process warning "WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide" for its impact and solution"

insert image description here

Cause of the problem: tftp server is not installed, tftp provides faster boot startup than JTAG, the official document explains as follows:

insert image description here

Solution: install tftp server and provide corresponding read and write permissions:

	sudo apt-get install tftpd-hpa			##安装tftp server

insert image description here

	sudo mkdir -p /var/lib/tftpboot/		##创建tftpboot启动目录
	sudo chmod 777 /var/lib/tftpboot/		##为启动目录添加权限
	sudo vim /etc/default/tftpd-hpa			##更改tftpboot启动配置内容

Please add a picture description

The default configuration of tftpd-hpa is as follows:

Please add a picture description

Configure it to the new directory:

Please add a picture description

Restart the tftp server service:

	sudo service tftpd-hpa restart

Please add a picture description

3. 安装过程报错 “ERROR: You have tools don’t meet the version requirements: -Detected python version is less than the expected 2.7.3”

insert image description here

The cause of the problem: The python version is too low or installed as python3. Since there are many updates to python3, python2.7 (python2.7.3 and above) is still used here

Solution: If the python version is python3, install python2.7.17 and set it as the default:

	##查看python版本
	python --version

	##安装python2.7
	sudo apt-get install -y python

	##更改python软链接为python2.7
	cd /usr/bin						#进入python所在目录
	sudo rm python					#将原有python文件删除
	sudo ln -s python2.7 python		#将python链接到python2.7

If the problem is still not resolved, you need to change the status file under /var/lib/dpkg:

	cd /var/lib/dpkg				#进入/var/lib/dpkg目录
	sudo vi status					#用vim修改status文件,若未安装vim需提前安装

Search to the python package section and add the following before ( vi/vim search and edit method ):

Package: python
Status: install ok installed 
Maintainer: Fake Entry <[email protected]>
Architecture: all
Version: 2.7.17
Description: fake package for petalinux

insert image description here

Save and exit and run again to complete the installation successfully.

4. Error "libncursesw.so.5: cannot open shared object file: No such file or directory" is reported during the running process

Cause of the problem: The libncursesw.so.5 file is missing, and libncursesw.so.5 cannot be found under /lib/x86_64-linux-gnu and /lib32

insert image description here

insert image description here

Workaround: Search for libnursesw.so.5 to see if this file exists:

	sudo apt install apt-file
	sudo apt-file update
	sudo apt-file find libncursesw.so.5

If the file cannot be found, the libncursesw library needs to be reinstalled:

	sudo apt-get install libncursesw5

ncursesw (libncursesw.so.5) adds support for utf8 character set on the basis of ncurses (libncurses.so.5), and can support Chinese, so if there is Chinese in the software, errors may be reported during operation : utf8 is not supported.

Guess you like

Origin blog.csdn.net/weixin_43361652/article/details/128183759