summaryrefslogtreecommitdiff
path: root/check-bisect.sh
blob: 81a29d188f8f60b92b022aeaecf24bc653087775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

TOOLS_DIR="`dirname $0`"
TOOLS_DIR="`readlink -f \"$TOOLS_DIR\"`"

REPO_DIR=../edk2-platforms
GIT="git -C $REPO_DIR"

START_HASH=`$GIT rev-parse HEAD`
STOP_HASH=`$GIT rev-parse origin/master`

$GIT merge-base --is-ancestor $STOP_HASH $START_HASH 2>/dev/null
if [ $? -eq 0 ]; then
    echo "$STOP_HASH is an ancestor - proceeding."
else
    echo "$STOP_HASH is not an ancestor - aborting!" >&2
    exit 1
fi

PLATFORMS=$*

echo $PLATFORMS

while [ `$GIT rev-parse HEAD` != $STOP_HASH ]; do
    $TOOLS_DIR/edk2-build.sh --strict -e ../edk2 -p ../edk2-platforms -n ../edk2-non-osi -b DEBUG -b RELEASE $PLATFORMS
    if [ $? -ne 0 ]; then
	echo "`$GIT rev-parse HEAD` failed to build" >&2
	exit 2
    fi
    $GIT reset --hard HEAD^
done

echo "SUCCESS: all commits from"
echo "  $START_HASH to"
echo "  $STOP_HASH"
echo "built successfully for $PLATFORMS!"