From 8afbb37e405b2485417a17ef34a1f9563ada94cd Mon Sep 17 00:00:00 2001 From: Alper Yazar Date: Thu, 4 Dec 2025 12:48:29 +0300 Subject: [PATCH 1/4] minimal setup files for 2022.1 ? --- xilinx/vivado-vitis-sdk/2022.1/.gitignore | 2 + .../vivado-vitis-sdk/2022.1/Dockerfile-setup | 89 +++++++++++++++++++ xilinx/vivado-vitis-sdk/2022.1/README.md | 2 + .../2022.1/replace_sources.sh | 50 +++++++++++ .../2022.1/sources-stage-1.list | 4 + 5 files changed, 147 insertions(+) create mode 100644 xilinx/vivado-vitis-sdk/2022.1/.gitignore create mode 100644 xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup create mode 100644 xilinx/vivado-vitis-sdk/2022.1/README.md create mode 100644 xilinx/vivado-vitis-sdk/2022.1/replace_sources.sh create mode 100644 xilinx/vivado-vitis-sdk/2022.1/sources-stage-1.list diff --git a/xilinx/vivado-vitis-sdk/2022.1/.gitignore b/xilinx/vivado-vitis-sdk/2022.1/.gitignore new file mode 100644 index 0000000..e3d8924 --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/.gitignore @@ -0,0 +1,2 @@ +build.log +Xilinx_Unified_2022.1_0420_0327.tar.gz diff --git a/xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup new file mode 100644 index 0000000..c6ba874 --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup @@ -0,0 +1,89 @@ +# ------------------------------------------------------------------------------ +# MIT License +# +# Copyright (c) 2025 The EBox Authors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ +# EBox https://github.com/alperyazar/EBox +# ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ +# Vivado/SDK 2022.1 +# ------------------------------------------------------------------------------ + +# Stage 1: Installer +# Offical: 20.04 +FROM ubuntu:20.04 AS installer + +# Do the COPY and untar at the very top to maximize build cache +# Copy the Vivado installer tar file into the container +ARG VIVADO_INSTALLATION_FILE="Xilinx_Unified_2022.1_0420_0327.tar.gz" +COPY $VIVADO_INSTALLATION_FILE /tmp/$VIVADO_INSTALLATION_FILE + +# Check if we should skip the MD5 comparison +ARG MD5="0bf810cf5eaa28a849ab52b9bfdd20a5" +ARG SKIP_MD5="0" +RUN if [ "$SKIP_MD5" != "1" ]; then \ + echo "Calculating MD5..." && \ + file_md5=$(md5sum /tmp/$VIVADO_INSTALLATION_FILE | awk '{ print $1 }') && \ + if [ "$file_md5" != "$MD5" ]; then \ + echo "MD5 mismatch! Expected $MD5, got $file_md5. Build failed." && exit 1; \ + else \ + echo "MD5 matched: $file_md5"; \ + fi; \ + else \ + echo "Skipping MD5 comparison."; \ + fi + +# Extract Vivado +RUN mkdir -p /tmp/installer && \ + tar -xvzf /tmp/$VIVADO_INSTALLATION_FILE -C /tmp/installer --strip-components=1 + + +RUN mkdir -p /opt/EBox +COPY sources-stage-1.list /opt/EBox/sources-stage-1.list +COPY replace_sources.sh /opt/EBox/bin/replace_sources.sh +RUN chmod +x /opt/EBox/bin/replace_sources.sh && \ + /opt/EBox/bin/replace_sources.sh /opt/EBox/sources-stage-1.list + +# Install required packages to suppress warnings and possible problems during +# install +ENV DEBIAN_FRONTEND=noninteractive +ARG COMMON_PACKAGES="\ + locales \ + libncurses5 \ + xvfb \ + libglib2.0-0 \ + libxi6 \ + libxtst6 \ + libxrender1 \ + libxrandr2 \ + libfontconfig1" +RUN apt update && apt install -y $COMMON_PACKAGES && \ + echo $COMMON_PACKAGES > /opt/EBox/common_packages.txt + +# https://stackoverflow.com/a/28406007/1766391 +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 diff --git a/xilinx/vivado-vitis-sdk/2022.1/README.md b/xilinx/vivado-vitis-sdk/2022.1/README.md new file mode 100644 index 0000000..5df9069 --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/README.md @@ -0,0 +1,2 @@ +# Vivado 2022.1 + diff --git a/xilinx/vivado-vitis-sdk/2022.1/replace_sources.sh b/xilinx/vivado-vitis-sdk/2022.1/replace_sources.sh new file mode 100644 index 0000000..e5de07d --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/replace_sources.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# ------------------------------------------------------------------------------ +# MIT License +# +# Copyright (c) 2025 The EBox Authors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# ------------------------------------------------------------------------------ + +set -e + +# Use first argument as source file, or default to /tmp/sources.list +SOURCE_FILE="${1:-/tmp/sources.list}" +TARGET_FILE="/etc/apt/sources.list" + +# Check if file exists +if [ ! -f "$SOURCE_FILE" ]; then + echo "No sources.list provided at $SOURCE_FILE. Skipping replacement." + exit 0 +fi + +# Read first line +FIRST_LINE=$(head -n 1 "$SOURCE_FILE") + +# Check if it starts with #ignore +if echo "$FIRST_LINE" | grep -q "^#ignore"; then + echo "Found '#ignore' marker. Keeping default sources.list." +else + echo "Replacing default sources.list with $SOURCE_FILE." + cp "$SOURCE_FILE" "$TARGET_FILE" +fi + +exit 0 diff --git a/xilinx/vivado-vitis-sdk/2022.1/sources-stage-1.list b/xilinx/vivado-vitis-sdk/2022.1/sources-stage-1.list new file mode 100644 index 0000000..820e2cf --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/sources-stage-1.list @@ -0,0 +1,4 @@ +#ignore this file will be ignored by replace_sources.sh because it begins with #ignore + +deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe +deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe From a4bff441868aa367c053be64f04ecddfcdc67c11 Mon Sep 17 00:00:00 2001 From: Alper Yazar Date: Thu, 4 Dec 2025 15:26:00 +0300 Subject: [PATCH 2/4] 2022.1 final? --- xilinx/vivado-vitis-sdk/2022.1/Dockerfile | 195 ++++++++++++++++++ .../vivado-vitis-sdk/2022.1/Dockerfile-setup | 2 +- xilinx/vivado-vitis-sdk/2022.1/README.md | 52 +++++ xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh | 106 ++++++++++ .../2022.1/install_config.txt | 32 +++ .../2022.1/sources-final.list | 4 + .../2022.1/sources-stage-2.list | 4 + 7 files changed, 394 insertions(+), 1 deletion(-) create mode 100644 xilinx/vivado-vitis-sdk/2022.1/Dockerfile create mode 100644 xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh create mode 100644 xilinx/vivado-vitis-sdk/2022.1/install_config.txt create mode 100644 xilinx/vivado-vitis-sdk/2022.1/sources-final.list create mode 100644 xilinx/vivado-vitis-sdk/2022.1/sources-stage-2.list diff --git a/xilinx/vivado-vitis-sdk/2022.1/Dockerfile b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile new file mode 100644 index 0000000..7a666b6 --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile @@ -0,0 +1,195 @@ +# ------------------------------------------------------------------------------ +# MIT License +# +# Copyright (c) 2025 The EBox Authors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ +# EBox https://github.com/alperyazar/EBox +# ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ +# Vivado/Vitis 2022.1 +# ------------------------------------------------------------------------------ + +# Stage 1: Installer +# Offical: 20.04 +FROM ubuntu:20.04 AS installer + +# Do the COPY and untar at the very top to maximize build cache +# Copy the Vivado installer tar file into the container +ARG VIVADO_INSTALLATION_FILE="Xilinx_Unified_2022.1_0420_0327.tar.gz" +COPY $VIVADO_INSTALLATION_FILE /tmp/$VIVADO_INSTALLATION_FILE + +# Check if we should skip the MD5 comparison +ARG MD5="0bf810cf5eaa28a849ab52b9bfdd20a5" +ARG SKIP_MD5="0" +RUN if [ "$SKIP_MD5" != "1" ]; then \ + echo "Calculating MD5..." && \ + file_md5=$(md5sum /tmp/$VIVADO_INSTALLATION_FILE | awk '{ print $1 }') && \ + if [ "$file_md5" != "$MD5" ]; then \ + echo "MD5 mismatch! Expected $MD5, got $file_md5. Build failed." && exit 1; \ + else \ + echo "MD5 matched: $file_md5"; \ + fi; \ + else \ + echo "Skipping MD5 comparison."; \ + fi + +# Extract Vivado +RUN mkdir -p /tmp/installer && \ + tar -xvzf /tmp/$VIVADO_INSTALLATION_FILE -C /tmp/installer --strip-components=1 + + +RUN mkdir -p /opt/EBox +COPY sources-stage-1.list /opt/EBox/sources-stage-1.list +COPY replace_sources.sh /opt/EBox/bin/replace_sources.sh +RUN chmod +x /opt/EBox/bin/replace_sources.sh && \ + /opt/EBox/bin/replace_sources.sh /opt/EBox/sources-stage-1.list + +# Install required packages to suppress warnings and possible problems during +# install +ENV DEBIAN_FRONTEND=noninteractive +ARG COMMON_PACKAGES="\ + locales \ + libncurses5 \ + xvfb \ + libglib2.0-0 \ + libxi6 \ + libxtst6 \ + libxrender1 \ + libxrandr2 \ + libfontconfig1" +RUN apt update && apt install -y $COMMON_PACKAGES && \ + echo $COMMON_PACKAGES > /opt/EBox/common_packages.txt + +# https://stackoverflow.com/a/28406007/1766391 +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +ARG VIVADO_BATCH_INSTALL_CONFIG_FILE="install_config.txt" +COPY $VIVADO_BATCH_INSTALL_CONFIG_FILE /opt/EBox/install_config.txt + +# Install Vivado +ENV TERM=xterm-256color +RUN /tmp/installer/xsetup \ + --agree XilinxEULA,3rdPartyEULA,WebTalkTerms \ + --batch Install \ + --config /opt/EBox/install_config.txt + +# Save environment variables used during the build +RUN printenv > /opt/EBox/env-stage-1 + +# Stage 2: Final +FROM ubuntu:20.04 + +COPY --from=installer /opt/Xilinx /opt/Xilinx +COPY --from=installer /opt/EBox /opt/EBox + +COPY sources-stage-2.list /opt/EBox/sources-stage-2.list +RUN /opt/EBox/bin/replace_sources.sh /opt/EBox/sources-stage-2.list + +ENV DEBIAN_FRONTEND=noninteractive + +# According to Xilinx (AMD) 000036522 article the following packages should +# be installed manually +# +# Package Name : Ubuntu Package Name +# compat-openssl10 : openssl (?) + ca-certificates (recommended) +# libnss3-dev : libnss3-dev +# libgdk-pixbuf2.0-dev : libgdk-pixbuf2.0-dev +# libgtk-3-dev : libgtk-3-dev +# libxss-dev : libxss-dev +RUN apt update && apt install -y $(grep -vE '^\s*#|^\s*$' /opt/EBox/common_packages.txt | tr -d '\\') && apt install -y \ + libyaml-0-2 \ + libsecret-1-0 \ + rlwrap \ + x11-utils \ + libasound2 \ + sudo + +# https://stackoverflow.com/a/28406007/1766391 +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +# https://adaptivesupport.amd.com/s/article/000036522?language=en_US +# We did (all) install manually at previous steps. But just to make sure +# run the Xilinx's script again. +RUN bash /opt/Xilinx/Vitis/2022.1/scripts/installLibs.sh + +# Create a non-root user ebox with root (sudo) privileges +RUN groupadd -g 888 ebox && \ + adduser --uid 888 --gid 888 --shell /bin/bash ebox && \ + adduser ebox sudo && \ + echo 'ebox ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ + echo "ebox:ebox" | chpasswd && \ + echo "source /opt/Xilinx/Vivado/2018.1/settings64.sh" >> "/home/ebox/.bashrc" && \ + chown ebox:ebox /home/ebox/.bashrc + +ARG EXTRA_PACKAGES="python3-dev python3-pip" +RUN apt update && apt install -y $EXTRA_PACKAGES + +# Allow user to append extra packages via --build-arg +ARG CMD_EXTRA_PACKAGES="" +RUN apt update && apt install -y $CMD_EXTRA_PACKAGES + +# Set the default command to launch when starting the container +RUN apt update && apt install -y gosu +COPY entrypoint.sh /opt/EBox/entrypoint.sh +RUN chmod +x /opt/EBox/entrypoint.sh + +COPY sources-final.list /opt/EBox/sources-final.list +RUN /opt/EBox/bin/replace_sources.sh /opt/EBox/sources-final.list + +ARG EBOX_OCI_TITLE="EBox - Vivado 2022.1" +ARG EBOX_OCI_DESCRIPTION="Vivado Vitis 2022.1 in a container, the EBox project" +ARG EBOX_OCI_VERSION="19700101-0" +ARG EBOX_OCI_REVISION="20251204-0" +ARG EBOX_OCI_LICENSE="MIT" +ARG EBOX_OCI_AUTHORS="The EBox Authors" + +LABEL org.opencontainers.image.title="${EBOX_OCI_TITLE}" \ + org.opencontainers.image.description="${EBOX_OCI_DESCRIPTION}" \ + org.opencontainers.image.version="${EBOX_OCI_VERSION}" \ + org.opencontainers.image.revision="${EBOX_OCI_REVISION}" \ + org.opencontainers.image.license="${EBOX_OCI_LICENSE}" \ + org.opencontainers.image.authors="${EBOX_OCI_AUTHORS}" \ + org.opencontainers.image.ref.name="ebox-xilinx-vivado-2022-1" + +ENV EBOX_OCI_TITLE=${EBOX_OCI_TITLE} +ENV EBOX_OCI_DESCRIPTION=${EBOX_OCI_DESCRIPTION} +ENV EBOX_OCI_VERSION=${EBOX_OCI_VERSION} +ENV EBOX_OCI_REVISION=${EBOX_OCI_REVISION} +ENV EBOX_OCI_LICENSE=${EBOX_OCI_LICENSE} +ENV EBOX_OCI_AUTHORS=${EBOX_OCI_AUTHORS} + +RUN printenv > /opt/EBox/env-stage-2 && cat /opt/EBox/env-stage-1 /opt/EBox/env-stage-2 > /opt/EBox/env + +USER root +WORKDIR /root +CMD [ "/bin/bash" ] +ENTRYPOINT ["/opt/EBox/entrypoint.sh"] diff --git a/xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup index c6ba874..af94bf9 100644 --- a/xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup +++ b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile-setup @@ -27,7 +27,7 @@ # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ -# Vivado/SDK 2022.1 +# Vivado/Vitis 2022.1 # ------------------------------------------------------------------------------ # Stage 1: Installer diff --git a/xilinx/vivado-vitis-sdk/2022.1/README.md b/xilinx/vivado-vitis-sdk/2022.1/README.md index 5df9069..699f58b 100644 --- a/xilinx/vivado-vitis-sdk/2022.1/README.md +++ b/xilinx/vivado-vitis-sdk/2022.1/README.md @@ -1,2 +1,54 @@ # Vivado 2022.1 +## Creating `install_config.txt` + +```shell +sudo docker build --file Dockerfile-setup --tag vivado:2022.1-setup . +``` + +then + +first + +```shell +sudo docker run --rm -it vivado:2022.1-setup +``` + +inside the container, run + +```shell +/tmp/installer/xsetup -b ConfigGen +``` + +to create install config. + +Then `cat /root/.Xilinx/install_config.txt` and save the content (and modify if +you need) as `install_config.txt` + +--- + +OR + +interactive installer but can't save the config file, so pretty useless for +our case. + +First enable X11 access + +```shell +xhost +local:docker +``` + +then run as + +```shell +sudo docker run --rm -it \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -e DISPLAY=${DISPLAY} \ + vivado:2022.1-setup +``` + +then inside the container + +```shell +/tmp/installer/xsetup +``` \ No newline at end of file diff --git a/xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh b/xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh new file mode 100644 index 0000000..ec283b2 --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +# ------------------------------------------------------------------------------ +# MIT License +# +# Copyright (c) 2025 The EBox Authors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# ------------------------------------------------------------------------------ + +set -e + +# -------------------------------------------------------------------- +# Entry point for Vivado/Vitis container (Docker & Podman compatible) +# -------------------------------------------------------------------- + +WS_PATH="${WORKSPACE_PATH:-/workspace}" + +# If no arguments are passed, default to bash +if [ $# -eq 0 ]; then + echo "No command provided. Defaulting to bash." + set -- /bin/bash +fi + +# If no UID/GID provided, assume interactive root or Podman +if [ -z "$USER_ID" ] || [ -z "$GROUP_ID" ]; then + echo "No USER_ID or GROUP_ID provided. Running as $(whoami)..." + cd "$HOME" || cd /root # make sure we land somewhere safe + + if [ "$(id -u)" -eq 0 ]; then + echo "WARNING: You are running as ROOT." + echo "If using Docker and mounted volumes, consider running:" + echo " gosu ebox /bin/bash" + echo "You can return to root with 'sudo -i' or 'exit'." + fi + + if [[ "$EBOX_MODIFY_PATH" != "false" ]]; then + # Avoid duplicate bashrc entries + grep -qxF 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' "$HOME/.bashrc" || echo 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' >> "$HOME/.bashrc" + else + echo "Skipping PATH modification" + fi + + exec "$@" + exit 0 +fi + +USERNAME="u$USER_ID" +GROUPNAME="g$GROUP_ID" + +# Create group if not exists +if ! getent group "$GROUP_ID" > /dev/null; then + if ! groupadd -g "$GROUP_ID" "$GROUPNAME"; then + echo "ERROR: Failed to create group with GID $GROUP_ID" >&2 + exit 1 + fi +fi + +# Create user if not exists +if ! id -u "$USER_ID" > /dev/null 2>&1; then + if ! useradd -u "$USER_ID" -g "$GROUP_ID" -m "$USERNAME" -s /bin/bash; then + echo "ERROR: Failed to create user with UID $USER_ID" >&2 + exit 1 + fi +fi + +HOME_DIR=$(getent passwd "$USER_ID" | cut -d: -f6) + +# Avoid duplicate bashrc entries +grep -qxF 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' "$HOME_DIR/.bashrc" || echo 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' >> "$HOME_DIR/.bashrc" + +# Setup workspace +if [ ! -d "$WS_PATH" ]; then + mkdir -p "$WS_PATH" + echo "WARNING: '$WS_PATH' was missing and has been created. Mount it using -v to persist work." +else + echo "Workspace directory '$WS_PATH' already exists." +fi + +if [[ "$EBOX_DO_CHOWN_WS" == "true" ]]; then + echo "Running: chown -R $USER_ID:$GROUP_ID $WS_PATH" + chown -R "$USER_ID:$GROUP_ID" "$WS_PATH" +fi + +cd "$WS_PATH" + +# Ensure HOME is set for the new user +export HOME="$HOME_DIR" + +exec gosu "$USERNAME" "$@" diff --git a/xilinx/vivado-vitis-sdk/2022.1/install_config.txt b/xilinx/vivado-vitis-sdk/2022.1/install_config.txt new file mode 100644 index 0000000..c58c3fd --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/install_config.txt @@ -0,0 +1,32 @@ +#### Vitis Unified Software Platform Install Configuration #### +Edition=Vitis Unified Software Platform + +Product=Vitis + +# Path where Xilinx software will be installed. +Destination=/opt/Xilinx + +# Choose the Products/Devices the you would like to install. +Modules=Virtex UltraScale+ 58G:0,Virtex UltraScale+ 58G ES:0,Versal Prime Series ES1:0,Install Devices for Kria SOMs and Starter Kits:1,Vitis IP Cache (Enable faster on-boarding for new users):0,Zynq-7000:1,Versal AI Edge Series:0,Kintex UltraScale+:1,Artix UltraScale+:1,Spartan-7:1,Install devices for Alveo and Xilinx edge acceleration platforms:0,Engineering Sample Devices for Custom Platforms:0,Versal AI Core Series:0,Versal Premium Series ES1:0,Artix-7:1,Zynq UltraScale+ MPSoC:1,DocNav:0,Virtex UltraScale+ HBM:0,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,Versal Premium Series:0,Kintex UltraScale:0,Virtex UltraScale:0,Versal Prime Series:0,Versal HBM Series ES1:0,Zynq UltraScale+ RFSoC:0,Virtex-7:1,Virtex UltraScale+ HBM ES:0,Versal AI Edge Series ES1:0,Zynq UltraScale+ RFSoC ES:0 + +# 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. +InstallOptions= + +## Shortcuts and File associations ## +# Choose whether Start menu/Application menu shortcuts will be created or not. +CreateProgramGroupShortcuts=1 + +# Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts. +ProgramGroupFolder=Xilinx Design Tools + +# 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. +CreateShortcutsForAllUsers=0 + +# Choose whether shortcuts will be created on the desktop or not. +CreateDesktopShortcuts=1 + +# Choose whether file associations will be created or not. +CreateFileAssociation=1 + +# Choose whether disk usage will be optimized (reduced) after installation +EnableDiskUsageOptimization=0 \ No newline at end of file diff --git a/xilinx/vivado-vitis-sdk/2022.1/sources-final.list b/xilinx/vivado-vitis-sdk/2022.1/sources-final.list new file mode 100644 index 0000000..820e2cf --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/sources-final.list @@ -0,0 +1,4 @@ +#ignore this file will be ignored by replace_sources.sh because it begins with #ignore + +deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe +deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe diff --git a/xilinx/vivado-vitis-sdk/2022.1/sources-stage-2.list b/xilinx/vivado-vitis-sdk/2022.1/sources-stage-2.list new file mode 100644 index 0000000..820e2cf --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/sources-stage-2.list @@ -0,0 +1,4 @@ +#ignore this file will be ignored by replace_sources.sh because it begins with #ignore + +deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe +deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe From 27cc7c32ab09235c1753e2457811277633828060 Mon Sep 17 00:00:00 2001 From: Alper Yazar Date: Thu, 4 Dec 2025 15:26:59 +0300 Subject: [PATCH 3/4] readme --- xilinx/vivado-vitis-sdk/2022.1/README.md | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/xilinx/vivado-vitis-sdk/2022.1/README.md b/xilinx/vivado-vitis-sdk/2022.1/README.md index 699f58b..09d22d1 100644 --- a/xilinx/vivado-vitis-sdk/2022.1/README.md +++ b/xilinx/vivado-vitis-sdk/2022.1/README.md @@ -51,4 +51,36 @@ then inside the container ```shell /tmp/installer/xsetup +``` + +## Building the image + +```bash +# Define a version tag +TAG=YYYYMMDD- # Change this to match the current date and build count like 20250424-1 + +# Build the Docker image with tagging and log output +sudo docker build \ + -t vivado:2022.1-$TAG \ + --build-arg EBOX_OCI_VERSION="$TAG" \ + --progress=plain . \ + 2>&1 | tee build.log +``` + +## Runing the image + +To test: + +```shell +sudo docker run --rm -it --user ebox vivado:2022.1-$TAG +``` + +with X11 + +```shell +sudo docker run --rm -it \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -e DISPLAY=${DISPLAY} \ + -u ebox \ + vivado:2022.1-$TAG ``` \ No newline at end of file From cb0f706dda6f1e349d78eb3df3eb96d1b89f94dc Mon Sep 17 00:00:00 2001 From: Alper Yazar Date: Fri, 5 Dec 2025 11:34:38 +0300 Subject: [PATCH 4/4] finalize vivado 2022.1, hope? --- xilinx/vivado-vitis-sdk/2022.1/Dockerfile | 52 +++++++++-- xilinx/vivado-vitis-sdk/2022.1/README.md | 96 +++++++++++++++++++- xilinx/vivado-vitis-sdk/2022.1/ebox-vivado | 30 ++++++ xilinx/vivado-vitis-sdk/2022.1/ebox.sh | 40 ++++++++ xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh | 2 + 5 files changed, 209 insertions(+), 11 deletions(-) create mode 100644 xilinx/vivado-vitis-sdk/2022.1/ebox-vivado create mode 100644 xilinx/vivado-vitis-sdk/2022.1/ebox.sh diff --git a/xilinx/vivado-vitis-sdk/2022.1/Dockerfile b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile index 7a666b6..c373764 100644 --- a/xilinx/vivado-vitis-sdk/2022.1/Dockerfile +++ b/xilinx/vivado-vitis-sdk/2022.1/Dockerfile @@ -66,18 +66,30 @@ RUN chmod +x /opt/EBox/bin/replace_sources.sh && \ /opt/EBox/bin/replace_sources.sh /opt/EBox/sources-stage-1.list # Install required packages to suppress warnings and possible problems during -# install +# install and runtime ENV DEBIAN_FRONTEND=noninteractive ARG COMMON_PACKAGES="\ + python3 \ locales \ - libncurses5 \ + lsb-release \ + xz-utils \ + libc6-dev-i386 net-tools \ + graphviz \ + make \ + unzip \ + zip \ + g++ \ + libtinfo5 \ xvfb \ - libglib2.0-0 \ - libxi6 \ - libxtst6 \ - libxrender1 \ - libxrandr2 \ - libfontconfig1" + git \ + libncursesw5 \ + libc6-dev-i386 \ + openssl \ + ca-certificates \ + libnss3-dev \ + libgdk-pixbuf2.0-dev \ + libgtk-3-dev \ + libxss-dev" RUN apt update && apt install -y $COMMON_PACKAGES && \ echo $COMMON_PACKAGES > /opt/EBox/common_packages.txt @@ -94,7 +106,7 @@ COPY $VIVADO_BATCH_INSTALL_CONFIG_FILE /opt/EBox/install_config.txt # Install Vivado ENV TERM=xterm-256color RUN /tmp/installer/xsetup \ - --agree XilinxEULA,3rdPartyEULA,WebTalkTerms \ + --agree XilinxEULA,3rdPartyEULA \ --batch Install \ --config /opt/EBox/install_config.txt @@ -121,12 +133,18 @@ ENV DEBIAN_FRONTEND=noninteractive # libgdk-pixbuf2.0-dev : libgdk-pixbuf2.0-dev # libgtk-3-dev : libgtk-3-dev # libxss-dev : libxss-dev +# libcanberra-gtk-module: Vivado Gtk-Message: Failed to load module "canberra-gtk-module" +# gnome-icon-theme: Solves Vitis can't open Create Platform GUI. +# Problem: https://adaptivesupport.amd.com/s/question/0D52E00006hpPlESAU/create-new-platform-project-button-doesnt-work +# Solution: https://adaptivesupport.amd.com/s/question/0D52E00006ypaI2SAI/vitis-platform-project-does-not-work-does-not-respond RUN apt update && apt install -y $(grep -vE '^\s*#|^\s*$' /opt/EBox/common_packages.txt | tr -d '\\') && apt install -y \ libyaml-0-2 \ libsecret-1-0 \ rlwrap \ x11-utils \ libasound2 \ + libcanberra-gtk-module \ + gnome-icon-theme \ sudo # https://stackoverflow.com/a/28406007/1766391 @@ -141,13 +159,19 @@ ENV LC_ALL=en_US.UTF-8 # run the Xilinx's script again. RUN bash /opt/Xilinx/Vitis/2022.1/scripts/installLibs.sh + +# https://adaptivesupport.amd.com/s/question/0D54U00006lApRISA0/immediate-segfault-when-running-xsdb +RUN mv /opt/Xilinx/Vitis/2022.1/bin/unwrapped/lnx64.o/rlwrap /opt/Xilinx/Vitis/2022.1/bin/unwrapped/lnx64.o/rlwrap.bak && \ + ln -s `which rlwrap` /opt/Xilinx/Vitis/2022.1/bin/unwrapped/lnx64.o/rlwrap + # Create a non-root user ebox with root (sudo) privileges RUN groupadd -g 888 ebox && \ adduser --uid 888 --gid 888 --shell /bin/bash ebox && \ adduser ebox sudo && \ echo 'ebox ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \ echo "ebox:ebox" | chpasswd && \ - echo "source /opt/Xilinx/Vivado/2018.1/settings64.sh" >> "/home/ebox/.bashrc" && \ + echo "source /opt/Xilinx/Vivado/2022.1/settings64.sh" >> "/home/ebox/.bashrc" && \ + echo "source /opt/EBox/ebox.sh /opt/EBox/bin" >> "/home/ebox/.bashrc" && \ chown ebox:ebox /home/ebox/.bashrc ARG EXTRA_PACKAGES="python3-dev python3-pip" @@ -162,6 +186,14 @@ RUN apt update && apt install -y gosu COPY entrypoint.sh /opt/EBox/entrypoint.sh RUN chmod +x /opt/EBox/entrypoint.sh +# https://adaptivesupport.amd.com/s/article/000034450?language=en_US +COPY ebox-vivado /opt/EBox/bin/vivado +COPY ebox.sh /opt/EBox/ebox.sh +RUN chmod +x /opt/EBox/bin/vivado && chmod +x /opt/EBox/ebox.sh + +# To suppress Vitis dbus warnings, no vital +ENV NO_AT_BRIDGE=1 + COPY sources-final.list /opt/EBox/sources-final.list RUN /opt/EBox/bin/replace_sources.sh /opt/EBox/sources-final.list diff --git a/xilinx/vivado-vitis-sdk/2022.1/README.md b/xilinx/vivado-vitis-sdk/2022.1/README.md index 09d22d1..2ee232c 100644 --- a/xilinx/vivado-vitis-sdk/2022.1/README.md +++ b/xilinx/vivado-vitis-sdk/2022.1/README.md @@ -83,4 +83,98 @@ sudo docker run --rm -it \ -e DISPLAY=${DISPLAY} \ -u ebox \ vivado:2022.1-$TAG -``` \ No newline at end of file +``` + +## Notlar + +```text +Abnormal program termination (11) +Please check '/home/ebox/hs_err_pid52.log' for details +segfault in /opt/Xilinx/Vivado/2022.1/bin/unwrapped/lnx64.o/vivado -exec vivado, exiting... +ebox@40b5aad2f578:~$ cat /home/ebox/hs_err_pid52.log +# +# An unexpected error has occurred (11) +# +Stack: +/opt/Xilinx/Vivado/2022.1/tps/lnx64/jre11.0.11_9/lib//server/libjvm.so(+0xbefecb) [0x7fb27b28fecb] +/opt/Xilinx/Vivado/2022.1/tps/lnx64/jre11.0.11_9/lib//server/libjvm.so(JVM_handle_linux_signal+0xd1) [0x7fb27b296c81] +/opt/Xilinx/Vivado/2022.1/tps/lnx64/jre11.0.11_9/lib//server/libjvm.so(+0xbead23) [0x7fb27b28ad23] +/opt/Xilinx/Vivado/2022.1/tps/lnx64/javafx-sdk-11.0.2/lib/libjfxwebkit.so(+0x205ae18) [0x7fb23066ce18] +/lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7fb2d1e98090] +/lib/x86_64-linux-gnu/libc.so.6(malloc_usable_size+0x48) [0x7fb2d1ef11f8] +/lib/x86_64-linux-gnu/libudev.so.1(+0x10319) [0x7fb2566a8319] +/lib/x86_64-linux-gnu/libudev.so.1(+0x167c4) [0x7fb2566ae7c4] +/lib/x86_64-linux-gnu/libudev.so.1(+0x1b255) [0x7fb2566b3255] +/lib/x86_64-linux-gnu/libudev.so.1(+0x1b4bb) [0x7fb2566b34bb] +/lib/x86_64-linux-gnu/libudev.so.1(udev_enumerate_scan_devices+0x277) [0x7fb2566b5d67] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libXil_lmgr11.so(+0x129015) [0x7fb2ca768015] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libXil_lmgr11.so(xilinxd_52bd866351b78202+0x9) [0x7fb2ca768499] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libXil_lmgr11.so(+0xd6317) [0x7fb2ca715317] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libXil_lmgr11.so(xilinxd_52bd862318b59a70+0x86) [0x7fb2ca7150d6] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libXil_lmgr11.so(+0xc364f) [0x7fb2ca70264f] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libXil_lmgr11.so(xilinxd_52bd9e9e1c8e52fb+0x1b) [0x7fb2ca70c3eb] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libXil_lmgr11.so(xilinxd_52bd700d1bd3c616+0x30) [0x7fb2ca70c480] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commonxillic.so(XilReg::Utils::GetHostInfo[abi:cxx11](XilReg::Utils::HostInfoType, bool) const+0x1a0) [0x7fb2ce667cd0] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commonxillic.so(XilReg::Utils::GetHostInfoFormatted[abi:cxx11](XilReg::Utils::HostInfoType, bool) const+0x59) [0x7fb2ce66abc9] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commonxillic.so(XilReg::Utils::GetHostInfo[abi:cxx11]() const+0x103) [0x7fb2ce66ae83] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commonxillic.so(XilReg::Utils::GetRegInfo(std::__cxx11::basic_string, std::allocator > const&, bool, bool)+0x96) [0x7fb2ce671f96] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commonxillic.so(XilReg::Utils::GetRegInfoWebTalk(std::__cxx11::basic_string, std::allocator > const&)+0x60) [0x7fb2ce6721c0] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_project.so(HAPRWebtalkHelper::getRegistrationId[abi:cxx11]() const+0x3d) [0x7fb2904d1bdd] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_project.so(HAPRWebtalkHelper::HAPRWebtalkHelper(HAPRProject*, HAPRDesign*, HWEWebtalkMgr*, std::__cxx11::basic_string, std::allocator > const&)+0x178) [0x7fb2904d42d8] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_tcltasks.so(+0x1d68475) [0x7fb2c55f4475] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_tcltasks.so(+0x1d71474) [0x7fb2c55fd474] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_common.so(+0xb44ccf) [0x7fb2d2faaccf] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(+0x3356f) [0x7fb2cdebc56f] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(+0x76945) [0x7fb2cdeff945] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(+0x7e0f9) [0x7fb2cdf070f9] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(TclEvalObjEx+0x76) [0x7fb2cdebe216] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_common.so(+0xb435b3) [0x7fb2d2fa95b3] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(Tcl_ServiceEvent+0x7f) [0x7fb2cdf30bef] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(Tcl_DoOneEvent+0x154) [0x7fb2cdf30f24] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commontasks.so(+0x2b39f7) [0x7fb2c7b129f7] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commontasks.so(+0x2bc22f) [0x7fb2c7b1b22f] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commontasks.so(+0x2bcb3f) [0x7fb2c7b1bb3f] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_common.so(+0xb44ccf) [0x7fb2d2faaccf] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(+0x3356f) [0x7fb2cdebc56f] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(+0x76945) [0x7fb2cdeff945] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(+0x7e0f9) [0x7fb2cdf070f9] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(TclEvalObjEx+0x76) [0x7fb2cdebe216] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_commonmain.so(+0xc538) [0x7fb2d2458538] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/libtcl8.5.so(Tcl_Main+0x1d0) [0x7fb2cdf292f0] +/opt/Xilinx/Vivado/2022.1/lib/lnx64.o/librdi_common.so(+0xb721fb) [0x7fb2d2fd81fb] +/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7fb2d1e3a609] +/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7fb2d1f74353] +ebox@40b5aad2f578:~$ LD_PRELOAD=/lib/x86_64-linux-gnu/libudev.so.1 vivado +``` + +ÜSTTEKİNİN çözümü `LD_PRELOAD=/lib/x86_64-linux-gnu/libudev.so.1 vivado` + + +---- + +```text +(java:106690): dbind-WARNING **: 05:26:09.844: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus_0: No such file or directory +SWT SessionManagerDBus: Failed to connect to org.gnome.SessionManager: Failed to execute child process “dbus-launch” (No such file or directory) +SWT SessionManagerDBus: Failed to connect to org.xfce.SessionManager: Failed to execute child process “dbus-launch” (No such file or directory) + +(Vitis IDE:106690): dconf-WARNING **: 05:26:18.306: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory) +``` + +ÜSTEKİNİN çözümü `ENV NO_AT_BRIDGE=1` + +--- + +```text +xsct +/opt/Xilinx/Vitis/2022.1/bin/xsct: line 241: 115721 Segmentation fault (core dumped) "$RDI_BINROOT"/unwrapped/"$RDI_PLATFORM$RDI_OPT_EXT"/rlwrap -rc -b "(){}[],+= & ^%$#@"";|\\" -f "$HDI_APPROOT"/scripts/xsct/xsdb/cmdlist -H "$LOG_FILE" "$RDI_BINROOT"/loader -exec rdi_xsct "${RDI_ARGS[@]}" +``` + +Çözüm: `rlwrap` olan + +--- + +Create hardware platform GUI açılmıyor, + +Çözüm: `apt install gnome-icon-theme` + + diff --git a/xilinx/vivado-vitis-sdk/2022.1/ebox-vivado b/xilinx/vivado-vitis-sdk/2022.1/ebox-vivado new file mode 100644 index 0000000..9381504 --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/ebox-vivado @@ -0,0 +1,30 @@ +#!/bin/bash + +# ------------------------------------------------------------------------------ +# MIT License +# +# Copyright (c) 2025 The EBox Authors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# ------------------------------------------------------------------------------ + +# /usr/local/bin/x - Wrapper script for the original 'x' + +# Set LD_PRELOAD just for the execution of the 'x' program +LD_PRELOAD=/lib/x86_64-linux-gnu/libudev.so.1 /opt/Xilinx/Vivado/2022.1/bin/vivado "$@" diff --git a/xilinx/vivado-vitis-sdk/2022.1/ebox.sh b/xilinx/vivado-vitis-sdk/2022.1/ebox.sh new file mode 100644 index 0000000..8415171 --- /dev/null +++ b/xilinx/vivado-vitis-sdk/2022.1/ebox.sh @@ -0,0 +1,40 @@ +# ------------------------------------------------------------------------------ +# MIT License +# +# Copyright (c) 2025 The EBox Authors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# ------------------------------------------------------------------------------ + +# Usage: source this_script.sh /your/path/to/prepend + +# Check if a path was passed as an argument +if [ -z "$1" ]; then + echo "Usage: source $BASH_SOURCE " + return 1 +fi + +X="$1" + +# Normalize the path +X="$(realpath -m "$X")" + +# Prepend X to PATH +export PATH="$X:$PATH" +echo "Prepended $X to PATH" diff --git a/xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh b/xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh index ec283b2..959f79a 100644 --- a/xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh +++ b/xilinx/vivado-vitis-sdk/2022.1/entrypoint.sh @@ -53,6 +53,7 @@ if [ -z "$USER_ID" ] || [ -z "$GROUP_ID" ]; then if [[ "$EBOX_MODIFY_PATH" != "false" ]]; then # Avoid duplicate bashrc entries grep -qxF 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' "$HOME/.bashrc" || echo 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' >> "$HOME/.bashrc" + grep -qxF 'source /opt/EBox/ebox.sh /opt/EBox/bin' "$HOME/.bashrc" || echo 'source /opt/EBox/ebox.sh /opt/EBox/bin' >> "$HOME/.bashrc" else echo "Skipping PATH modification" fi @@ -84,6 +85,7 @@ HOME_DIR=$(getent passwd "$USER_ID" | cut -d: -f6) # Avoid duplicate bashrc entries grep -qxF 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' "$HOME_DIR/.bashrc" || echo 'source /opt/Xilinx/Vivado/2022.1/settings64.sh' >> "$HOME_DIR/.bashrc" +grep -qxF 'source /opt/EBox/ebox.sh /opt/EBox/bin' "$HOME_DIR/.bashrc" || echo 'source /opt/EBox/ebox.sh /opt/EBox/bin' >> "$HOME_DIR/.bashrc" # Setup workspace if [ ! -d "$WS_PATH" ]; then