diff --git a/sw/tools/install.py b/sw/tools/install.py index ba50b381ce..734c8047eb 100755 --- a/sw/tools/install.py +++ b/sw/tools/install.py @@ -52,6 +52,14 @@ class InstallWindow(QWidget): self.execute('sudo -E apt-get install -y python3-lxml python3-numpy') elif distro_version >= 24.04: self.execute('sudo -E apt-get install -y liblablgtk2-ocaml-dev') + if distro_version == 18.04: + self.execute('wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -') + self.execute('sudo apt-add-repository \'deb https://apt.kitware.com/ubuntu/ bionic main\'') + self.execute('sudo apt-get update && sudo apt-get install cmake') + self.execute('sudo -E apt-get install -y libboost-program-options-dev libboost-filesystem-dev') + if distro_version >= 24.04: + self.execute('python3 -m pip install telnetlib3') # Required for bebop tools + def cmd_arm(self): self.execute('sudo -E apt-get -f -y install paparazzi-dev') diff --git a/sw/tools/parrot/bebop.py b/sw/tools/parrot/bebop.py index 6b6452dba7..0fc4ed1314 100755 --- a/sw/tools/parrot/bebop.py +++ b/sw/tools/parrot/bebop.py @@ -52,7 +52,7 @@ class Bebop(ParrotUtils): if self.read_from_config(name) == 'Unknown': self.execute_command('echo "' + name + '=' + value + '\" >> ' + self.config_file) else: - self.execute_command('sed -i "s/\(' + name + ' *= *\).*/\\1' + value + '/g" ' + self.config_file) + self.execute_command('sed -i "s/\\(' + name + ' *= *\\).*/\\1' + value + '/g" ' + self.config_file) def uav_status(self): print('Parrot version:\t\t' + str(self.check_version())) @@ -79,7 +79,7 @@ class Bebop(ParrotUtils): self.execute_command("sed -i 's|connect2hub|pprzstarter|' /etc/init.d/rcS") self.execute_command("rm /data/ftp/internal_000/scripts/connect2hub") else: - self.execute_command("sed -i 's|^exit 0|/data/ftp/internal_000/scripts/pprzstarter \& exit 0|' /etc/init.d/rcS") + self.execute_command("sed -i 's|^exit 0|/data/ftp/internal_000/scripts/pprzstarter \\& exit 0|' /etc/init.d/rcS") self.execute_command("chmod a+x /etc/init.d/rcS") self.execute_command("chmod a+x /data/ftp/internal_000/scripts/pprzstarter") self.execute_command("chmod a+x /data/ftp/internal_000/scripts/button_switch") @@ -101,7 +101,7 @@ class Bebop(ParrotUtils): def bebop_uninstall_scripts(self): print('Uninstalling Paparazzi scripts') self.execute_command("mount -o remount,rw /") - self.execute_command("sed -i 's|^/data/ftp/internal_000/scripts/pprzstarter \& exit 0|exit 0|' /etc/init.d/rcS") + self.execute_command("sed -i 's|^/data/ftp/internal_000/scripts/pprzstarter \\& exit 0|exit 0|' /etc/init.d/rcS") self.execute_command("chmod a+x /etc/init.d/rcS") self.execute_command("mv /bin/onoffbutton/shortpress_3.sh.backup /bin/onoffbutton/shortpress_3.sh") self.execute_command("rm -rf /data/ftp/internal_000/scripts/*") diff --git a/sw/tools/parrot/parrot_utils.py b/sw/tools/parrot/parrot_utils.py index 79af2b0fb0..8da74cc590 100644 --- a/sw/tools/parrot/parrot_utils.py +++ b/sw/tools/parrot/parrot_utils.py @@ -24,7 +24,10 @@ from __future__ import print_function from __future__ import unicode_literals from builtins import bytes import socket -import telnetlib +try: + import telnetlib3 as telnetlib +except ImportError: + import telnetlib import os import sys from ftplib import FTP