97 [hw][fpga][xilinx] petalinux 2019.1 setup
Dependencies
Switch to bash
Install dependeciessudo apt update
sudo apt -y install libtool-bin \
python2 gcc make perl tofrodos iproute2 gawk git \
xvfb net-tools tftp-hpa tftpd-hpa flex bison \
screen pax gzip tar gnupg wget diffstat chrpath \
socat xterm autoconf libtool tar unzip texinfo \
gcc-multilib build-essential libselinux1 \
zlib1g-dev zlib1g-dev:i386 \
libsdl1.2-dev libglib2.0-dev \
libssl-dev libncurses5-dev libncursesw5 \
nfs-kernel-server openssh-server \
expect
sudo cp -f /etc/default/tftpd-hpa /etc/default/tftpd-hpa.bak
sudo tee /etc/default/tftpd-hpa << EOF
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="-l -c -s"
EOF
sudo service tftpd-hpa restart
Install ssh server
Comments
konosubakonoakua · 2024-09-23T17:50:48Z
petalinux installation (ubuntu 18 & below)
create a fake python2 pkg status
sudo tee -a /var/lib/dpkg/status << EOF
Package: python
Status: install ok installed
Maintainer: Fake Entry <fake@example.com>
Architecture: all
Version: 2.7.17
Description: fake package for petalinux
EOF
sudo ln -s /usr/bin/python2.7 /usr/bin/python
run the installer
export INSTALLER=~/Downloads/petalinux-v2019.1-final-installer.run
$INSTALLER /tools/petalinux/2019.1/
# need confirm with licenses
konosubakonoakua · 2024-09-24T13:20:45Z
sstate cache
create /tools/petalinux if not exists
mkdir -p /tools/petalinux/sstate/2019.1
tar xvzf ~/Downloads/sstate-rel-v2019.1.tar.gz -C /tools/petalinux/sstate/2019.1
konosubakonoakua · 2024-09-24T14:37:10Z
trouble shoot
build failed (libc version)
I'm using ubuntu22, so I use docker instaled. (follow #84)
petalinux on docker (ubuntu 22)
build
docker build \
--build-arg UBUNTU_MIRROR=mirrors.bfsu.edu.cn \
--build-arg PETA_VERSION=2019.1 \
--build-arg PETA_RUN_FILE=petalinux-v2019.1-final-installer.run \
-t petalinux:2019.1 \
.
docker run -ti --rm \
-e DISPLAY=$DISPLAY --net="host" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/home/vivado/.Xauthority \
-v /tools/petalinux/sstate/2019.1:/tools/petalinux/sstate/2019.1 \
-v /tftpboot:/tftpboot \
-v $(pwd):/home/vivado/project \
petalinux:2019.1 \
/bin/bash
tee -a ~/.bashrc << EOF
alias petadocker2019v1='docker run -it --rm -e DISPLAY=$DISPLAY --net="host" -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/home/vivado/.Xauthority -v /tools/petalinux/sstate/2019.1:/tools/petalinux/sstate/2019.1 -v /tftpboot:/tftpboot -v $(pwd):/home/vivado/project petalinux:2019.1 /bin/bash'
EOF
source ~/.bashrc
If you are runing docker in virtual machine shared folders, then the -v mount will fail.
If you do ls in docker, You will get:
-v to docker
- You can use this way to host sstate-cache on only one machine to save you drive.
Save docker images: - https://docs.docker.com/reference/cli/docker/image/save/
```bash
docker save petalinux:2019.1 | gzip > petalinux-2019.1-docker.tar.gz
```
or
```bash
docker save petalinux:2019.1 > petalinux-2019.1-docker.tar
pigz -9 -p 16 -c petalinux-2019.1-docker.tar > petalinux-2019.1-docker.tar.gz
```
or
```bash
docker save petalinux:2019.1 | pigz -9 -p 16 > petalinux-2019.1-docker.tar.gz
```
konosubakonoakua · 2024-09-25T13:49:53Z
nfs setup
Config nfs (optional, used for Linux rootfs mount).
[!CAUTION]
/nfsrootis very similar with/nfsboot, never make a typo like this!!! 🚨🚨🚨😱😱😱if encountered:sudo cp -f /etc/exports /etc/exports.bak sudo tee -a /etc/exports << EOF /nfsroot *(rw,sync,no_root_squash) EOFVFS:Unable to mount root fs via NFS, tring floppy: restart after modifications. show shared folders refresh on the fly test nfs
references
- https://zhuanlan.zhihu.com/p/421380346