安装工具

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-dev zlib1g:i386 screen pax gzip

apt-get install -y zlib1g-dev gcc-multilib

dpkg –add-architecture i386
apt-get update
apt-get install zlib1g:i386
切换bash
sudo dpkg-reconfigure dash

mkdir /opt/pkg/petalinux/2021.2 //权限问题 这个路径装不上
chmod 777 /opt/pkg -R

mkdir /c/WSL/petalinux/2021.2
sudo chown -R z /mnt/c/opt/* //修改文件夹所有者,不然tar解压报错
./petalinux-v2021.2-final-installer.run –dir /c/WSL/petalinux/2021.2

cd /c/PROJECT/hello

#从bsp创建工程
petalinux-create -t project -s /c/Users/dell/Desktop/fpga/xilinx-zcu106-v2021.2-final.bsp

.xsa放入/c/PROJECT/hello/xilinx-zcu106-2021.2
petalinux-config –get-hw-description
petalinux-config –get-hw-description ./design_1_wrapper.xsa
sudo apt-get install libtinfo5

C:\PROJECT\hello\xilinx-zcu106-2021.2\build\tmp 设置为区分大小写的目录
shell管理员
fsutil.exe file setCaseSensitiveInfo C:\PROJECT\hello\xilinx-zcu106-2021.2\build\tmp enable
清除目录构建sdk
petalinux-build -x distclean

查看命令 petalinux-build –help
构建uboot
petalinux-build -c u-boot

报错
ERROR: Nothing RPROVIDES ‘gstreamer-vcu-examples’ (but /c/PROJECT/hello/xilinx-zcu106-2021.2/components/yocto/layers/meta-petalinux/recipes-core/images/petalinux-image-minimal.bb RDEPENDS on or otherwise requires it)
gstreamer-vcu-examples was skipped: incompatible with machine zynqmp-generic (not in COMPATIBLE_MACHINE)


C:\PROJECT\hello\xilinx-zcu106-2021.2\project-spec\meta-user\conf
修改petalinuxbsp.conf
加入IMAGE_INSTALL_remove = “gstreamer-vcu-examples”

—编译uboot
petalinux-build -c u-boot -x distclean