From dedb25f55abed97eb274403b3d2bc809fc0a80d2 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sat, 31 May 2025 02:53:11 -0700 Subject: [PATCH] Fix flags for real --- bin/installation/elf2hex-install.sh | 2 +- bin/installation/qemu-install.sh | 2 +- bin/installation/riscv-gnu-toolchain-install.sh | 2 +- bin/installation/sail-install.sh | 2 +- bin/installation/spike-install.sh | 2 +- bin/installation/verilator-install.sh | 3 +-- bin/wally-environment-check.sh | 14 +++++++++----- bin/wally-tool-chain-install.sh | 2 +- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/bin/installation/elf2hex-install.sh b/bin/installation/elf2hex-install.sh index 7e0e2690e..23b890732 100755 --- a/bin/installation/elf2hex-install.sh +++ b/bin/installation/elf2hex-install.sh @@ -55,7 +55,7 @@ if check_tool_version $ELF2HEX_VERSION; then ./configure --target=riscv64-unknown-elf --prefix="$RISCV" make 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] - if [ "$clean" ]; then + if [ "$clean" = true ]; then cd "$RISCV" rm -rf elf2hex fi diff --git a/bin/installation/qemu-install.sh b/bin/installation/qemu-install.sh index 5d16a8dd2..5e2248548 100755 --- a/bin/installation/qemu-install.sh +++ b/bin/installation/qemu-install.sh @@ -49,7 +49,7 @@ if check_tool_version $QEMU_VERSION; then ./configure --target-list=riscv64-softmmu --prefix="$RISCV" make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] - if [ "$clean" ]; then + if [ "$clean" = true ]; then cd "$RISCV" rm -rf qemu fi diff --git a/bin/installation/riscv-gnu-toolchain-install.sh b/bin/installation/riscv-gnu-toolchain-install.sh index c5dcf6a2b..fd3d7963c 100755 --- a/bin/installation/riscv-gnu-toolchain-install.sh +++ b/bin/installation/riscv-gnu-toolchain-install.sh @@ -52,7 +52,7 @@ if check_tool_version $RISCV_GNU_TOOLCHAIN_VERSION; then cd "$RISCV"/riscv-gnu-toolchain ./configure --prefix="${RISCV}" --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;" make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] - if [ "$clean" ]; then + if [ "$clean" = true ]; then cd "$RISCV" rm -rf riscv-gnu-toolchain fi diff --git a/bin/installation/sail-install.sh b/bin/installation/sail-install.sh index 39ec4d016..8b8a0d79c 100755 --- a/bin/installation/sail-install.sh +++ b/bin/installation/sail-install.sh @@ -91,7 +91,7 @@ if check_tool_version $RISCV_SAIL_MODEL_VERSION; then cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="$RISCV" -DDOWNLOAD_GMP="$DOWNLOAD_GMP" -GNinja 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] cmake --build build 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] cmake --install build 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] - if [ "$clean" ]; then + if [ "$clean" = true ]; then cd "$RISCV" rm -rf sail-riscv fi diff --git a/bin/installation/spike-install.sh b/bin/installation/spike-install.sh index 9ae538318..0fc3a9ba9 100755 --- a/bin/installation/spike-install.sh +++ b/bin/installation/spike-install.sh @@ -51,7 +51,7 @@ if check_tool_version $SPIKE_VERSION; then ../configure --prefix="$RISCV" make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] - if [ "$clean" ]; then + if [ "$clean" = true ]; then cd "$RISCV" rm -rf riscv-isa-sim fi diff --git a/bin/installation/verilator-install.sh b/bin/installation/verilator-install.sh index 504b2a3ee..728ee20b9 100755 --- a/bin/installation/verilator-install.sh +++ b/bin/installation/verilator-install.sh @@ -68,7 +68,7 @@ if check_tool_version $VERILATOR_VERSION; then ./configure --prefix="$RISCV" make -j "${NUM_THREADS}" 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] make install 2>&1 | logger; [ "${PIPESTATUS[0]}" == 0 ] - if [ "$clean" ]; then + if [ "$clean" = true ]; then cd "$RISCV" rm -rf verilator fi @@ -77,4 +77,3 @@ if check_tool_version $VERILATOR_VERSION; then else echo -e "${SUCCESS_COLOR}Verilator already up to date.${ENDC}" fi - diff --git a/bin/wally-environment-check.sh b/bin/wally-environment-check.sh index 7d8db0223..5ff030b8d 100755 --- a/bin/wally-environment-check.sh +++ b/bin/wally-environment-check.sh @@ -39,6 +39,11 @@ WARNING_COLOR='\033[93m' FAIL_COLOR='\033[91m' ENDC='\033[0m' # Reset to default color +if [ -z "$WALLY" ]; then + dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + WALLY="$(dirname "$dir")" + export WALLY +fi ### Common functions and error handling ### source "$WALLY"/bin/installation/wally-installation-helper-functions.sh @@ -134,13 +139,12 @@ fi ### Configure installation ### # Check flags -# 0 = true, 1 = false for bash -clean=1 -no_buidroot=1 +clean=false +no_buildroot=false while [[ "$#" -gt 0 ]]; do case $1 in - -c|--clean) clean=0 ;; - --no-buildroot) no_buidroot=0 ;; + -c|--clean) clean=true ;; + --no-buildroot) no_buildroot=true ;; --no-args) ;; # Ignore this flag, workaround for sourcing this script in other scripts -h|--help) echo -e "Usage: $0 [\$RISCV] [options]" diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 50ffc4ab8..812d957d4 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -119,7 +119,7 @@ source "$WALLY"/bin/installation/skywater-lib-install.sh # Buildroot and Linux testvectors # Buildroot is used to boot a minimal version of Linux on Wally. # Testvectors are generated using QEMU. -if [ "$no_buidroot" ]; then +if [ "$no_buildroot" = true ]; then echo -e "${OK_COLOR}Skipping Buildroot and Linux testvectors.${ENDC}" else source "$WALLY"/bin/installation/buildroot-install.sh