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

Commit 0d6c8bb

Browse files
authored
Merge pull request #117 from pycom/idf_ver_check
check IDF git hash
2 parents 684d948 + 36d934d commit 0d6c8bb

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
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=d072c55
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: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
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_HASH=$2
12+
IDF_PATH=$1
13+
CURR_HASH=$(git -c core.abbrev=7 --git-dir=$IDF_PATH/.git rev-parse --short HEAD)
1314

14-
if [ "${CURR_VER}" = "${IDF_VER}" ]; then
15-
echo "IDF Version OK!"
15+
if [ "${CURR_HASH}" = "${IDF_HASH}" ]; then
16+
echo "IDF Version OK! $IDF_HASH"
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
21-
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
19+
echo "
20+
Incompatible IDF git hash:
21+
22+
$IDF_HASH is expected from IDF_HASH from Makefile, but
23+
$CURR_HASH is what IDF_PATH=$IDF_PATH is pointing at.
24+
25+
You should probably update one (or multiple) of:
26+
* IDF_PATH environment variable
27+
* IDF_HASH variable in esp32/Makefile
28+
* IDF commit, e.g.
29+
cd \$IDF_PATH && git checkout $IDF_HASH && git submodule sync && git submodule update --init --recursive && cd -
30+
31+
"
32+
exit 1
33+
fi

0 commit comments

Comments
 (0)