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

Improve Renode scripts #324

Merged
merged 2 commits into from
Feb 26, 2020
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
69 changes: 37 additions & 32 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,44 +74,49 @@ else
exit 1
fi

# Get linux-litex is needed
LINUX_SRC="$TOP_DIR/third_party/linux"
LINUX_LOCAL="$LINUX_GITLOCAL" # Local place to clone from
LINUX_REMOTE_BIT=$(echo $LINUX_REMOTE | sed -e's-^.*://--' -e's/.git$//')
LINUX_CLONE_FROM="${LINUX_LOCAL:-$LINUX_REMOTE}"
(
# Download the Linux source for the first time
if [ ! -d "$LINUX_SRC" ]; then
if [ ${CPU} = vexriscv ] && [ ${BUILD_BUILDROOT} = 1 ]; then
# do not download linux sources, buildroot comes with its own copy
:
else
# Get linux-litex is needed
LINUX_SRC="$TOP_DIR/third_party/linux"
LINUX_LOCAL="$LINUX_GITLOCAL" # Local place to clone from
LINUX_REMOTE_BIT=$(echo $LINUX_REMOTE | sed -e's-^.*://--' -e's/.git$//')
LINUX_CLONE_FROM="${LINUX_LOCAL:-$LINUX_REMOTE}"
(
cd $(dirname $LINUX_SRC)
echo "Downloading Linux source tree."
echo "If you already have a local git checkout you can set 'LINUX_GITLOCAL' to speed up this step."
git clone $LINUX_CLONE_FROM $LINUX_SRC --branch $LINUX_BRANCH
)
fi
# Download the Linux source for the first time
if [ ! -d "$LINUX_SRC" ]; then
(
cd $(dirname $LINUX_SRC)
echo "Downloading Linux source tree."
echo "If you already have a local git checkout you can set 'LINUX_GITLOCAL' to speed up this step."
git clone $LINUX_CLONE_FROM $LINUX_SRC --branch $LINUX_BRANCH
)
fi

# Change into the dir
cd $LINUX_SRC
# Change into the dir
cd $LINUX_SRC

# Add the remote if it doesn't exist
CURRENT_LINUX_REMOTE_NAME=$(git remote -v | grep fetch | grep "$LINUX_REMOTE_BIT" | sed -e's/\t.*$//')
if [ x"$CURRENT_LINUX_REMOTE_NAME" = x ]; then
git remote add $LINUX_REMOTE_NAME $LINUX_REMOTE
CURRENT_LINUX_REMOTE_NAME=$LINUX_REMOTE_NAME
fi
# Add the remote if it doesn't exist
CURRENT_LINUX_REMOTE_NAME=$(git remote -v | grep fetch | grep "$LINUX_REMOTE_BIT" | sed -e's/\t.*$//')
if [ x"$CURRENT_LINUX_REMOTE_NAME" = x ]; then
git remote add $LINUX_REMOTE_NAME $LINUX_REMOTE
CURRENT_LINUX_REMOTE_NAME=$LINUX_REMOTE_NAME
fi

# Get any new data
git fetch $CURRENT_LINUX_REMOTE_NAME
# Get any new data
git fetch $CURRENT_LINUX_REMOTE_NAME

# Checkout or1k-linux branch it not already on it
if [ "$(git rev-parse --abbrev-ref HEAD)" != "$LINUX_BRANCH" ]; then
if git rev-parse --abbrev-ref $LINUX_BRANCH > /dev/null 2>&1; then
git checkout $LINUX_BRANCH
else
git checkout "$CURRENT_LINUX_REMOTE_NAME/$LINUX_BRANCH" -b $LINUX_BRANCH
# Checkout or1k-linux branch it not already on it
if [ "$(git rev-parse --abbrev-ref HEAD)" != "$LINUX_BRANCH" ]; then
if git rev-parse --abbrev-ref $LINUX_BRANCH > /dev/null 2>&1; then
git checkout $LINUX_BRANCH
else
git checkout "$CURRENT_LINUX_REMOTE_NAME/$LINUX_BRANCH" -b $LINUX_BRANCH
fi
fi
fi
)
)
fi

# Get litex-devicetree
LITEX_DT_SRC="$TOP_DIR/third_party/litex-devicetree"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-renode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi

if ! $RENODE_FOUND; then
# Download prebuilt renode Release if none is currently installed
conda install -c antmicro -c conda-forge renode
conda install -c antmicro -c conda-forge renode=$RENODE_VERSION
RENODE_BIN=$CONDA_PREFIX/bin/renode
fi

Expand Down
1 change: 1 addition & 0 deletions scripts/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BINUTILS_VERSION=2.32
GCC_VERSION=9.1.0
SDCC_VERSION=3.5.0
OPENOCD_VERSION=0.10.0
RENODE_VERSION=v1.8.2

# Other tools versions
ZEPHYR_SDK_VERSION=0.11.1
Expand Down