1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18385 from gschorcht/dist/tools/esptool/install.sh

dist/tools/esptools: add macOS support to install/export scripts
This commit is contained in:
Marian Buschsieweke 2022-10-13 13:58:58 +02:00 committed by GitHub
commit b0bccd9bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 18 deletions

View File

@ -5,17 +5,6 @@ ESP32_GCC_VERSION_DIR="8.4.0"
ESP32_OPENOCD_VERSION="v0.11.0-esp32-20211220"
# qemu version depends on the version of ncurses lib
if [ "$(ldconfig -p | grep libncursesw.so.6)" != "" ]; then
ESP32_QEMU_VERSION="esp-develop-20220203"
else
ESP32_QEMU_VERSION="esp-develop-20210220"
fi
if [ -z ${IDF_TOOLS_PATH} ]; then
IDF_TOOLS_PATH=${HOME}/.espressif
fi
TOOLS_PATH=${IDF_TOOLS_PATH}/tools
export_arch()
@ -67,6 +56,33 @@ export_openocd()
export_qemu()
{
# determine the platform using python
PLATFORM_SYSTEM=$(python3 -c "import platform; print(platform.system())")
PLATFORM_MACHINE=$(python3 -c "import platform; print(platform.machine())")
PLATFORM=${PLATFORM_SYSTEM}-${PLATFORM_MACHINE}
# map different platform names to a unique OS name
case ${PLATFORM} in
linux-amd64|linux64|Linux-x86_64|FreeBSD-amd64)
OS=linux-amd64
;;
*)
echo "error: OS architecture ${PLATFORM} not supported"
exit 1
;;
esac
# qemu version depends on the version of ncurses lib
if [ "$(ldconfig -p | grep libncursesw.so.6)" != "" ]; then
ESP32_QEMU_VERSION="esp-develop-20220203"
else
ESP32_QEMU_VERSION="esp-develop-20210220"
fi
if [ -z ${IDF_TOOLS_PATH} ]; then
IDF_TOOLS_PATH=${HOME}/.espressif
fi
TOOLS_DIR=${TOOLS_PATH}/qemu-esp32/${ESP32_QEMU_VERSION}/qemu
TOOLS_DIR_IN_PATH=`echo $PATH | grep ${TOOLS_DIR}`

View File

@ -7,13 +7,6 @@ ESP32_GCC_VERSION_DOWNLOAD="gcc8_4_0"
ESP32_OPENOCD_VERSION="v0.11.0-esp32-20211220"
ESP32_OPENOCD_VERSION_TGZ="0.11.0-esp32-20211220"
# qemu version depends on the version of ncurses lib
if [ "$(ldconfig -p | grep libncursesw.so.6)" != "" ]; then
ESP32_QEMU_VERSION="esp-develop-20220203"
else
ESP32_QEMU_VERSION="esp-develop-20210220"
fi
# set the tool path to the default if not already set
if [ -z ${IDF_TOOLS_PATH} ]; then
IDF_TOOLS_PATH=${HOME}/.espressif
@ -59,6 +52,9 @@ case ${PLATFORM} in
linux-i686|linux32|Linux-i686|FreeBSD-i386)
OS=linux-i686
;;
Darwin-x86_64)
OS=macos
;;
*)
echo "error: OS architecture ${PLATFORM} not supported"
exit 1
@ -141,6 +137,13 @@ install_qemu()
exit 1
fi
# qemu version depends on the version of ncurses lib
if [ "$(ldconfig -p | grep libncursesw.so.6)" != "" ]; then
ESP32_QEMU_VERSION="esp-develop-20220203"
else
ESP32_QEMU_VERSION="esp-develop-20210220"
fi
TOOLS_DIR=${TOOLS_PATH}/qemu-esp32/${ESP32_QEMU_VERSION}
URL_PATH=https://github.com/espressif/qemu/releases/download