Skip to content

Commit 1da5ddc

Browse files
committed
u-boot/tools: allow passing u-boot commit to builder
1 parent 1516af1 commit 1da5ddc

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

u-boot/tools/build

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
# keep detailed records of where the code came from.
55

66
TARGET_ARCH=$1
7+
BOARD=$2
8+
COMMIT=$3
79

810
if [ ! -n "$TARGET_ARCH" ]; then
9-
echo "Usage: $0 <arch> [board]"
11+
echo "Usage: $0 <arch> [board] [commit]"
1012
exit 1
1113
fi
1214

@@ -50,17 +52,28 @@ echo "Beginning $TARGET_ARCH build with $CROSS_TOOL_VERSION..."
5052
TMP="/tmp/$TARGET_ARCH-build"
5153
GIT_REPO="git://git.denx.de/u-boot.git"
5254

53-
echo "Cloning sources..."
54-
git clone $GIT_REPO $TMP
55+
if ! [ -d "$TMP" ]; then
56+
echo "Cloning sources..."
57+
git clone $GIT_REPO $TMP
58+
else
59+
echo "Pulling updates..."
60+
# hint: Might want to comment this out if you're git blameing on u-boot in $TMP
61+
git -C $TMP pull --rebase
62+
fi
63+
64+
if [ $# -ge 2 ]; then
65+
echo "Checking out u-boot $COMMIT"
66+
git -C $TMP checkout $COMMIT
67+
fi
5568

5669
echo "Calculating dates..."
5770
GIT_DATE=$(git -C $TMP log -1 --format=%cd)
5871
GIT_HASH=$(git -C $TMP log -1 --format=%H)
5972

6073
echo "Locating work..."
6174
WORK_QUEUE=$(find $TARGET_ARCH/ -mindepth 1 -type d)
62-
if [ $# -eq 2 ]; then
63-
WORK_QUEUE="$TARGET_ARCH/$2"
75+
if [ $# -ge 2 ]; then
76+
WORK_QUEUE="$TARGET_ARCH/$BOARD"
6477
fi
6578

6679
for dir in $WORK_QUEUE; do

0 commit comments

Comments
 (0)