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

Fix buildroot when launched from install script #1229

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion bin/regression-wally
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tests = [

# Separate test for short buildroot run through OpenSBI UART output
tests_buildrootshort = [
["buildroot", ["buildroot"], [f"+INSTR_LIMIT=1400000"], # Instruction limit gets to first OpenSBI UART output
["buildroot", ["buildroot"], [f"+INSTR_LIMIT=1600000"], # Instruction limit gets to first OpenSBI UART output
"OpenSBI v", "buildroot_uart.out"]
]

Expand Down
4 changes: 3 additions & 1 deletion bin/wally-tool-chain-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ fi

# Determine script directory to locate related scripts
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WALLY=$(dirname "$dir")
export WALLY

# Get Linux distro and version
source "${dir}"/wally-distro-check.sh
Expand Down Expand Up @@ -471,7 +473,7 @@ if [ ! "$no_buidroot" ]; then
fi
cd "$dir"/../linux
if [ ! -e "$RISCV"/buildroot ]; then
make 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]
FORCE_UNSAFE_CONFIGURE=1 make 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] # FORCE_UNSAFE_CONFIGURE is needed to allow buildroot to compile when run as root
echo -e "${SUCCESS_COLOR}Buildroot successfully installed and Linux testvectors created!${ENDC}"
elif [ ! -e "$RISCV"/linux-testvectors ]; then
echo -e "${OK_COLOR}Buildroot already exists, but Linux testvectors are missing. Generating them now.${ENDC}"
Expand Down
5 changes: 4 additions & 1 deletion linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name).objdump)

all: check_environment check_write_permissions clean download Image disassemble install dumptvs

check_environment: $(RISCV)
check_environment: $(RISCV) $(WALLY)
ifeq ($(findstring :$(RISCV)/lib:,:$(LD_LIBRARY_PATH):),)
@(echo "ERROR: Your environment variables are not set correctly." >&2 \
&& echo "Make sure to source setup.sh or install buildroot using the wally-tool-chain-install.sh script." >&2 \
Expand Down Expand Up @@ -66,6 +66,9 @@ $(RISCV):
@ echo "ERROR: No $(RISCV) directory. Make sure you have installed the Wally Toolchain."
@ echo "and sourced setup.sh"

$(WALLY):
@ echo "ERROR: $$WALLY is not set. Make sure you have sourced setup.sh"

# Disassembly rules ---------------------------------------------------
disassemble: check_environment
rm -rf $(BUILDROOT)/output/images/disassembly
Expand Down