Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 5b5b0d9

Browse files
committed
check IDF git hash
instead of merely looking for the IDF git branch name, check the actual commit hash secondly, stop automatically switching the IDF working copy. Simply check and fail if it is not the expected hash
1 parent 684d948 commit 5b5b0d9

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

esp32/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ifeq ($(wildcard boards/$(BOARD)/.),)
1414
$(error Invalid BOARD specified)
1515
endif
1616

17-
IDF_VERSION=3.3.1
17+
IDF_HASH=d072c551c360e95b36814acd07a2ecd60ec7362c
1818

1919
TARGET ?= boot_app
2020

esp32/application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ $(OBJ): | $(GEN_PINS_HDR)
820820

821821
# Check Dependencies (IDF version, Frozen code and IDF LIBS)
822822
CHECK_DEP:
823-
$(Q) bash tools/idfVerCheck.sh $(IDF_PATH) "$(IDF_VERSION)"
823+
$(Q) bash tools/idfVerCheck.sh $(IDF_PATH) "$(IDF_HASH)"
824824
$(Q) bash tools/mpy-build-check.sh $(BOARD) $(BTYPE) $(VARIANT)
825825
$(Q) $(PYTHON) check_secure_boot.py --SECURE $(SECURE)
826826
ifeq ($(COPY_IDF_LIB), 1)

esp32/tools/idfVerCheck.sh

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,14 @@
88
# available at https://www.pycom.io/opensource/licensing
99
#
1010

11-
IDF_VER="idf_v"$2
12-
CURR_VER="$(git --git-dir=$1/.git branch | grep \* | cut -d ' ' -f2)"
11+
IDF_VER=$2
12+
IDF_PATH=$1
13+
CURR_VER=$(git --git-dir=$IDF_PATH/.git rev-parse HEAD)
1314

1415
if [ "${CURR_VER}" = "${IDF_VER}" ]; then
1516
echo "IDF Version OK!"
1617
exit 0
1718
else
18-
echo "Incompatible IDF version...Checking out IDF version $2!"
19-
if ! git --git-dir=$1/.git --work-tree=$1 checkout ${IDF_VER} ; then
20-
echo "Cannot checkout IDF version ${IDF_VER}!...Please make sure latest idf_v${IDF_VER} branch is fetched" >&2
19+
echo "Incompatible IDF version... Expected $IDF_VER, but $IDF_PATH is pointing at $CURR_VER"
2120
exit 1
22-
fi
23-
cd ${IDF_PATH}
24-
if ! git submodule sync ; then
25-
echo "Cannot checkout IDF version ${IDF_VER}!...Please make sure latest idf_v${IDF_VER} branch is fetched" >&2
26-
exit 1
27-
fi
28-
if ! git submodule update --init ; then
29-
echo "Cannot checkout IDF version ${IDF_VER}!...Please make sure latest idf_v${IDF_VER} branch is fetched" >&2
30-
exit 1
31-
fi
32-
exit 0
33-
fi
21+
fi

0 commit comments

Comments
 (0)