Skip to content

Commit 57fb821

Browse files
authored
Merge pull request #85 from mithro/small-linux-fixes
Fixes for Linux build
2 parents b676c11 + 21b82e2 commit 57fb821

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/build-linux.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fi
3030
eval $(make env)
3131
make info
3232

33-
set -x
33+
#set -x
3434
set -e
3535

3636
if [ "$CPU" != or1k -a "$CPU" != "vexriscv" ]; then
@@ -67,7 +67,7 @@ LINUX_BRANCH=${LINUX_BRANCH:-master-litex}
6767
cd $(dirname $LINUX_SRC)
6868
echo "Downloading Linux source tree."
6969
echo "If you already have a local git checkout you can set 'LINUX_GITLOCAL' to speed up this step."
70-
git clone $LINUX_CLONE_FROM $LINUX_SRC
70+
git clone $LINUX_CLONE_FROM $LINUX_SRC --branch $LINUX_BRANCH
7171
)
7272
fi
7373

@@ -86,8 +86,11 @@ LINUX_BRANCH=${LINUX_BRANCH:-master-litex}
8686

8787
# Checkout or1k-linux branch it not already on it
8888
if [ "$(git rev-parse --abbrev-ref HEAD)" != "$LINUX_BRANCH" ]; then
89-
git checkout $LINUX_BRANCH || \
89+
if git rev-parse --abbrev-ref $LINUX_BRANCH > /dev/null 2>&1; then
90+
git checkout $LINUX_BRANCH
91+
else
9092
git checkout "$CURRENT_LINUX_REMOTE_NAME/$LINUX_BRANCH" -b $LINUX_BRANCH
93+
fi
9194
fi
9295
)
9396

0 commit comments

Comments
 (0)