From 76c91ac2911151c5eefa18f091e799449cf54f07 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 9 Aug 2021 14:13:15 +1000 Subject: [PATCH 01/12] Halt execution on first error If you're not going to check the return status of each command at least halt the script at the first error rather than blindly continuing. --- tools/setup_buildenv_ubuntu20.04.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index cce914737..b6eaf42ec 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -1,5 +1,7 @@ #! /usr/bin/env bash +set -x + ## Bash script to setup EdgeTX v2.4 development environment on Ubuntu 20.04 running on bare-metal or in a virtual machine. ## Does NOT work with WSL/WSL2 under Windows 10! ## Let it run as normal user and when asked, give sudo credentials From b53fd2821d30edc84a961570549cef9624b117d5 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 9 Aug 2021 14:13:48 +1000 Subject: [PATCH 02/12] Show progress during the downloads --- tools/setup_buildenv_ubuntu20.04.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index b6eaf42ec..2a0aaaf47 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -53,7 +53,7 @@ fi echo "=== Step 5: Fetching GNU Arm Embedded Toolchains ===" # EdgeTX uses GNU Arm Embedded Toolchain in version 10-2020-q4 -wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 +wget -q --show-progress --progress=bar:force:noscroll https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read @@ -96,7 +96,7 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then fi echo "=== Step 11: Fetching USB DFU host utility ===" -wget http://dfu-util.sourceforge.net/releases/dfu-util-0.10.tar.gz +wget -q --show-progress --progress=bar:force:noscroll http://dfu-util.sourceforge.net/releases/dfu-util-0.10.tar.gz if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read From 354950ce4cd079f851cdb4e97b8b1be677efa85a Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 9 Aug 2021 14:20:42 +1000 Subject: [PATCH 03/12] Remove non-functional command This fails for two reasons 1) shell scripts run in their own instance, so this would be lost as soon as the script finishes. 2) more importantly, this is Ubuntu, which has a short-circuit at the top of the .bashrc to prevent it from running in a non-interactive shell --- tools/setup_buildenv_ubuntu20.04.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index 2a0aaaf47..ed97c0594 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -82,7 +82,6 @@ fi echo "=== Step 9: Adding GNU Arm Embedded Toolchain to PATH of current user ===" echo 'export PATH="/opt/gcc-arm-none-eabi/bin:$PATH"' >> ~/.bashrc -source ~/.bashrc if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read @@ -127,4 +126,4 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished." fi -echo "Finished setting up EdgeTX v2.4 development environment. Please reboot the computer." +echo "Finished setting up EdgeTX v2.4 development environment. Please reboot the computer." \ No newline at end of file From 868ad6a5763bf375bdcf399bb5aa5c3f0dc3cf60 Mon Sep 17 00:00:00 2001 From: Risto Date: Mon, 9 Aug 2021 10:15:41 +0200 Subject: [PATCH 04/12] Removed v2.4 text in comments to be more generic. --- tools/setup_buildenv_ubuntu20.04.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index ed97c0594..3198ee2c2 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -2,8 +2,8 @@ set -x -## Bash script to setup EdgeTX v2.4 development environment on Ubuntu 20.04 running on bare-metal or in a virtual machine. -## Does NOT work with WSL/WSL2 under Windows 10! +## Bash script to setup EdgeTX development environment on Ubuntu 20.04 running on bare-metal or in a virtual machine. +## Not tested with WSL/WSL2 under Windows 10! ## Let it run as normal user and when asked, give sudo credentials PAUSEAFTEREACHLINE="false" @@ -126,4 +126,4 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished." fi -echo "Finished setting up EdgeTX v2.4 development environment. Please reboot the computer." \ No newline at end of file +echo "Finished setting up EdgeTX development environment. Please reboot the computer." From 4e423bf7ddbe3ebfb6c7670c5cb1273b12f10978 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 9 Aug 2021 19:05:43 +1000 Subject: [PATCH 05/12] Typo --- tools/setup_buildenv_ubuntu20.04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index ed97c0594..fee859a2e 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash -set -x +set -e ## Bash script to setup EdgeTX v2.4 development environment on Ubuntu 20.04 running on bare-metal or in a virtual machine. ## Does NOT work with WSL/WSL2 under Windows 10! From 93bf2f40c5421c236c62ef49d186689f6aaf562c Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 9 Aug 2021 19:42:47 +1000 Subject: [PATCH 06/12] Add progress view to tar extract jobs --- tools/setup_buildenv_ubuntu20.04.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index 268cc68b5..1b06b70b2 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -31,7 +31,7 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then fi echo "=== Step 2: Installing packages ===" -sudo apt-get -y install build-essential cmake gcc git lib32ncurses-dev lib32z1 libfox-1.6-dev libsdl1.2-dev qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools qtcreator libqt5svg5-dev software-properties-common wget zip python-pip-whl python-pil libgtest-dev python3-pip python3-tk python3-setuptools clang-7 python-clang-7 libusb-1.0-0-dev stlink-tools openocd npm libncurses5:i386 libpython2.7:i386 +sudo apt-get -y install build-essential cmake gcc git lib32ncurses-dev lib32z1 libfox-1.6-dev libsdl1.2-dev qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools qtcreator libqt5svg5-dev software-properties-common wget zip python-pip-whl python-pil libgtest-dev python3-pip python3-tk python3-setuptools clang-7 python-clang-7 libusb-1.0-0-dev stlink-tools openocd npm pv libncurses5:i386 libpython2.7:i386 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read @@ -60,7 +60,7 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then fi echo "=== Step 6: Unpacking GNU Arm Embedded Toolchains ===" -tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 +pv gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | tar xjf - if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read @@ -102,7 +102,7 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then fi echo "=== Step 12: Unpacking USB DFU host utility ===" -tar xzvf dfu-util-0.10.tar.gz +pv dfu-util-0.10.tar.gz | tar xzf - if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read From 0cb18b069bca344666b1e0a4eefe4fede59b0117 Mon Sep 17 00:00:00 2001 From: Risto Date: Mon, 9 Aug 2021 14:08:54 +0200 Subject: [PATCH 07/12] Added checks to detect if i386 architecture is installed --- tools/setup_buildenv_ubuntu20.04.sh | 53 +++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index 1b06b70b2..3c9ddf7cd 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -23,35 +23,50 @@ if exit 1 fi -echo "=== Step 1: Updating Ubuntu package lists. Please provide sudo credentials, when asked ===" +echo "=== Step 1: Checking if i386 requirement is satisfied ===" +OUTPUT=$(dpkg --print-foreign-architectures 2> /dev/null | grep i386) +if [ $? -eq 1 ]; then + echo "Need to install i386 architecture first." + I386ARCH="no" + sudo dpkg --add-architecture i386 +else + echo "Match was found, i386 requirement satisfied!" + I386ARCH="yes" +fi +if [[ $PAUSEAFTEREACHLINE == "true" ]]; then + echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." + read +fi + +echo "=== Step 2: Updating Ubuntu package lists. Please provide sudo credentials, when asked ===" sudo apt-get -y update if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 2: Installing packages ===" +echo "=== Step 3: Installing packages ===" sudo apt-get -y install build-essential cmake gcc git lib32ncurses-dev lib32z1 libfox-1.6-dev libsdl1.2-dev qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools qtcreator libqt5svg5-dev software-properties-common wget zip python-pip-whl python-pil libgtest-dev python3-pip python3-tk python3-setuptools clang-7 python-clang-7 libusb-1.0-0-dev stlink-tools openocd npm pv libncurses5:i386 libpython2.7:i386 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 3: Creating symbolic link for Python ===" +echo "=== Step 4: Creating symbolic link for Python ===" sudo ln -sf /usr/bin/python3 /usr/bin/python if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 4: Installing Python packages ===" +echo "=== Step 5: Installing Python packages ===" sudo python3 -m pip install filelock pillow==7.2.0 clang future lxml if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 5: Fetching GNU Arm Embedded Toolchains ===" +echo "=== Step 6: Fetching GNU Arm Embedded Toolchains ===" # EdgeTX uses GNU Arm Embedded Toolchain in version 10-2020-q4 wget -q --show-progress --progress=bar:force:noscroll https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then @@ -59,56 +74,56 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then read fi -echo "=== Step 6: Unpacking GNU Arm Embedded Toolchains ===" +echo "=== Step 7: Unpacking GNU Arm Embedded Toolchains ===" pv gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | tar xjf - if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 7: Removing the downloaded archives ===" +echo "=== Step 8: Removing the downloaded archives ===" rm gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 8: Moving GNU Arm Embedded Toolchains to /opt ===" +echo "=== Step 9: Moving GNU Arm Embedded Toolchains to /opt ===" sudo mv gcc-arm-none-eabi-10-2020-q4-major /opt/gcc-arm-none-eabi if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 9: Adding GNU Arm Embedded Toolchain to PATH of current user ===" +echo "=== Step 10: Adding GNU Arm Embedded Toolchain to PATH of current user ===" echo 'export PATH="/opt/gcc-arm-none-eabi/bin:$PATH"' >> ~/.bashrc if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 10: Removing modemmanager (conflicts with DFU) ===" +echo "=== Step 11: Removing modemmanager (conflicts with DFU) ===" sudo apt-get -y remove modemmanager if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 11: Fetching USB DFU host utility ===" +echo "=== Step 12: Fetching USB DFU host utility ===" wget -q --show-progress --progress=bar:force:noscroll http://dfu-util.sourceforge.net/releases/dfu-util-0.10.tar.gz if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 12: Unpacking USB DFU host utility ===" +echo "=== Step 13: Unpacking USB DFU host utility ===" pv dfu-util-0.10.tar.gz | tar xzf - if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 13: Building and Installing USB DFU host utility ===" +echo "=== Step 14: Building and Installing USB DFU host utility ===" cd dfu-util-0.10/ ./configure make @@ -119,11 +134,19 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then read fi -echo "=== Step 14: Removing the downloaded archive and build folder of USB DFU host utility ===" +echo "=== Step 15: Removing the downloaded archive and build folder of USB DFU host utility ===" rm dfu-util-0.10.tar.gz rm -rf dfu-util-0.10 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished." fi -echo "Finished setting up EdgeTX development environment. Please reboot the computer." +if [[ $I386ARCH == "no" ]]; then +## Likely running in WSL2 + echo "Reloading .bashrc". + source ~/.bashrc + echo "Finished setting up EdgeTX development environment." +else +## Likely running on bare-metal or virtual machine + echo "Finished setting up EdgeTX development environment. Please reboot the computer." +fi From cf07ee94b35e54c86feb610a02725bc64e4432e1 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 10 Aug 2021 19:42:18 +1000 Subject: [PATCH 08/12] Fix grep terminating script to if i386 not found --- tools/setup_buildenv_ubuntu20.04.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index 3c9ddf7cd..e9d2820c2 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -16,16 +16,15 @@ do fi done -if - [[ `lsb_release -rs` != "20.04" ]]; then +if [[ `lsb_release -rs` != "20.04" ]]; then echo "ERROR: Not running on Ubuntu 20.04!" echo "Terminating the script now." exit 1 fi echo "=== Step 1: Checking if i386 requirement is satisfied ===" -OUTPUT=$(dpkg --print-foreign-architectures 2> /dev/null | grep i386) -if [ $? -eq 1 ]; then +OUTPUT=x$(dpkg --print-foreign-architectures 2> /dev/null | grep i386) || : +if [ $OUTPUT != "xi386" ]; then echo "Need to install i386 architecture first." I386ARCH="no" sudo dpkg --add-architecture i386 From ac5e1ff89c27bd88a6eceb923ef8a9b1363eefb3 Mon Sep 17 00:00:00 2001 From: Risto Date: Tue, 10 Aug 2021 11:44:10 +0200 Subject: [PATCH 09/12] .bashrc needs to be sourced by user manually --- tools/setup_buildenv_ubuntu20.04.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index 3c9ddf7cd..6dede1e5e 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -27,11 +27,9 @@ echo "=== Step 1: Checking if i386 requirement is satisfied ===" OUTPUT=$(dpkg --print-foreign-architectures 2> /dev/null | grep i386) if [ $? -eq 1 ]; then echo "Need to install i386 architecture first." - I386ARCH="no" sudo dpkg --add-architecture i386 else - echo "Match was found, i386 requirement satisfied!" - I386ARCH="yes" + echo "i386 requirement satisfied!" fi if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." @@ -141,12 +139,5 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished." fi -if [[ $I386ARCH == "no" ]]; then -## Likely running in WSL2 - echo "Reloading .bashrc". - source ~/.bashrc - echo "Finished setting up EdgeTX development environment." -else -## Likely running on bare-metal or virtual machine - echo "Finished setting up EdgeTX development environment. Please reboot the computer." -fi +echo "Finished setting up EdgeTX development environment." +echo "Please execute: source ~/.bashrc" From f3fcb062f0f71209d3bdcb1a8ab7b65ffdc5d53b Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 10 Aug 2021 20:01:02 +1000 Subject: [PATCH 10/12] Resolve shellcheck code warnings --- tools/setup_buildenv_ubuntu20.04.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index e9d2820c2..0152a5c77 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -16,7 +16,7 @@ do fi done -if [[ `lsb_release -rs` != "20.04" ]]; then +if [[ $(lsb_release -rs) != "20.04" ]]; then echo "ERROR: Not running on Ubuntu 20.04!" echo "Terminating the script now." exit 1 @@ -24,7 +24,7 @@ fi echo "=== Step 1: Checking if i386 requirement is satisfied ===" OUTPUT=x$(dpkg --print-foreign-architectures 2> /dev/null | grep i386) || : -if [ $OUTPUT != "xi386" ]; then +if [ "$OUTPUT" != "xi386" ]; then echo "Need to install i386 architecture first." I386ARCH="no" sudo dpkg --add-architecture i386 From 3822c0a51513f2b866730c6588db4951bfa3d4a5 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 10 Aug 2021 20:10:31 +1000 Subject: [PATCH 11/12] Add step variable --- tools/setup_buildenv_ubuntu20.04.sh | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index 757290883..8376753d6 100644 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -7,7 +7,7 @@ set -e ## Let it run as normal user and when asked, give sudo credentials PAUSEAFTEREACHLINE="false" - +STEP=1 # Parse argument(s) for arg in "$@" do @@ -22,7 +22,7 @@ if [[ $(lsb_release -rs) != "20.04" ]]; then exit 1 fi -echo "=== Step 1: Checking if i386 requirement is satisfied ===" +echo "=== Step $((STEP++)): Checking if i386 requirement is satisfied ===" OUTPUT=x$(dpkg --print-foreign-architectures 2> /dev/null | grep i386) || : if [ "$OUTPUT" != "xi386" ]; then echo "Need to install i386 architecture first." @@ -35,35 +35,35 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then read fi -echo "=== Step 2: Updating Ubuntu package lists. Please provide sudo credentials, when asked ===" +echo "=== Step $((STEP++)): Updating Ubuntu package lists. Please provide sudo credentials, when asked ===" sudo apt-get -y update if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 3: Installing packages ===" +echo "=== Step $((STEP++)): Installing packages ===" sudo apt-get -y install build-essential cmake gcc git lib32ncurses-dev lib32z1 libfox-1.6-dev libsdl1.2-dev qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools qtcreator libqt5svg5-dev software-properties-common wget zip python-pip-whl python-pil libgtest-dev python3-pip python3-tk python3-setuptools clang-7 python-clang-7 libusb-1.0-0-dev stlink-tools openocd npm pv libncurses5:i386 libpython2.7:i386 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 4: Creating symbolic link for Python ===" +echo "=== Step $((STEP++)): Creating symbolic link for Python ===" sudo ln -sf /usr/bin/python3 /usr/bin/python if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 5: Installing Python packages ===" +echo "=== Step $((STEP++)): Installing Python packages ===" sudo python3 -m pip install filelock pillow==7.2.0 clang future lxml if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 6: Fetching GNU Arm Embedded Toolchains ===" +echo "=== Step $((STEP++)): Fetching GNU Arm Embedded Toolchains ===" # EdgeTX uses GNU Arm Embedded Toolchain in version 10-2020-q4 wget -q --show-progress --progress=bar:force:noscroll https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then @@ -71,56 +71,56 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then read fi -echo "=== Step 7: Unpacking GNU Arm Embedded Toolchains ===" +echo "=== Step $((STEP++)): Unpacking GNU Arm Embedded Toolchains ===" pv gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 | tar xjf - if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 8: Removing the downloaded archives ===" +echo "=== Step $((STEP++)): Removing the downloaded archives ===" rm gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 9: Moving GNU Arm Embedded Toolchains to /opt ===" +echo "=== Step $((STEP++)): Moving GNU Arm Embedded Toolchains to /opt ===" sudo mv gcc-arm-none-eabi-10-2020-q4-major /opt/gcc-arm-none-eabi if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 10: Adding GNU Arm Embedded Toolchain to PATH of current user ===" +echo "=== Step $((STEP++)): Adding GNU Arm Embedded Toolchain to PATH of current user ===" echo 'export PATH="/opt/gcc-arm-none-eabi/bin:$PATH"' >> ~/.bashrc if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 11: Removing modemmanager (conflicts with DFU) ===" +echo "=== Step $((STEP++)): Removing modemmanager (conflicts with DFU) ===" sudo apt-get -y remove modemmanager if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 12: Fetching USB DFU host utility ===" +echo "=== Step $((STEP++)): Fetching USB DFU host utility ===" wget -q --show-progress --progress=bar:force:noscroll http://dfu-util.sourceforge.net/releases/dfu-util-0.10.tar.gz if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 13: Unpacking USB DFU host utility ===" +echo "=== Step $((STEP++)): Unpacking USB DFU host utility ===" pv dfu-util-0.10.tar.gz | tar xzf - if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read fi -echo "=== Step 14: Building and Installing USB DFU host utility ===" +echo "=== Step $((STEP++)): Building and Installing USB DFU host utility ===" cd dfu-util-0.10/ ./configure make @@ -131,7 +131,7 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then read fi -echo "=== Step 15: Removing the downloaded archive and build folder of USB DFU host utility ===" +echo "=== Step $((STEP++)): Removing the downloaded archive and build folder of USB DFU host utility ===" rm dfu-util-0.10.tar.gz rm -rf dfu-util-0.10 if [[ $PAUSEAFTEREACHLINE == "true" ]]; then From ccf7c16288af67d2df42500a89a5a2185c80cf8f Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 10 Aug 2021 20:11:27 +1000 Subject: [PATCH 12/12] Has been tested on WSL2 --- tools/setup_buildenv_ubuntu20.04.sh | 1 - 1 file changed, 1 deletion(-) mode change 100644 => 100755 tools/setup_buildenv_ubuntu20.04.sh diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh old mode 100644 new mode 100755 index 8376753d6..7d6bc1203 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -3,7 +3,6 @@ set -e ## Bash script to setup EdgeTX development environment on Ubuntu 20.04 running on bare-metal or in a virtual machine. -## Not tested with WSL/WSL2 under Windows 10! ## Let it run as normal user and when asked, give sudo credentials PAUSEAFTEREACHLINE="false"