Skip to content
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
18 changes: 16 additions & 2 deletions tools/cargo_test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

# for hvisor's unit test when running cargo test
# passed to .cargo/config
# runner = "___HVISOR_SRC___/_cargo_test.sh"
Expand Down Expand Up @@ -34,6 +36,18 @@ info() {
echo "[INFO | $THIS] $1"
}

# check if mkimage is installed
if ! command -v mkimage &>/dev/null; then
if command -v apt &>/dev/null; then
sudo apt update && sudo apt install -y u-boot-tools
elif command -v brew &>/dev/null; then
brew install u-boot-tools
else
info "You need to install u-boot-tools to run this script (mkimage)"
exit 1
fi
fi

info "Running cargo test with env: ARCH=$ARCH, FEATURES=$FEATURES, BOARD=$BOARD"

info "Building hvisor with $CARGO_BUILD_INPUT_ARG0"
Expand Down Expand Up @@ -66,7 +80,7 @@ if [ "$ARCH" == "aarch64" ]; then
-semihosting \
-bios $UBOOT \
-drive if=pflash,format=raw,index=1,file=flash.img \
-device loader,file=$HVISOR_BIN,addr=0x40400000,force-raw=on
-device loader,file=$HVISOR_BIN,addr=0x40400000,force-raw=on

mv .cargo/config.bak .cargo/config
exit 0
Expand All @@ -78,4 +92,4 @@ else
info "Unsupported ARCH: $ARCH"
mv .cargo/config.bak .cargo/config
exit 1
fi
fi
2 changes: 2 additions & 0 deletions tools/compress.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

# first find hvisor src dir by searching for README.md
# find in current dir and parent dir
HVISOR_SRC_DIR=.
Expand Down
2 changes: 2 additions & 0 deletions tools/extract.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

# first find hvisor src dir by searching for README.md
# find in current dir and parent dir
HVISOR_SRC_DIR=.
Expand Down