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

Commit 271d709

Browse files
authored
Put script file with name script_8MB into package regardless of small or normal factory fw mode (#233)
1 parent 3825b84 commit 271d709

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

esp32/tools/makepkg.sh

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ BOARD=$(echo $1)
1010

1111
FACTORY_BIN_DIR="$(pwd)/factory_fw/binary"
1212

13-
14-
if [ $5 -eq 1 ]; then
15-
PART_FILE_8MB='partitions_8MB_small_factory_fw.bin_enc'
16-
SCRIPT_FILE_8MB='script_8MB_small_factory_fw_enc'
17-
else
18-
PART_FILE_8MB='partitions_8MB_normal_factory_fw.bin_enc'
19-
SCRIPT_FILE_8MB='script_8MB_normal_factory_fw_enc'
20-
fi
21-
2213
if [ $4 -eq 1 ]; then
2314
SCRIPT_NAME_4MB="script_4MB_enc"
2415
if [ $5 -eq 1 ]; then
@@ -66,10 +57,8 @@ VERSION=$(cat pycom_version.h |grep SW_VERSION_NUMBER | cut -d'"' -f2)
6657
PKG_TMP_DIR="${BUILD_DIR}/firmware_package"
6758
mkdir -p ${PKG_TMP_DIR}
6859

69-
PART_FILE_4MB=''
7060
PART_FILE_8MB=''
71-
SCRIPT_FILE_4MB=''
72-
SCRIPT_FILE_8MB=''
61+
SCRIPT_FILE_8MB='script_8MB'
7362

7463
if [ $4 -eq 1 ]; then
7564
BOOT_FILE='bootloader-reflash-digest.bin_enc'
@@ -93,28 +82,24 @@ cp ${BUILD_DIR}/${APP_FILE} ${PKG_TMP_DIR}
9382
if [ $4 -eq 1 ]; then
9483
if [ $5 -eq 1 ]; then
9584
PART_FILE_8MB='partitions_8MB_small_factory_fw.bin_enc'
96-
SCRIPT_FILE_8MB='script_8MB_small_factory_fw_enc'
9785
else
9886
PART_FILE_8MB='partitions_8MB_normal_factory_fw.bin_enc'
99-
SCRIPT_FILE_8MB='script_8MB_normal_factory_fw_enc'
10087
fi
10188
else
10289
if [ $5 -eq 1 ]; then
10390
PART_FILE_8MB='partitions_8MB_small_factory_fw.bin'
104-
SCRIPT_FILE_8MB='script_8MB_small_factory_fw'
10591
else
10692
PART_FILE_8MB='partitions_8MB_normal_factory_fw.bin'
107-
SCRIPT_FILE_8MB='script_8MB_normal_factory_fw'
10893
fi
10994
fi
11095

11196
cp ${BUILD_DIR}/lib/${PART_FILE_8MB} ${PKG_TMP_DIR}
11297
if [ $5 -eq 1 ]; then
11398
cp ${FACTORY_BIN_DIR}/${FACTORY_FILE} ${PKG_TMP_DIR}
11499
fi
115-
cat boards/$1/${SCRIPT_FILE_8MB} > ${PKG_TMP_DIR}/${SCRIPT_FILE_8MB} || { echo >&2 "Cannot create ${SCRIPT_FILE_8MB} file! Aborting."; exit 1; }
100+
cat boards/$1/${SCRIPT_NAME_8MB} > ${PKG_TMP_DIR}/${SCRIPT_FILE_8MB} || { echo >&2 "Cannot create ${SCRIPT_FILE_8MB} file! Aborting."; exit 1; }
116101

117-
tar -czf ${RELEASE_DIR}/${FILE_NAME} -C ${PKG_TMP_DIR} ${BOOT_FILE} ${PART_FILE_4MB} ${PART_FILE_8MB} ${APP_FILE} ${SCRIPT_FILE_8MB} ${FACTORY_FILE} || { echo >&2 "Cannot create ${RELEASE_DIR}/${FILE_NAME}! Aborting."; exit 1; }
102+
tar -czf ${RELEASE_DIR}/${FILE_NAME} -C ${PKG_TMP_DIR} ${BOOT_FILE} ${PART_FILE_8MB} ${APP_FILE} ${SCRIPT_FILE_8MB} ${FACTORY_FILE} || { echo >&2 "Cannot create ${RELEASE_DIR}/${FILE_NAME}! Aborting."; exit 1; }
118103
echo "Release package ${FILE_NAME} created successfully."
119104

120105
rm -rf ${PKG_TMP_DIR}/

0 commit comments

Comments
 (0)