Skip to content

Commit

Permalink
Merge pull request #21129 from gschorcht/dist/tools/esptools/fix_all_…
Browse files Browse the repository at this point in the history
…target

dist/tools/esptool: fix the all target
  • Loading branch information
mguetschow authored Jan 13, 2025
2 parents 85a0968 + c1208ad commit 58adb81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions dist/tools/esptools/export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,36 @@ export_arch()
case $1 in
esp8266)
TARGET_ARCH="xtensa-esp8266-elf"
ESP32_GCC_RELEASE=${ESP8266_GCC_RELEASE}
ESP_GCC_RELEASE="${ESP8266_GCC_RELEASE}"
;;
esp32)
TARGET_ARCH="xtensa-esp32-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32c3)
TARGET_ARCH="riscv32-esp-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s2)
TARGET_ARCH="xtensa-esp32s2-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s3)
TARGET_ARCH="xtensa-esp32s3-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
*)
echo "Unknown architecture $1"
return
esac

TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP32_GCC_RELEASE}/${TARGET_ARCH}"
TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP_GCC_RELEASE}/${TARGET_ARCH}"
TOOLS_DIR_IN_PATH="$(echo $PATH | grep "${TOOLS_DIR}")"

Check warning on line 43 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

if [ ! -e "${TOOLS_DIR}" ]; then
echo "${TOOLS_DIR} does not exist - please run"
echo $(echo $0 | sed 's/export/install/') $1

Check warning on line 47 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

Check warning on line 47 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Quote this to prevent word splitting. [SC2046]
exit 1
return
fi

if [ -z "${TOOLS_DIR_IN_PATH}" ]; then
Expand Down
10 changes: 7 additions & 3 deletions dist/tools/esptools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,33 +88,37 @@ install_arch()
case "$1" in
esp8266)
TARGET_ARCH="xtensa-esp8266-elf"
ESP32_GCC_RELEASE=${ESP8266_GCC_RELEASE}
ESP_GCC_RELEASE="${ESP8266_GCC_RELEASE}"
;;
esp32)
TARGET_ARCH="xtensa-esp32-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32c3)
TARGET_ARCH="riscv32-esp-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s2)
TARGET_ARCH="xtensa-esp32s2-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
esp32s3)
TARGET_ARCH="xtensa-esp32s3-elf"
ESP_GCC_RELEASE="${ESP32_GCC_RELEASE}"
;;
*)
echo "error: Unknown architecture $1"
exit 1
esac

TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP32_GCC_RELEASE}"
TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP_GCC_RELEASE}"

if [ "$1" = "esp8266" ]; then
git clone https://github.com/gschorcht/xtensa-esp8266-elf ${TOOLS_DIR}/${TARGET_ARCH}

Check warning on line 117 in dist/tools/esptools/install.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]
else
URL_PATH="https://github.com/espressif/crosstool-NG/releases/download"
URL_TGZ="${TARGET_ARCH}-${ESP32_GCC_VERSION_DOWNLOAD}-${OS}.tar.xz"
URL="${URL_PATH}/${ESP32_GCC_RELEASE}/${URL_TGZ}"
URL="${URL_PATH}/${ESP_GCC_RELEASE}/${URL_TGZ}"

echo "Creating directory ${TOOLS_DIR} ..." && \
mkdir -p "${TOOLS_DIR}" && \
Expand Down

0 comments on commit 58adb81

Please sign in to comment.