Tools: Install the right serial module for Ubuntu lunar

* It's used in the firmware uploader.py script
* And a quick modification to reduce code duplication

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
This commit is contained in:
Ryan Friedman 2023-08-11 10:30:44 -06:00 committed by Andrew Tridgell
parent 8e0bbc9713
commit 08cd651bc3
1 changed files with 4 additions and 3 deletions

View File

@ -147,11 +147,12 @@ fi
# Lists of packages to install
BASE_PKGS="build-essential ccache g++ gawk git make wget valgrind screen"
PYTHON_PKGS="future lxml pymavlink pyserial MAVProxy pexpect geocoder empy ptyprocess dronecan"
if [ ${RELEASE_CODENAME} == 'bionic' ]; then
# use fixed version for package that drop python2 support
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect flake8==3.7.9 requests==2.27.1 monotonic==1.6 geocoder empy ptyprocess configparser==4.0.2 click==7.1.2 decorator==4.4.2 dronecan"
PYTHON_PKGS="$PYTHON_PKGS flake8==3.7.9 requests==2.27.1 monotonic==1.6 configparser==4.0.2 click==7.1.2 decorator==4.4.2"
else
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect flake8 geocoder empy ptyprocess dronecan"
PYTHON_PKGS="$PYTHON_PKGS flake8"
fi
# add some Python packages required for commonly-used MAVProxy modules and hex file generation:
@ -176,7 +177,7 @@ fi
# add some packages required for commonly-used MAVProxy modules:
if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
if [ ${RELEASE_CODENAME} == 'lunar' ]; then
PYTHON_PKGS+=" matplotlib serial scipy opencv-python pyyaml"
PYTHON_PKGS+=" matplotlib scipy opencv-python pyyaml"
SITL_PKGS+=" xterm libcsfml-dev libcsfml-audio${SITLCFML_VERSION} libcsfml-dev libcsfml-graphics${SITLCFML_VERSION} libcsfml-network${SITLCFML_VERSION} libcsfml-system${SITLCFML_VERSION} libcsfml-window${SITLCFML_VERSION} libsfml-audio${SITLFML_VERSION} libsfml-dev libsfml-graphics${SITLFML_VERSION} libsfml-network${SITLFML_VERSION} libsfml-system${SITLFML_VERSION} libsfml-window${SITLFML_VERSION}"
else
SITL_PKGS="$SITL_PKGS xterm ${PYTHON_V}-matplotlib ${PYTHON_V}-serial ${PYTHON_V}-scipy ${PYTHON_V}-opencv libcsfml-dev libcsfml-audio${SITLCFML_VERSION} libcsfml-dev libcsfml-graphics${SITLCFML_VERSION} libcsfml-network${SITLCFML_VERSION} libcsfml-system${SITLCFML_VERSION} libcsfml-window${SITLCFML_VERSION} libsfml-audio${SITLFML_VERSION} libsfml-dev libsfml-graphics${SITLFML_VERSION} libsfml-network${SITLFML_VERSION} libsfml-system${SITLFML_VERSION} libsfml-window${SITLFML_VERSION} ${PYTHON_V}-yaml"