chore: update Ubuntu 22.04 build environment script and docs (#7209)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5dfb435aa0
commit
d9e585944a
@@ -5,6 +5,9 @@ set -e
|
||||
## Bash script to setup EdgeTX development environment on Ubuntu 22.04 running on bare-metal or in a virtual machine.
|
||||
## Let it run as normal user and when asked, give sudo credentials
|
||||
|
||||
QT_VERSION="6.9.3"
|
||||
GCC_ARM_VERSION="14.2.rel1"
|
||||
|
||||
PAUSEAFTEREACHLINE="false"
|
||||
STEP=1
|
||||
# Parse argument(s)
|
||||
@@ -21,14 +24,23 @@ if [[ $(lsb_release -rs) != "22.04" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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."
|
||||
sudo dpkg --add-architecture i386
|
||||
else
|
||||
echo "i386 requirement satisfied!"
|
||||
fi
|
||||
echo "=== Step $((STEP++)): Setting up package repositories ==="
|
||||
sudo apt-get -y install --no-install-recommends software-properties-common gpg gpg-agent wget ca-certificates
|
||||
sudo mkdir -p /etc/apt/keyrings
|
||||
# Set up Kitware repository for newer cmake
|
||||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
|
||||
gpg --dearmor - | sudo tee /etc/apt/keyrings/kitware-archive-keyring.gpg >/dev/null
|
||||
echo "deb [signed-by=/etc/apt/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main" | \
|
||||
sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
|
||||
# Set up NodeSource repository for Node.js 20.x
|
||||
wget -O - https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key 2>/dev/null | \
|
||||
gpg --dearmor - | sudo tee /etc/apt/keyrings/nodesource.gpg >/dev/null
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | \
|
||||
sudo tee /etc/apt/sources.list.d/nodesource.list >/dev/null
|
||||
# Set up Git PPA for newer git
|
||||
sudo add-apt-repository ppa:git-core/ppa --yes
|
||||
# Set up Rob Savoury's PPA for newer SDL2
|
||||
sudo add-apt-repository ppa:savoury1/multimedia --yes
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
||||
read
|
||||
@@ -42,35 +54,38 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
fi
|
||||
|
||||
echo "=== Step $((STEP++)): Installing packages ==="
|
||||
sudo apt-get -y install \
|
||||
sudo apt-get -y install --no-install-recommends \
|
||||
build-essential \
|
||||
cmake \
|
||||
gcc \
|
||||
kitware-archive-keyring \
|
||||
git \
|
||||
lib32ncurses-dev \
|
||||
lib32z1 \
|
||||
libsdl2-dev \
|
||||
software-properties-common \
|
||||
wget \
|
||||
zip \
|
||||
python3-pip-whl \
|
||||
python3-pil \
|
||||
libgtest-dev \
|
||||
unzip \
|
||||
file \
|
||||
gawk \
|
||||
libsdl2-dev \
|
||||
python3-dev \
|
||||
python3-pip \
|
||||
python3-tk \
|
||||
python3-setuptools \
|
||||
python3-tk \
|
||||
libcups2 \
|
||||
libssl-dev \
|
||||
libgtest-dev \
|
||||
clang \
|
||||
python3-clang \
|
||||
libusb-1.0-0-dev \
|
||||
stlink-tools \
|
||||
openocd \
|
||||
npm \
|
||||
pv \
|
||||
libncurses5:i386 \
|
||||
libpython2.7:i386 \
|
||||
libclang-dev \
|
||||
python-is-python3 \
|
||||
openssl
|
||||
dfu-util \
|
||||
nodejs \
|
||||
stlink-tools \
|
||||
openocd \
|
||||
pv
|
||||
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 $((STEP++)): Installing lv_font_conv ==="
|
||||
sudo npm i lv_font_conv -g
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop."
|
||||
read
|
||||
@@ -78,59 +93,61 @@ fi
|
||||
|
||||
echo "=== Step $((STEP++)): Installing Python packages ==="
|
||||
sudo python3 -m pip install \
|
||||
filelock \
|
||||
asciitree \
|
||||
jinja2 \
|
||||
pillow==7.2.0 \
|
||||
clang==14.0.0 \
|
||||
future \
|
||||
lxml \
|
||||
pillow \
|
||||
clang \
|
||||
lz4 \
|
||||
aqtinstall \
|
||||
pyelftools
|
||||
pyelftools \
|
||||
pydantic
|
||||
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 $((STEP++)): Installing Qt ==="
|
||||
./aqt install-qt --outputdir qt linux desktop 6.9.0 linux_gcc_64 -m qtmultimedia qtserialport
|
||||
sudo mkdir -p /opt/qt
|
||||
sudo chown "${USER}:${USER}" /opt/qt
|
||||
aqt install-qt --outputdir /opt/qt linux desktop ${QT_VERSION} linux_gcc_64 -m qtmultimedia qtserialport
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
||||
read
|
||||
fi
|
||||
|
||||
echo "=== Step $((STEP++)): Fetching GNU Arm Embedded Toolchains ==="
|
||||
# EdgeTX uses GNU Arm Embedded Toolchain version 14.2.rel1
|
||||
wget -q --show-progress --progress=bar:force:noscroll https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz
|
||||
wget -q --show-progress --progress=bar:force:noscroll https://developer.arm.com/-/media/Files/downloads/gnu/${GCC_ARM_VERSION}/binrel/arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi.tar.xz
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
||||
read
|
||||
fi
|
||||
|
||||
echo "=== Step $((STEP++)): Unpacking GNU Arm Embedded Toolchains ==="
|
||||
pv arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz | tar xJf -
|
||||
pv arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi.tar.xz | tar xJf -
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
||||
read
|
||||
fi
|
||||
|
||||
echo "=== Step $((STEP++)): Removing the downloaded archives ==="
|
||||
rm arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz
|
||||
rm arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi.tar.xz
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
||||
read
|
||||
fi
|
||||
|
||||
echo "=== Step $((STEP++)): Moving GNU Arm Embedded Toolchains to /opt ==="
|
||||
sudo mv arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi /opt/gcc-arm-none-eabi
|
||||
sudo mv arm-gnu-toolchain-${GCC_ARM_VERSION}-x86_64-arm-none-eabi /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 $((STEP++)): Adding GNU Arm Embedded Toolchain to PATH of current user ==="
|
||||
echo 'export PATH="/opt/gcc-arm-none-eabi/bin:$PATH"' >> ~/.bashrc
|
||||
echo "=== Step $((STEP++)): Adding GNU Arm Embedded Toolchain and Qt to PATH of current user ==="
|
||||
cat >> ~/.bashrc << EOF
|
||||
export PATH="/opt/gcc-arm-none-eabi/bin:\$PATH"
|
||||
export PATH="/opt/qt/${QT_VERSION}/gcc_64/bin:\$PATH"
|
||||
EOF
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished. Please press Enter to continue or Ctrl+C to stop."
|
||||
read
|
||||
@@ -143,37 +160,5 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
read
|
||||
fi
|
||||
|
||||
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.11.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 $((STEP++)): Unpacking USB DFU host utility ==="
|
||||
pv dfu-util-0.11.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 $((STEP++)): Building and Installing USB DFU host utility ==="
|
||||
cd dfu-util-0.11/
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
cd ..
|
||||
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 $((STEP++)): Removing the downloaded archive and build folder of USB DFU host utility ==="
|
||||
rm dfu-util-0.11.tar.gz
|
||||
rm -rf dfu-util-0.11
|
||||
if [[ $PAUSEAFTEREACHLINE == "true" ]]; then
|
||||
echo "Step finished."
|
||||
fi
|
||||
|
||||
echo "Finished setting up EdgeTX development environment."
|
||||
echo "Please execute: source ~/.bashrc"
|
||||
|
||||
Reference in New Issue
Block a user