├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md └── accept-eula.sh /.gitignore: -------------------------------------------------------------------------------- 1 | petalinux-*.run 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | MAINTAINER z4yx 4 | 5 | # build with "docker build --build-arg PETA_VERSION=2020.2 --build-arg PETA_RUN_FILE=petalinux-v2020.2-final-installer.run -t petalinux:2020.2 ." 6 | 7 | # install dependences: 8 | 9 | ARG UBUNTU_MIRROR 10 | RUN [ -z "${UBUNTU_MIRROR}" ] || sed -i.bak s/archive.ubuntu.com/${UBUNTU_MIRROR}/g /etc/apt/sources.list 11 | 12 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q \ 13 | build-essential \ 14 | sudo \ 15 | tofrodos \ 16 | iproute2 \ 17 | gawk \ 18 | net-tools \ 19 | expect \ 20 | libncurses5-dev \ 21 | tftpd \ 22 | update-inetd \ 23 | libssl-dev \ 24 | flex \ 25 | bison \ 26 | libselinux1 \ 27 | gnupg \ 28 | wget \ 29 | socat \ 30 | gcc-multilib \ 31 | libidn11 \ 32 | libsdl1.2-dev \ 33 | libglib2.0-dev \ 34 | lib32z1-dev \ 35 | libgtk2.0-0 \ 36 | libtinfo5 \ 37 | xxd \ 38 | screen \ 39 | pax \ 40 | diffstat \ 41 | xvfb \ 42 | xterm \ 43 | texinfo \ 44 | gzip \ 45 | unzip \ 46 | cpio \ 47 | chrpath \ 48 | autoconf \ 49 | lsb-release \ 50 | libtool \ 51 | libtool-bin \ 52 | locales \ 53 | kmod \ 54 | git \ 55 | rsync \ 56 | bc \ 57 | u-boot-tools \ 58 | python \ 59 | && apt-get clean \ 60 | && rm -rf /var/lib/apt/lists/* 61 | 62 | RUN dpkg --add-architecture i386 && apt-get update && \ 63 | DEBIAN_FRONTEND=noninteractive apt-get install -y -q \ 64 | zlib1g:i386 \ 65 | && apt-get clean \ 66 | && rm -rf /var/lib/apt/lists/* 67 | 68 | 69 | ARG PETA_VERSION 70 | ARG PETA_RUN_FILE 71 | 72 | RUN locale-gen en_US.UTF-8 && update-locale 73 | 74 | #make a Vivado user 75 | RUN adduser --disabled-password --gecos '' vivado && \ 76 | usermod -aG sudo vivado && \ 77 | echo "vivado ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 78 | 79 | COPY accept-eula.sh ${PETA_RUN_FILE} / 80 | 81 | # run the install 82 | RUN chmod a+rx /${PETA_RUN_FILE} && \ 83 | chmod a+rx /accept-eula.sh && \ 84 | mkdir -p /opt/Xilinx && \ 85 | chmod 777 /tmp /opt/Xilinx && \ 86 | cd /tmp && \ 87 | sudo -u vivado -i /accept-eula.sh /${PETA_RUN_FILE} /opt/Xilinx/petalinux && \ 88 | rm -f /${PETA_RUN_FILE} /accept-eula.sh 89 | 90 | # make /bin/sh symlink to bash instead of dash: 91 | RUN echo "dash dash/sh boolean false" | debconf-set-selections 92 | RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash 93 | 94 | USER vivado 95 | ENV HOME /home/vivado 96 | ENV LANG en_US.UTF-8 97 | RUN mkdir /home/vivado/project 98 | WORKDIR /home/vivado/project 99 | 100 | #add vivado tools to path 101 | RUN echo "source /opt/Xilinx/petalinux/settings.sh" >> /home/vivado/.bashrc 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Yuxiang Zhang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # petalinux-docker 2 | 3 | Copy petalinux-v2020.2-final-installer.run file to this folder. Then run: 4 | 5 | `docker build --build-arg PETA_VERSION=2020.2 --build-arg PETA_RUN_FILE=petalinux-v2020.2-final-installer.run -t petalinux:2020.2 .` 6 | 7 | After installation, launch petalinux with: 8 | 9 | `docker run -ti --rm -e DISPLAY=$DISPLAY --net="host" -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/home/vivado/.Xauthority -v $HOME/Projects:/home/vivado/project petalinux:2020.2 /bin/bash` 10 | -------------------------------------------------------------------------------- /accept-eula.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | set timeout -1 3 | set install_dir [lindex $argv 1] 4 | set installer [lindex $argv 0] 5 | 6 | spawn $installer $install_dir 7 | set timeout 2 8 | expect { 9 | "ERROR: Invalid options:" {spawn $installer -d $install_dir } 10 | timeout { } 11 | } 12 | 13 | set timeout 600 14 | expect "Press Enter to display the license agreements" 15 | send "\r" 16 | set timeout 2 17 | 18 | expect { 19 | "* >*" {send "y\r"} 20 | timeout { send "q"; sleep 1; exp_continue} 21 | } 22 | expect { 23 | "* >*" {send "y\r"} 24 | timeout { send "q"; sleep 1; exp_continue} 25 | } 26 | expect { 27 | "*Installing PetaLinux...*" {} 28 | "* >*" {send "y\r"} 29 | timeout { send "q"; sleep 1; exp_continue} 30 | } 31 | 32 | set timeout -1 33 | expect "INFO: Checking PetaLinux installer integrity..." 34 | expect "INFO: PetaLinux SDK has been installed" 35 | #interact 36 | --------------------------------------------------------------------------------