Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolchains installation scripts: use local path for temporary directory #119

Merged
merged 1 commit into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions utils/toolchain/build_leon3_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export SYSROOT=${ESP_ROOT}/soft/leon3/sysroot
BUILDROOT_SHA=d6fa6a45e196665d6607b522f290b1451b949c2c

DEFAULT_TARGET_DIR="/opt/leon"
TMP=/tmp/_leon3_build
TMP=${ESP_ROOT}/_leon3_build

# Prebuilt from Cobham Gaisler
SRC_MIRROR="https://espdev.cs.columbia.edu/stuff/leon3"
Expand Down Expand Up @@ -103,8 +103,10 @@ fi
cmd="chown $USER:$(id -gn) ${TARGET_DIR}"
runsudo ${TARGET_DIR} "$cmd"

# Create temporary folder
mkdir -p $TMP
# Remove and create temporary folder
cmd="rm -rf $TMP"
runsudo ${TARGET_DIR} "$cmd"
mkdir $TMP
cd $TMP

# Bare-metal compiler
Expand Down Expand Up @@ -246,14 +248,16 @@ if [ $(noyes "Skip buildroot?") == "n" ]; then
cd $TMP
fi

# Remove temporary folder
cmd="rm -rf $TMP"
runsudo ${TARGET_DIR} "$cmd"

#Leon
echo ""
echo ""
echo "=== Use the following to load LEON environment ==="
echo -n " export PATH=${LEON}/bin:"; echo '$PATH'
echo ""

cd $CURRENT_DIR

echo "*** Successfully installed LEON toolchain to $TARGET_DIR ***"

15 changes: 9 additions & 6 deletions utils/toolchain/build_riscv32imc_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ESP_ROOT=$(realpath ${SCRIPT_PATH}/../..)
RISCV_GNU_TOOLCHAIN_SHA=afcc8bc655d30cf6af054ac1d3f5f89d0627aa79

DEFAULT_TARGET_DIR="/opt/riscv32imc"
TMP=/tmp/_riscv32imc_build
TMP=${ESP_ROOT}/_riscv32imc_build

# Helper functions
yesno () {
Expand Down Expand Up @@ -80,8 +80,10 @@ if test ! -e ${TARGET_DIR}; then
runsudo $pdir "$cmd"
fi

# Create temporary folder
mkdir -p $TMP
# Remove and create temporary folder
cmd="rm -rf $TMP"
runsudo ${TARGET_DIR} "$cmd"
mkdir $TMP
cd $TMP

# Bare-metal compiler
Expand All @@ -103,9 +105,12 @@ if [ $(noyes "Skip ${src}") == "n" ]; then
runsudo ${TARGET_DIR} "$cmd"

fi
cd $TMP


# Remove temporary folder
cmd="rm -rf $TMP"
runsudo ${TARGET_DIR} "$cmd"

#Riscv
echo ""
echo ""
Expand All @@ -114,6 +119,4 @@ echo -n " export PATH=${RISCV}/bin:"; echo '$PATH'
echo " export RISCV=${RISCV}"
echo ""

cd $CURRENT_DIR

echo "*** Successfully installed RISC-V (rv32imc) toolchain to $TARGET_DIR ***"
14 changes: 9 additions & 5 deletions utils/toolchain/build_riscv_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RISCV_GNU_TOOLCHAIN_SHA=afcc8bc655d30cf6af054ac1d3f5f89d0627aa79
BUILDROOT_SHA=d6fa6a45e196665d6607b522f290b1451b949c2c

DEFAULT_TARGET_DIR="/opt/riscv"
TMP=/tmp/_riscv_build
TMP=${ESP_ROOT}/_riscv_build

# Helper functions
yesno () {
Expand Down Expand Up @@ -93,8 +93,10 @@ if test ! -e ${TARGET_DIR}; then
runsudo $pdir "$cmd"
fi

# Create temporary folder
mkdir -p $TMP
# Remove and create temporary folder
cmd="rm -rf $TMP"
runsudo ${TARGET_DIR} "$cmd"
mkdir $TMP
cd $TMP

# Bare-metal compiler
Expand Down Expand Up @@ -175,6 +177,10 @@ if [ $(noyes "Skip buildroot?") == "n" ]; then
cd $TMP
fi

# Remove temporary folder
cmd="rm -rf $TMP"
runsudo ${TARGET_DIR} "$cmd"

#Riscv
echo ""
echo ""
Expand All @@ -183,6 +189,4 @@ echo -n " export PATH=${RISCV}/bin:"; echo '$PATH'
echo " export RISCV=${RISCV}"
echo ""

cd $CURRENT_DIR

echo "*** Successfully installed RISC-V toolchain to $TARGET_DIR ***"