我使用 Ubuntu 18.04,并使用 petalinux、Vivado 等软件。例如,每次我想打开 vivado 时,我都会打开终端并输入:
source /opt/XIlinx/Vivado/2020.2/settings64.sh
这仅适用于该特定终端。
我知道如果我编辑 .profile 文件,我可以使其变得多余。所以我添加这一行:
export PATH="$PATH:/opt/XIlinx/Vivado/2020.2/settings64.sh"
注销,登录,但如果不获取 settings64.sh 文件,我仍然无法打开 vivado。我究竟做错了什么?
这是 petalinux 源文件 - settings.sh:
#
# Setup script for PetaLinux development environment.
#
# Copyright (c) 1995-2013 Xilinx, Inc. All rights reserved.
#
SETTINGS_FILE='settings.sh'
# The right location will be replaced by the installer
XIL_SCRIPT_LOC="./"
if [ $# != 0 ]; then
# The first argument is the location of PetaLinux Installation
# Don't detect the installation location
XIL_SCRIPT_LOC="$1"
else
# XIL_SCRIPT_LOC should point to script location
if [ "$0" == "ksh" ]; then
XIL_SCRIPT_LOC_TMP_UNI=`readlink -f ${XIL_ARG_}`
else
XIL_SCRIPT_LOC_TMP_UNI=$BASH_SOURCE
fi
XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC_TMP_UNI%/*}
if [ "$XIL_SCRIPT_LOC_TMP_UNI" != "" ]; then
if [ "$XIL_SCRIPT_LOC_TMP_UNI" == "settings.sh" ]; then
XIL_SCRIPT_LOC_TMP_UNI="./"
fi
XIL_SCRIPT_LOC_TMP_UNI=`readlink -f ${XIL_SCRIPT_LOC_TMP_UNI}`
if [ $? == 0 ]; then
XIL_SCRIPT_LOC=${XIL_SCRIPT_LOC_TMP_UNI}
fi
fi
unset XIL_SCRIPT_LOC_TMP_UNI
fi
export PETALINUX=`readlink -f "${XIL_SCRIPT_LOC}"`
if echo "${PETALINUX}" | grep -q ' '; then
echo "********************************************************"
echo "WARNING: PetaLinux SDK installation path contains spaces"
echo "WARNING: You are STRONGLY recommend to fix this".
echo "********************************************************"
fi
export PETALINUX_VER=2020.2
export XSCT_TOOLCHAIN="${PETALINUX}/tools/xsct"
# Figure out host system architecture
# for now, only linux-i386 supported
#
# Add toolchains to user's search path
#
PATH="${XSCT_TOOLCHAIN}/gnu/aarch32/lin/gcc-arm-none-eabi/bin:${PATH}"
PATH="${XSCT_TOOLCHAIN}/gnu/aarch64/lin/aarch64-none/bin:${PATH}"
PATH="${XSCT_TOOLCHAIN}/gnu/armr5/lin/gcc-arm-none-eabi/bin:${PATH}"
PATH="${XSCT_TOOLCHAIN}/gnu/microblaze/lin/bin:${PATH}"
#
# Add required binary tools to the user's search path
#
PATH="${PETALINUX}/tools/xsct/petalinux/bin:${PETALINUX}/tools/common/petalinux/bin:${PATH}"
#
# Check for "." or ".\" in the path - it's broken
#
echo "${PATH}" | tr ":" "\n" | grep '^\./*$' > /dev/null &&
echo "WARNING: '.' detected in PATH - fixing it." 1>&2
PATH=`echo ${PATH} | tr ":" "\n" | grep -v '^\./*$' | tr "\n" ":"`
# Strip any trailing or multi-colons - they are interpreted as '.'
PATH=$(echo ${PATH} | sed -e 's/:*$//g' -e 's/::*/:/g')
export PATH
echo PetaLinux environment set to \'${PETALINUX}\'
for s in /bin/sh sh; do
if ! $s --version 2>/dev/null | grep -q "^GNU bash"; then
echo "WARNING: $s is not bash! "
echo "bash is PetaLinux recommended shell. Please set your default shell to bash."
break
fi
done
if ! echo $SHELL | grep -q "bash"; then
echo "WARNING: $SHELL is not bash! "
echo "/bin/bash is Petalinux recommended SHELL variable. Please set your SHELL variable to /bin/bash."
fi
"${PETALINUX}"/tools/common/petalinux//utils/petalinux-env-check