forked from Archive/PX4-Autopilot
arch: update to use pacman's arm-none-eabi
which is currently GCC 12.2
This commit is contained in:
parent
adb22f1407
commit
b71c6fb6ea
|
@ -1,7 +1,7 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
## Bash script to setup PX4 development environment on Arch Linux.
|
## Bash script to setup PX4 development environment on Arch Linux.
|
||||||
## Tested on Manjaro 20.2.1.
|
## Tested on Arch 2023-03-01
|
||||||
##
|
##
|
||||||
## Installs:
|
## Installs:
|
||||||
## - Common dependencies and tools for nuttx, jMAVSim
|
## - Common dependencies and tools for nuttx, jMAVSim
|
||||||
|
@ -50,6 +50,7 @@ sudo pacman -Sy --noconfirm --needed \
|
||||||
cmake \
|
cmake \
|
||||||
cppcheck \
|
cppcheck \
|
||||||
doxygen \
|
doxygen \
|
||||||
|
fuse2 \
|
||||||
gdb \
|
gdb \
|
||||||
git \
|
git \
|
||||||
gnutls \
|
gnutls \
|
||||||
|
@ -74,45 +75,17 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||||
echo "Installing NuttX dependencies"
|
echo "Installing NuttX dependencies"
|
||||||
|
|
||||||
sudo pacman -S --noconfirm --needed \
|
sudo pacman -S --noconfirm --needed \
|
||||||
gperf \
|
arm-none-eabi-gcc \
|
||||||
vim \
|
arm-none-eabi-newlib \
|
||||||
;
|
;
|
||||||
|
|
||||||
if [ ! -z "$USER" ]; then
|
if [ ! -z "$USER" ]; then
|
||||||
# add user to dialout group (serial port access)
|
# add user to dialout group (serial port access)
|
||||||
sudo usermod -aG uucp $USER
|
sudo echo usermod -aG uucp $USER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove modem manager (interferes with PX4 serial port usage)
|
# don't run modem manager (interferes with PX4 serial port usage)
|
||||||
sudo pacman -R modemmanager --noconfirm
|
sudo systemctl disable --now ModemManager
|
||||||
|
|
||||||
# arm-none-eabi-gcc
|
|
||||||
NUTTX_GCC_VERSION="10-2020-q4-major"
|
|
||||||
NUTTX_GCC_VERSION_SHORT="10-2020q4"
|
|
||||||
|
|
||||||
source $HOME/.profile # load changed path for the case the script is reran before relogin
|
|
||||||
if [ $(which arm-none-eabi-gcc) ]; then
|
|
||||||
GCC_VER_STR=$(arm-none-eabi-gcc --version)
|
|
||||||
GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$GCC_FOUND_VER" == "1" ]]; then
|
|
||||||
echo "arm-none-eabi-gcc-${NUTTX_GCC_VERSION} found, skipping installation"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
|
|
||||||
wget -O /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/${NUTTX_GCC_VERSION_SHORT}/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-x86_64-linux.tar.bz2 && \
|
|
||||||
sudo tar -jxf /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 -C /opt/;
|
|
||||||
|
|
||||||
# add arm-none-eabi-gcc to user's PATH
|
|
||||||
exportline="export PATH=/opt/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}/bin:\$PATH"
|
|
||||||
|
|
||||||
if grep -Fxq "$exportline" $HOME/.profile; then
|
|
||||||
echo "${NUTTX_GCC_VERSION} path already set.";
|
|
||||||
else
|
|
||||||
echo $exportline >> $HOME/.profile;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Simulation tools
|
# Simulation tools
|
||||||
|
@ -161,5 +134,5 @@ fi
|
||||||
|
|
||||||
if [[ $INSTALL_NUTTX == "true" ]]; then
|
if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||||
echo
|
echo
|
||||||
echo "Reboot or logout, login computer before attempting to build NuttX targets"
|
echo "Reboot or logout, login computer before attempting to flash NuttX targets"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue