├── .dockerignore ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── accept-eula.sh ├── docker_build.sh ├── etc └── petalin2.sh ├── install_config.txt ├── install_config_2020.1_Vivado.txt ├── install_config_2021.2_Vitis.txt ├── install_config_2023.2_Vivado.txt └── installers └── .gitignore /.dockerignore: -------------------------------------------------------------------------------- 1 | etc/** 2 | installers/** 3 | docker-build.sh 4 | LICENSE 5 | README.md 6 | .gitignore 7 | .git 8 | .cache 9 | tftpboot/ 10 | vivado* 11 | *.log 12 | vitis* 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | petalinux-v*final-installer.run 2 | Xilinx_Unified_*.tar.gz 3 | vivado* 4 | *.log 5 | vitis* 6 | *~ 7 | .*.swp 8 | .settings 9 | .project 10 | .cproject 11 | .idea 12 | .DS_Store 13 | .pydevproject 14 | .vscode/ 15 | .vs/ 16 | tftpboot/ 17 | etc/tftpboot/ 18 | Testing/ 19 | installers/*.run 20 | installers/*.bin 21 | installers/*.tar 22 | installers/*.tgz 23 | installers/*.tar.gz 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021-2023, Carles Fernandez-Prades 2 | # SPDX-License-Identifier: MIT 3 | 4 | FROM ubuntu:18.04 5 | 6 | LABEL version="3.0" description="Geniux builder" maintainer="carles.fernandez@cttc.es" 7 | 8 | # build with "docker build --build-arg PETA_VERSION=2021.2 --build-arg PETA_RUN_FILE=petalinux-v2021.2-final-installer.run -t docker_petalinux2:2021.2 ." 9 | # or "docker build --build-arg PETA_VERSION=2021.2 --build-arg PETA_RUN_FILE=petalinux-v2021.2-final-installer.run --build-arg VIVADO_INSTALLER=Xilinx_Unified_2021.2_1021_0703.tar.gz -t docker_petalinux2:2021.2 ." 10 | 11 | # Install dependencies 12 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q \ 13 | autoconf \ 14 | bc \ 15 | bison \ 16 | build-essential \ 17 | ca-certificates \ 18 | chrpath \ 19 | cpio \ 20 | curl \ 21 | dbus \ 22 | dbus-x11 \ 23 | debianutils \ 24 | diffstat \ 25 | expect \ 26 | flex \ 27 | fonts-droid-fallback \ 28 | fonts-ubuntu-font-family-console \ 29 | gawk \ 30 | gcc-multilib \ 31 | git \ 32 | gnupg \ 33 | gtk2-engines \ 34 | gzip \ 35 | iproute2 \ 36 | iputils-ping \ 37 | kmod \ 38 | lib32z1-dev \ 39 | libbz2-dev \ 40 | libcanberra-gtk-module \ 41 | libegl1-mesa \ 42 | libffi-dev \ 43 | libgdbm-dev \ 44 | libglib2.0-dev \ 45 | libgtk2.0-0 \ 46 | libjpeg62-dev \ 47 | libpython3.8-dev \ 48 | libncurses5-dev \ 49 | libnss3-dev \ 50 | libreadline-dev \ 51 | libsdl1.2-dev \ 52 | libselinux1 \ 53 | libsqlite3-dev \ 54 | libssl-dev \ 55 | libswt-gtk-4-jni \ 56 | libtool \ 57 | libtool-bin \ 58 | locales \ 59 | lsb-release \ 60 | lxappearance \ 61 | nano \ 62 | net-tools \ 63 | pax \ 64 | pkg-config \ 65 | pylint3 \ 66 | python \ 67 | python3 \ 68 | python3-pexpect \ 69 | python3-pip \ 70 | python3-git \ 71 | python3-jinja2 \ 72 | rsync \ 73 | screen \ 74 | socat \ 75 | sudo \ 76 | texinfo \ 77 | tftpd \ 78 | tofrodos \ 79 | ttf-ubuntu-font-family \ 80 | u-boot-tools \ 81 | ubuntu-gnome-default-settings \ 82 | unzip \ 83 | update-inetd \ 84 | wget \ 85 | xorg \ 86 | xterm \ 87 | xvfb \ 88 | xxd \ 89 | zlib1g-dev \ 90 | && apt-get clean \ 91 | && rm -rf /var/lib/apt/lists/* 92 | 93 | RUN dpkg --add-architecture i386 && apt-get update && \ 94 | DEBIAN_FRONTEND=noninteractive apt-get install -y -q \ 95 | zlib1g:i386 libc6-dev:i386 \ 96 | && apt-get clean \ 97 | && rm -rf /var/lib/apt/lists/* 98 | 99 | RUN locale-gen en_US.UTF-8 && update-locale 100 | 101 | # Build and install Python 3.11, required by repo 102 | RUN wget https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz \ 103 | && tar -xf Python-3.11.*.tgz && cd Python-3.11.*/ \ 104 | && ./configure --enable-optimizations && make && make altinstall \ 105 | && cd .. && rm Python-3.11.*.tgz && rm -rf Python-3.11.*/ 106 | 107 | # make a petalinux user 108 | ARG UID 109 | ARG GID 110 | 111 | RUN groupadd --gid ${GID} petalinux_docker 112 | 113 | RUN adduser --uid ${UID} --gid ${GID} --disabled-password --gecos '' petalinux && \ 114 | usermod -aG sudo petalinux && \ 115 | echo "petalinux ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 116 | 117 | # Install the repo tool to handle git submodules (meta layers) comfortably. 118 | ADD https://storage.googleapis.com/git-repo-downloads/repo /usr/local/bin/ 119 | RUN chmod 777 /usr/local/bin/repo 120 | 121 | ARG PETA_VERSION 122 | ARG PETA_RUN_FILE 123 | 124 | # The HTTP server to retrieve the files from. 125 | ARG HTTP_SERV=http://172.17.0.1:8000/installers 126 | ARG VIVADO_UPDATE 127 | 128 | COPY accept-eula.sh / 129 | 130 | 131 | # Stage y2k22_patch-1.2.zip into the build cache and include it in the image, 132 | # but only when building with AMD/Xilinx tools version 2021.2. 133 | RUN --mount=type=bind,source=.,target=/ctx,ro \ 134 | if [ "$VIVADO_UPDATE" ] ; then \ 135 | cp /ctx/y2k22_patch-1.2.zip / ; \ 136 | else \ 137 | echo "No patch found, skipping"; \ 138 | fi 139 | 140 | # run the Petalinux installer 141 | RUN cd / && wget -q ${HTTP_SERV}/${PETA_RUN_FILE} && \ 142 | chmod a+rx /${PETA_RUN_FILE} && \ 143 | chmod a+rx /accept-eula.sh && \ 144 | mkdir -p /opt/Xilinx && \ 145 | chmod 777 /tmp /opt/Xilinx && \ 146 | cd /tmp && \ 147 | sudo -u petalinux -i /accept-eula.sh /${PETA_RUN_FILE} /opt/Xilinx/petalinux && \ 148 | rm -f /${PETA_RUN_FILE} /accept-eula.sh 149 | 150 | ARG VIVADO_INSTALLER 151 | ARG VIVADO_AGREE="XilinxEULA,3rdPartyEULA" 152 | 153 | COPY install_config.txt /vivado-config/ 154 | 155 | RUN \ 156 | if [ "$VIVADO_INSTALLER" ] ; then \ 157 | mkdir -p /vivado-installer && cd /vivado-installer/ && wget -q ${HTTP_SERV}/${VIVADO_INSTALLER} && cd .. && \ 158 | cat /vivado-installer/${VIVADO_INSTALLER} | tar zx --strip-components=1 -C /vivado-installer && \ 159 | cp /vivado-config/install_config.txt /vivado-installer/ && \ 160 | /vivado-installer/xsetup \ 161 | --agree ${VIVADO_AGREE} \ 162 | --batch Install \ 163 | --config /vivado-installer/install_config.txt && \ 164 | rm -rf /vivado-installer ; \ 165 | fi 166 | 167 | # apply 2021.2.1 Update 168 | RUN \ 169 | if [ "$VIVADO_UPDATE" ] ; then \ 170 | mkdir -p /vivado-installer && cd /vivado-installer/ && wget -q ${HTTP_SERV}/${VIVADO_UPDATE} && cd .. && \ 171 | cat /vivado-installer/${VIVADO_UPDATE} | tar zx --strip-components=1 -C /vivado-installer && \ 172 | cp /vivado-config/install_config.txt /vivado-installer/ && \ 173 | /vivado-installer/xsetup \ 174 | --agree ${VIVADO_AGREE} \ 175 | --batch Update \ 176 | --config /vivado-installer/install_config.txt && \ 177 | rm -rf /vivado-installer ; \ 178 | fi 179 | 180 | # apply Vitis patch 181 | RUN \ 182 | if [ "$VIVADO_UPDATE" ] ; then \ 183 | mv /y2k22_patch-1.2.zip /tools/Xilinx/ && cd /tools/Xilinx/ && unzip y2k22_patch-1.2.zip && \ 184 | export LD_LIBRARY_PATH=$PWD/Vivado/2021.2/tps/lnx64/python-3.8.3/lib/ && \ 185 | ./Vivado/2021.2/tps/lnx64/python-3.8.3/bin/python3 y2k22_patch/patch.py && \ 186 | rm y2k22_patch-1.2.zip && rm -rf y2k22_patch ; \ 187 | fi 188 | 189 | # make /bin/sh symlink to bash instead of dash: 190 | RUN echo "dash dash/sh boolean false" | debconf-set-selections 191 | RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash 192 | 193 | # not really necessary, just to make it easier to install packages on the run... 194 | RUN echo "root:petalinux" | chpasswd 195 | 196 | USER petalinux 197 | ENV HOME /home/petalinux 198 | ENV LANG en_US.UTF-8 199 | RUN mkdir /home/petalinux/project 200 | WORKDIR /home/petalinux/project 201 | ENV SHELL /bin/bash 202 | 203 | # Source settings at login 204 | USER root 205 | RUN echo "/usr/sbin/in.tftpd --foreground --listen --address [::]:69 --secure /tftpboot" >> /etc/profile && \ 206 | echo ". /opt/Xilinx/petalinux/settings.sh" >> /etc/profile && \ 207 | if [ "$VIVADO_INSTALLER" ] ; then \ 208 | echo ". /tools/Xilinx/Vivado/${PETA_VERSION}/settings64.sh" >> /etc/profile ; \ 209 | fi && \ 210 | echo ". /etc/profile" >> /root/.profile 211 | 212 | EXPOSE 69/udp 213 | 214 | USER petalinux 215 | 216 | RUN git config --global user.email "geniux@example.com" && git config --global user.name "Geniux" 217 | 218 | ENTRYPOINT ["/bin/bash", "-l"] 219 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Carles Fernandez-Prades 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [comment]: # ( 3 | SPDX-License-Identifier: MIT 4 | ) 5 | 6 | [comment]: # ( 7 | SPDX-FileCopyrightText: 2021-2023 Carles Fernandez-Prades 8 | ) 9 | 10 | 11 | # docker-petalinux2 12 | 13 | A somehow generic Xilinx PetaLinux & Vivado Docker image, using Ubuntu 18.04 as 14 | the base image. 15 | 16 | PetaLinux version `2020.1` is the first version handled by this release, and the 17 | default version is `2021.2`. For former versions, please check 18 | [docker-petalinux](https://github.com/carlesfernandez/docker-petalinux). 19 | 20 | In order to use this tool, you need to [install 21 | Docker](https://docs.docker.com/get-docker/) in your machine. If you want to use 22 | the Vivado/Vitis graphical interface, you will also need the ipconfig utility 23 | (on Debian/Ubuntu: `sudo apt-get install net-tools`). 24 | 25 | A Xilinx user ID is required to download the PetaLinux and Vivado installers. 26 | 27 | ## Download the installers 28 | 29 | ### Prepare the PetaLinux installer 30 | 31 | The PetaLinux Installer is to be downloaded from the 32 | [Xilinx's Embedded Design Tools website](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html). 33 | 34 | Place the downloaded `petalinux-v-final-installer.run` file (where 35 | `` can be `2020.1`, `2021.2`, ...) in the `./installers` folder. 36 | 37 | ### Prepare the Vivado / Vitis installer (optional) 38 | 39 | Optionally, Vivado and Vitis can be downloaded from the 40 | [Xilinx's Vivado Design Tools website](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools.html). 41 | Go there and choose the All OS installer Single-File Download (TAR/GZIP). 42 | 43 | The file is called something like `Xilinx_Unified__XXXX_YYYY.tar.gz`. 44 | Place it in the `./installers` folder. The building script will guess its exact 45 | name automatically. 46 | 47 | > **Note for version 2021.2:** 48 | > You will need two extra files: 49 | > * `y2k22_patch-1.2.zip`, downloadable from https://support.xilinx.com/s/article/76960?language=en_US 50 | > * `Xilinx_Vivado_Vitis_Update_2021.2.1_1219_1431.tar.gz`, downloadable from 51 | https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive.html 52 | > Please place both files in the `installers/` folder. 53 | 54 | The Docker image will be about 210 GB so make sure you have enough space in 55 | `/var/lib/docker`. Be aware that the building process can take some hours. 56 | 57 | If this file is present when building the image, the Docker image will be about 58 | 138 GB so make sure you have enough space in `/var/lib/docker`. Be aware that 59 | the building process can take some hours. 60 | 61 | You can change your Docker disk utilization in the Docker GUI: select the Docker 62 | icon and then Preferences > Resources > Advanced, and then click "Apply & 63 | Restart". 64 | 65 | For other versions than 2021.2, you might need to tune the Vivado installing 66 | configuration by modifying the `install_config.txt` file. Please do not change 67 | the `Destination=/tools/Xilinx` entry. This file can be generated by unzipping 68 | the installer somewhere else and running: 69 | 70 | ./xsetup -b ConfigGen 71 | 72 | Then, copy the file generated at `~/.Xilinx/install_config.txt` over the file in 73 | this repository. Just be sure to set `Destination=/tools/Xilinx` as the path 74 | where Xilinx software will be installed on the image. 75 | 76 | If the Vivado installer file is not present in the folder when running the 77 | building script, the petalinux-only image will be about 14 GB and the building 78 | process will be much faster. 79 | 80 | ## Build the image 81 | 82 | Run: 83 | 84 | ./docker_build.sh 85 | 86 | > The default for ``, if not specified, is `2021.2`. 87 | 88 | ## Work with a PetaLinux project 89 | 90 | A helper script `petalin2.sh` is provided that should be run _inside_ a 91 | petalinux project directory. It basically is a shortcut to: 92 | 93 | docker run -ti -v "$PWD":"$PWD" -w "$PWD" --rm -u petalinux docker_petalinux2: $@ 94 | 95 | When run without arguments, a shell will spawn, _with PetaLinux `settings.sh` 96 | already sourced_, so you can directly execute `petalinux-*` commands. 97 | 98 | user@host:/path/to/petalinux_project$ /path/to/petalin2.sh 99 | petalinux2@host:/path/to/petalinux_project$ petalinux-build 100 | 101 | Otherwise, the arguments will be executed as a command. Example: 102 | 103 | user@host:/path/to/petalinux_project$ /path/to/petalin2.sh \ 104 | "petalinux-create -t project --template zynq --name myproject" 105 | 106 | ## Using Vivado / Vitis graphical interface 107 | 108 | If the Vivado installer was present when building the Docker image, you can 109 | execute Vivado and Vitis from the shell spawn when running `petalin2.sh`. 110 | 111 | There are some steps on your side if you want to make use of Vivado's graphical 112 | interface before running the Docker container. 113 | 114 | - If your local machine is running Linux, adjust the permission of the X server 115 | host: 116 | 117 | $ sudo apt-get install x11-xserver-utils 118 | $ xhost +local:root 119 | 120 | - If your local machine is running macOS: 121 | 122 | - Do this once: 123 | 124 | - Install the latest [XQuartz](https://www.xquartz.org/) version and run it. 125 | - Activate the option 126 | "[Allow connections from network clients](https://blogs.oracle.com/oraclewebcentersuite/running-gui-applications-on-native-docker-containers-for-mac)" 127 | in XQuartz settings. 128 | - Quit and restart XQuartz to activate the setting. 129 | 130 | - Then, in the host machine: 131 | 132 | - Get your network IP with `ipconfig getifaddr en1` for wireless, or 133 | `ipconfig getifaddr en0` for ethernet. 134 | - Tell XQuartz to accept connections from that IP: 135 | 136 | $ xhost + 127.0.0.1 ; <- YOUR NETWORK IP HERE, OR REMOTE IP HOST 137 | 138 | - If you are accessing remotely to the machine running the Docker container via 139 | ssh, you need to enable trusted X11 forwarding with the `-Y` flag: 140 | 141 | $ ssh user@host -Y 142 | 143 | Now you can try it: 144 | 145 | user@host:/path/to/petalinux_project$ /path/to/petalin2.sh 146 | petalinux2@host:/path/to/petalinux_project# vivado 147 | 148 | Enjoy! 149 | 150 | ## Copyright and License 151 | 152 | Copyright: © 2021-2023 Carles Fernández-Prades, 153 | [CTTC](https://www.cttc.cat). All rights reserved. 154 | 155 | The content of this repository is published under the [MIT](./LICENSE) license. 156 | 157 | ## Acknowledgements 158 | 159 | This work was partially supported by the Spanish Ministry of Science, 160 | Innovation, and Universities through the Statistical Learning and Inference for 161 | Large Dimensional Communication Systems (ARISTIDES, RTI2018-099722-B-I00) 162 | project. 163 | -------------------------------------------------------------------------------- /accept-eula.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | # SPDX-FileCopyrightText: 2021, Carles Fernandez-Prades 3 | # SPDX-License-Identifier: MIT 4 | set timeout -1 5 | set install_dir [lindex $argv 1] 6 | set installer [lindex $argv 0] 7 | 8 | spawn $installer $install_dir 9 | set timeout 2 10 | expect { 11 | "ERROR: Invalid options:" {spawn $installer -d $install_dir } 12 | timeout { } 13 | } 14 | 15 | set timeout 600 16 | expect "Press Enter to display the license agreements" 17 | send "\r" 18 | set timeout 2 19 | 20 | expect { 21 | "* >*" {send "y\r"} 22 | timeout { send "q"; sleep 1; exp_continue} 23 | } 24 | expect { 25 | "* >*" {send "y\r"} 26 | timeout { send "q"; sleep 1; exp_continue} 27 | } 28 | expect { 29 | "* >*" {send "y\r"} 30 | timeout { send "q"; sleep 1; exp_continue} 31 | } 32 | 33 | # set timeout -1 34 | 35 | # expect "INFO: Checking PetaLinux installer integrity..." 36 | # expect "INFO: Installing PetaLinux..." 37 | #interact 38 | -------------------------------------------------------------------------------- /docker_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-FileCopyrightText: 2021-2023, Carles Fernandez-Prades 3 | # SPDX-FileCopyrightText: 2024, Max Wipfli 4 | # SPDX-License-Identifier: MIT 5 | 6 | # Default version 2021.2 7 | XILVER=${1:-2021.2} 8 | 9 | cd installers || exit 10 | 11 | # Check for Petalinux installer 12 | if [ "${XILVER}" == "2023.2" ] ; then 13 | PLNX="petalinux-v${XILVER}-10121855-installer.run" # for Vivado 2023.2 14 | else 15 | PLNX="petalinux-v${XILVER}-final-installer.run" # for Vivado 2021.2 16 | fi 17 | if [ ! -f "$PLNX" ] ; then 18 | echo "$PLNX installer not found" 19 | cd .. 20 | exit 1 21 | fi 22 | 23 | # Check for Xilinx Unified installer (for Vivado) 24 | if [ "${XILVER}" == "2023.2" ] ; then 25 | VIVADO_INSTALLER_GLOB=FPGAs_AdaptiveSoCs_Unified_"${XILVER}" # for Vivado 2023.2 26 | else 27 | VIVADO_INSTALLER_GLOB=Xilinx_Unified_"${XILVER}" # for Vivado 2021.2 28 | fi 29 | 30 | VIVADO_INSTALLER=$(find . -maxdepth 1 -name "${VIVADO_INSTALLER_GLOB}*" | tail -1) 31 | 32 | # only for 2021.2 33 | if [ "${XILVER}" == "2021.2" ] ; then 34 | VIVADO_UPDATE="Xilinx_Vivado_Vitis_Update_2021.2.1_1219_1431.tar.gz" 35 | VIVADO_PATCH="y2k22_patch-1.2.zip" 36 | # Create dummy patch file in root directory (will be overwritten if required) 37 | echo "" > "../$VIVADO_PATCH" 38 | fi 39 | 40 | 41 | 42 | if [ "${VIVADO_INSTALLER}" ] ; then 43 | echo "Xilinx Unified installer found: ${VIVADO_INSTALLER}" 44 | echo "Vivado will be installed in the Docker image." 45 | 46 | if [ "${XILVER}" == "2021.2" ] ; then 47 | echo "Vivado version ${XILVER}: checking for required additional files." 48 | 49 | if [ ! -f "$VIVADO_PATCH" ] ; then 50 | echo "$VIVADO_PATCH patch not found." 51 | echo "Download it from https://support.xilinx.com/s/article/76960?language=en_US and place it in the installers folder" 52 | exit 1 53 | fi 54 | 55 | if [ ! -f "$VIVADO_UPDATE" ] ; then 56 | echo "$VIVADO_UPDATE installer not found." 57 | echo "Download it from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive.html and place it in the installers folder" 58 | exit 1 59 | fi 60 | 61 | cp -f "$VIVADO_PATCH" .. 62 | fi 63 | 64 | INSTALL_VIVADO=("--build-arg" VIVADO_INSTALLER="${VIVADO_INSTALLER}") 65 | if [ "${XILVER}" == "2020.1" ] ; then 66 | INSTALL_VIVADO=("--build-arg" VIVADO_INSTALLER="${VIVADO_INSTALLER}" "--build-arg" VIVADO_AGREE="3rdPartyEULA,WebTalkTerms,XilinxEULA") 67 | fi 68 | if [ "${XILVER}" == "2021.2" ] ; then 69 | INSTALL_VIVADO=("--build-arg" VIVADO_INSTALLER="${VIVADO_INSTALLER}" "--build-arg" VIVADO_UPDATE="${VIVADO_UPDATE}" "--build-arg" VIVADO_AGREE="3rdPartyEULA,XilinxEULA") 70 | fi 71 | if [ "${XILVER}" == "2023.2" ] ; then 72 | INSTALL_VIVADO=("--build-arg" VIVADO_INSTALLER="${VIVADO_INSTALLER}" "--build-arg" VIVADO_AGREE="3rdPartyEULA,XilinxEULA") 73 | fi 74 | else 75 | echo "Xilinx Unified installer not found." 76 | echo "Vivado will NOT be installed in the Docker image." 77 | fi 78 | 79 | cd .. 80 | 81 | # shellcheck disable=SC2009 82 | if ! ps -fC python3 | grep "http.server" > /dev/null ; then 83 | python3 -m "http.server" & 84 | HTTPID=$! 85 | echo "HTTP Server started as PID $HTTPID" 86 | trap 'kill $HTTPID' EXIT QUIT SEGV INT HUP TERM ERR 87 | fi 88 | 89 | echo "Creating Docker image docker_petalinux2:$XILVER..." 90 | time DOCKER_BUILDKIT=1 docker build --build-arg USERNAME=petalinux --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg PETA_VERSION="${XILVER}" --build-arg PETA_RUN_FILE="${PLNX}" "${INSTALL_VIVADO[@]}" -t docker_petalinux2:"${XILVER}" . 91 | if [ "${XILVER}" == "2021.2" ] ; then 92 | if [ -f "y2k22_patch-1.2.zip" ] ; then 93 | rm "y2k22_patch-1.2.zip" 94 | fi 95 | fi 96 | 97 | [ -n "$HTTPID" ] && kill "$HTTPID" && echo "Killed HTTP Server" 98 | -------------------------------------------------------------------------------- /etc/petalin2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-FileCopyrightText: 2021, Carles Fernandez-Prades 3 | # SPDX-License-Identifier: MIT 4 | # 5 | # Run from a PetaLinux project directory 6 | 7 | # allow docker image selection 8 | if [ -n "$1" ]; then 9 | latest="$1" 10 | else 11 | latest=$(docker image list | grep ^docker_petalinux2 | awk '{ print $2 }' | sort | tail -1) 12 | fi 13 | echo "Starting petalinux2:$latest" 14 | mkdir -p "$PWD"/tftpboot 15 | 16 | SET_MIRROR_PATH_AUX="" 17 | if [ "$GENIUX_MIRROR_PATH" ] 18 | then 19 | SET_MIRROR_PATH_AUX="-v $GENIUX_MIRROR_PATH:/source_mirror" 20 | fi 21 | IFS=" " read -r -a SET_MIRROR_PATH <<< "$SET_MIRROR_PATH_AUX" 22 | 23 | if [ "$DISPLAY" ] 24 | then 25 | SET_X_SERVER_AUX="-e DISPLAY=$DISPLAY --net=host -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/home/petalinux/.Xauthority" 26 | fi 27 | IFS=" " read -r -a SET_X_SERVER <<< "$SET_X_SERVER_AUX" 28 | 29 | if [ "${SET_DOCKER_COMMAND_AUX[0]}" ] 30 | then 31 | echo "$@" > ./command.sh 32 | chmod +x ./command.sh 33 | OVERRIDE_ENTRYPOINT_AUX="--entrypoint /bin/bash" 34 | SET_DOCKER_COMMAND_AUX="-l -c ./command.sh" 35 | fi 36 | IFS=" " read -r -a OVERRIDE_ENTRYPOINT <<< "$OVERRIDE_ENTRYPOINT_AUX" 37 | IFS=" " read -r -a SET_DOCKER_COMMAND <<< "$SET_DOCKER_COMMAND_AUX" 38 | 39 | docker run -ti "${SET_X_SERVER[@]}" "${SET_MIRROR_PATH[@]}" -v "$PWD":"$PWD":z -v "$PWD/tftpboot":/tftpboot:z -w "$PWD" --rm -u petalinux "${OVERRIDE_ENTRYPOINT[@]}" docker_petalinux2:"${latest}" "${SET_DOCKER_COMMAND[@]}" 40 | 41 | if [ "$OVERRIDE_ENTRYPOINT_AUX" ] 42 | then 43 | rm ./command.sh 44 | fi 45 | -------------------------------------------------------------------------------- /install_config.txt: -------------------------------------------------------------------------------- 1 | #### Vitis Unified Software Platform Install Configuration #### 2 | Edition=Vitis Unified Software Platform 3 | 4 | Product=Vitis 5 | 6 | # Path where Xilinx software will be installed. 7 | Destination=/tools/Xilinx 8 | 9 | # Choose the Products/Devices the you would like to install. 10 | Modules=Zynq UltraScale+ MPSoC:1,Virtex UltraScale+ 58G:1,Virtex UltraScale+ 58G ES:0,Versal Prime Series ES1:0,Install Devices for Kria SOMs and Starter Kits:1,Zynq-7000:1,Kintex UltraScale+:1,Artix UltraScale+:1,Spartan-7:1,Versal AI Edge Series:1,Install devices for Alveo and Xilinx edge acceleration platforms:1,Engineering Sample Devices for Custom Platforms:0,Versal Premium Series ES1:0,Artix-7:1,Versal Prime Series:1,DocNav:1,Virtex UltraScale+ HBM:1,Kintex-7:1,Virtex UltraScale+:1,Versal AI Core Series ES1:0,Vitis Model Composer(Xilinx Toolbox for MATLAB and Simulink. Includes the functionality of System Generator for DSP):1,Kintex UltraScale:1,Virtex UltraScale:1,Versal HBM Series ES1:0,Zynq UltraScale+ RFSoC:1,Virtex-7:1,Virtex UltraScale+ HBM ES:0,Versal AI Edge Series ES1:0,Versal AI Core Series:1,Zynq UltraScale+ RFSoC ES:0 11 | 12 | # Choose the post install scripts you'd like to run as part of the finalization step. Please note that some of these scripts may require user interaction during runtime. 13 | InstallOptions= 14 | 15 | ## Shortcuts and File associations ## 16 | # Choose whether Start menu/Application menu shortcuts will be created or not. 17 | CreateProgramGroupShortcuts=1 18 | 19 | # Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts. 20 | ProgramGroupFolder=Xilinx Design Tools 21 | 22 | # Choose whether shortcuts will be created for All users or just the Current user. Shortcuts can be created for all users only if you run the installer as administrator. 23 | CreateShortcutsForAllUsers=0 24 | 25 | # Choose whether shortcuts will be created on the desktop or not. 26 | CreateDesktopShortcuts=1 27 | 28 | # Choose whether file associations will be created or not. 29 | CreateFileAssociation=1 30 | 31 | # Choose whether disk usage will be optimized (reduced) after installation 32 | EnableDiskUsageOptimization=1 33 | 34 | -------------------------------------------------------------------------------- /install_config_2020.1_Vivado.txt: -------------------------------------------------------------------------------- 1 | #### Vivado HL System Edition Install Configuration #### 2 | Edition=Vivado HL System Edition 3 | 4 | Product=Vivado 5 | 6 | # Path where Xilinx software will be installed. 7 | Destination=/tools/Xilinx 8 | 9 | # Choose the Products/Devices the you would like to install. 10 | Modules=Versal AI Core Series ES1:0,Virtex UltraScale+ 58G ES:0,Engineering Sample Devices:0,Versal Prime Series ES1:0,Virtex UltraScale+ HBM ES:0,Zynq UltraScale+ RFSoC ES:0 11 | 12 | # Choose the post install scripts you'd like to run as part of the finalization step. Please note that some of these scripts may require user interaction during runtime. 13 | InstallOptions=Acquire or Manage a License Key:0,Enable WebTalk for Vivado to send usage statistics to Xilinx (Always enabled for WebPACK license):1 14 | 15 | ## Shortcuts and File associations ## 16 | # Choose whether Start menu/Application menu shortcuts will be created or not. 17 | CreateProgramGroupShortcuts=1 18 | 19 | # Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts. 20 | ProgramGroupFolder=Xilinx Design Tools 21 | 22 | # Choose whether shortcuts will be created for All users or just the Current user. Shortcuts can be created for all users only if you run the installer as administrator. 23 | CreateShortcutsForAllUsers=0 24 | 25 | # Choose whether shortcuts will be created on the desktop or not. 26 | CreateDesktopShortcuts=1 27 | 28 | # Choose whether file associations will be created or not. 29 | CreateFileAssociation=1 30 | 31 | # Choose whether disk usage will be optimized (reduced) after installation 32 | EnableDiskUsageOptimization=1 33 | 34 | -------------------------------------------------------------------------------- /install_config_2021.2_Vitis.txt: -------------------------------------------------------------------------------- 1 | #### Vitis Unified Software Platform Install Configuration #### 2 | Edition=Vitis Unified Software Platform 3 | 4 | Product=Vitis 5 | 6 | # Path where Xilinx software will be installed. 7 | Destination=/tools/Xilinx 8 | 9 | # Choose the Products/Devices the you would like to install. 10 | Modules=Zynq UltraScale+ MPSoC:1,Virtex UltraScale+ 58G:1,Virtex UltraScale+ 58G ES:0,Versal Prime Series ES1:0,Install Devices for Kria SOMs and Starter Kits:1,Zynq-7000:1,Kintex UltraScale+:1,Artix UltraScale+:1,Spartan-7:1,Versal AI Edge Series:1,Install devices for Alveo and Xilinx edge acceleration platforms:1,Engineering Sample Devices for Custom Platforms:0,Versal Premium Series ES1:0,Artix-7:1,Versal Prime Series:1,DocNav:1,Virtex UltraScale+ HBM:1,Kintex-7:1,Virtex UltraScale+:1,Versal AI Core Series ES1:0,Vitis Model Composer(Xilinx Toolbox for MATLAB and Simulink. Includes the functionality of System Generator for DSP):1,Kintex UltraScale:1,Virtex UltraScale:1,Versal HBM Series ES1:0,Zynq UltraScale+ RFSoC:1,Virtex-7:1,Virtex UltraScale+ HBM ES:0,Versal AI Edge Series ES1:0,Versal AI Core Series:1,Zynq UltraScale+ RFSoC ES:0 11 | 12 | # Choose the post install scripts you'd like to run as part of the finalization step. Please note that some of these scripts may require user interaction during runtime. 13 | InstallOptions= 14 | 15 | ## Shortcuts and File associations ## 16 | # Choose whether Start menu/Application menu shortcuts will be created or not. 17 | CreateProgramGroupShortcuts=1 18 | 19 | # Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts. 20 | ProgramGroupFolder=Xilinx Design Tools 21 | 22 | # Choose whether shortcuts will be created for All users or just the Current user. Shortcuts can be created for all users only if you run the installer as administrator. 23 | CreateShortcutsForAllUsers=0 24 | 25 | # Choose whether shortcuts will be created on the desktop or not. 26 | CreateDesktopShortcuts=1 27 | 28 | # Choose whether file associations will be created or not. 29 | CreateFileAssociation=1 30 | 31 | # Choose whether disk usage will be optimized (reduced) after installation 32 | EnableDiskUsageOptimization=1 33 | 34 | -------------------------------------------------------------------------------- /install_config_2023.2_Vivado.txt: -------------------------------------------------------------------------------- 1 | #### Vivado ML Enterprise Install Configuration #### 2 | Edition=Vivado ML Enterprise 3 | 4 | Product=Vivado 5 | 6 | # Path where AMD FPGAs & Adaptive SoCs software will be installed. 7 | Destination=/tools/Xilinx 8 | 9 | # Choose the Products/Devices the you would like to install. 10 | Modules=Versal HBM Series:1,Versal Prime Series ES1:0,Virtex UltraScale+ 58G:1,Versal Premium Series ES1:0,Versal Net Series ES1:0,Zynq-7000:1,Kintex UltraScale+:1,Artix UltraScale+:1,Spartan-7:1,Versal AI Core Series ES1:0,Versal Premium Series:1,Vitis Embedded Development:0,Versal AI Core Series:1,Versal AI Edge Series ES1:0,Artix-7:1,Virtex UltraScale+ HBM:1,Kintex-7:1,Vitis Networking P4:0,Virtex UltraScale+:1,Versal AI Edge Series:1,Vitis Model Composer(Toolbox for MATLAB and Simulink. Includes the functionality of System Generator for DSP):1,DocNav:1,Zynq UltraScale+ MPSoC:1,Kintex UltraScale:1,Virtex UltraScale:1,Versal Prime Series:1,Engineering Sample Devices:0,Zynq UltraScale+ RFSoC:1,Virtex-7:1,Install Devices for Kria SOMs and Starter Kits:1,Virtex UltraScale+ HBM ES:0,Versal HBM Series ES1:0 11 | 12 | # Choose the post install scripts you'd like to run as part of the finalization step. Please note that some of these scripts may require user interaction during runtime. 13 | InstallOptions=Acquire or Manage a License Key:0 14 | 15 | ## Shortcuts and File associations ## 16 | # Choose whether Start menu/Application menu shortcuts will be created or not. 17 | CreateProgramGroupShortcuts=1 18 | 19 | # Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts. 20 | ProgramGroupFolder=Xilinx Design Tools 21 | 22 | # Choose whether shortcuts will be created for All users or just the Current user. Shortcuts can be created for all users only if you run the installer as administrator. 23 | CreateShortcutsForAllUsers=0 24 | 25 | # Choose whether shortcuts will be created on the desktop or not. 26 | CreateDesktopShortcuts=1 27 | 28 | # Choose whether file associations will be created or not. 29 | CreateFileAssociation=1 30 | 31 | # Choose whether disk usage will be optimized (reduced) after installation 32 | EnableDiskUsageOptimization=1 33 | 34 | -------------------------------------------------------------------------------- /installers/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | 6 | --------------------------------------------------------------------------------