Software Package Management in PetaLinux rootfs - 2021.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
ft:locale
English (United States)
Release Date
2021-12-15
Version
2021.2 English

The package management feature is new for the Vitis 2020.1 release. All PetaLinux rootfs software packages are hosted on http://petalinux.xilinx.com/sswreleases/rel-v2020/feeds. You can install these software packages to rootfs when running Linux on the target board as long as the board has Internet access.

To use this feature, you must enable package manager DNF in rootfs. The rootfs in Xilinx-provided pre-built Linux components provides the DNF package management features by default.

To set up a package feed URL:

  1. Visit the package feed repo directory http://petalinux.xilinx.com/sswreleases/rel-v2020/generic/rpm/repos/.
  2. Download the repo file that matches your SoC device to target board.
    # Example: ZCU102 uses ZU9EG devices
    wget http://petalinux.xilinx.com/sswreleases/rel-v2020/generic/rpm/repos/zynqmp-generic_eg.repo
    # Example: ZCU104 uses ZU7EV devices
    wget http://petalinux.xilinx.com/sswreleases/rel-v2020/generic/rpm/repos/zynqmp-generic_ev.repo
  3. Copy the downloaded repo file to /etc/yum.repos.d/.
  4. Clean the cache.
    dnf clean all

To manage packages, use the DNF package manager:

Listing available packages
Use the command dnf repoquery.
Installing packages from a Xilinx repository
Use the command dnf install <pkg name>.
Installing packages from a local package file
Use the command dnf install <pkg file name>.
Installing packages to sysroot

When packages are installed on the rootfs of a running board, target has the latest binaries and libraries. When cross compiling on host is needed, these libraries must be added to host side sysroot.

A sysroot_overlay script is provided in XRT to extract RPM and update sysroot. This script will extract RPM libraries and include a file update in sysroot.

Besides XRT, this script supports all RPMs for various software packages.

Getting the sysroot_overlay.sh
Use the command wget https://github.com/Xilinx/XRT/blob/master/src/runtime_src/tools/scripts/sysroots_overlay.sh.
The sysroot command description is:
./sysroots_overlay.sh --sysroot --rpms-file

Where:

  • --sysroot is the sysroot to be overlaid.
  • --rpms-file is the RPMs file that contains the RPM file paths to be overlaid.

Examples

The following example is a command to install updated XRT to the common sysroot:

./sysroots_overlay.sh -s sysroots/aarch64-xilinx-linux/ -r $PWD/rpm.txt

This example shows the contents of an rpm.txt file:

./xrt-dev-202010.2.6.0-r0.aarch64.rpm
./xrt-202010.2.6.0-r0.aarch64.rpm
Note: This script works only for the local RPMs. You must download RPMs to your host machine to install them to the common sysroot.