stephendade / Rpanion-server

Web-based configurator for companion computers of MAVLink vehicles
https://www.docs.rpanion.com/software/rpanion-server
GNU General Public License v3.0
146 stars 62 forks source link

deploy: fix bookworm raspberry pi 3b+ installation script #251

Closed lida2003 closed 1 month ago

stephendade commented 1 month ago

Ok, I understand the issue - RaspiOS has changed the $ID from debian to raspian. To ensure other debian OS's are included, you'll need to do a check for if $ID is equal to debian OR raspian, as shown in my review above.

lida2003 commented 1 month ago

my mistake, now it's verified.

-if [ "$ID" == "debian" ] && [ "$VERSION_CODENAME" == "bookworm" ]; then
+if [[ "$ID" == "debian" || "$ID" == "raspbian" ]] && [ "$VERSION_CODENAME" == "bookworm" ]; then
$ ./install_common_libraries.sh
+ sudo apt update
Hit:1 https://deb.nodesource.com/node_20.x nodistro InRelease
Hit:2 http://archive.raspberrypi.com/debian bookworm InRelease
Get:3 http://download.zerotier.com/debian/bookworm bookworm InRelease [36.9 kB]
Hit:4 http://raspbian.raspberrypi.com/raspbian bookworm InRelease
Fetched 36.9 kB in 7s (4,999 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: http://raspbian.raspberrypi.com/raspbian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
+ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo apt install -y libunwind-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libunwind-dev is already the newest version (1.6.2-3).
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo apt install -y gstreamer1.0-plugins-good libgstrtspserver-1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gstreamer1.0-plugins-good is already the newest version (1.22.0-5+rpt1+deb12u1).
libgstrtspserver-1.0-dev is already the newest version (1.22.0-2).
gstreamer1.0-plugins-base-apps is already the newest version (1.22.0-3+deb12u2+rpt1).
gstreamer1.0-plugins-ugly is already the newest version (1.22.0-2+deb12u1).
gstreamer1.0-plugins-bad is already the newest version (1.22.0-4+deb12u5).
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo apt install -y network-manager python3 python3-dev python3-gst-1.0 python3-pip dnsmasq git ninja-build
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
network-manager is already the newest version (1.42.4-1+rpt1).
python3 is already the newest version (3.11.2-1).
python3-dev is already the newest version (3.11.2-1).
python3-gst-1.0 is already the newest version (1.22.0-2).
python3-pip is already the newest version (23.0.1+dfsg-1+rpt1).
dnsmasq is already the newest version (2.89-1).
git is already the newest version (1:2.39.5-0+deb12u1).
ninja-build is already the newest version (1.11.1-1).
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo apt install -y libxml2-dev libxslt1-dev python3-lxml python3-numpy
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libxml2-dev is already the newest version (2.9.14+dfsg-1.3~deb12u1).
libxslt1-dev is already the newest version (1.1.35-1).
python3-lxml is already the newest version (4.9.2-1).
python3-numpy is already the newest version (1:1.24.2-1+deb12u1).
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo apt purge -y modemmanager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'modemmanager' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo apt remove -y nodejs nodejs-doc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'nodejs' is not installed, so not removed
Package 'nodejs-doc' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ echo 'PATH=$PATH:~/.local/bin'
+ source /home/daniel/.profile
++ '[' -n '5.2.15(1)-release' ']'
++ '[' -f /home/daniel/.bashrc ']'
++ . /home/daniel/.bashrc
+++ case $- in
+++ return
++ '[' -d /home/daniel/bin ']'
++ '[' -d /home/daniel/.local/bin ']'
++ PATH=/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
++ PATH=/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/daniel/.local/bin
++ PATH=/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/daniel/.local/bin:/home/daniel/.local/bin
++ PATH=/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/daniel/.local/bin:/home/daniel/.local/bin:/home/daniel/.local/bin
++ PATH=/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/daniel/.local/bin:/home/daniel/.local/bin:/home/daniel/.local/bin:/home/daniel/.local/bin
++ PATH=/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/daniel/.local/bin:/home/daniel/.local/bin:/home/daniel/.local/bin:/home/daniel/.local/bin:/home/daniel/.local/bin
+ source /etc/os-release
++ PRETTY_NAME='Raspbian GNU/Linux 12 (bookworm)'
++ NAME='Raspbian GNU/Linux'
++ VERSION_ID=12
++ VERSION='12 (bookworm)'
++ VERSION_CODENAME=bookworm
++ ID=raspbian
++ ID_LIKE=debian
++ HOME_URL=http://www.raspbian.org/
++ SUPPORT_URL=http://www.raspbian.org/RaspbianForums
++ BUG_REPORT_URL=http://www.raspbian.org/RaspbianBugs
+ [[ raspbian == \d\e\b\i\a\n ]]
+ [[ raspbian == \r\a\s\p\b\i\a\n ]]
+ '[' bookworm == bookworm ']'
+ sudo apt install -y meson python3-netifaces gstreamer1.0-libcamera
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
meson is already the newest version (1.0.1-5).
python3-netifaces is already the newest version (0.11.0-2+b1).
gstreamer1.0-libcamera is already the newest version (0.3.2+rpt20240927-1).
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ '[' raspbian == ubuntu ']'
+ DISABLE_MAVNATIVE=True
+ pip3 install --upgrade pymavlink --user --break-system-packages
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pymavlink in /home/daniel/.local/lib/python3.11/site-packages (2.4.41)
Requirement already satisfied: future in /home/daniel/.local/lib/python3.11/site-packages (from pymavlink) (1.0.0)
Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from pymavlink) (4.9.2)
+ sudo apt-get install -y gpsbabel zip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gpsbabel is already the newest version (1.8.0+ds-5+rpi1).
zip is already the newest version (3.0-13).
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ curl -s https://install.zerotier.com
+ sudo bash

*** ZeroTier Service Quick Install for Unix-like Systems

*** Tested OSes / distributions:

***   MacOS (10.13+) (just installs ZeroTier One.pkg)
***   Debian Linux (7+)
***   RedHat/CentOS Linux (6+)
***   Fedora Linux (16+)
***   SuSE Linux (12+)
***   Mint Linux (20+)
***   Kali Linux (2024.1+)

*** Supported architectures vary by OS / distribution. We try to support
*** every system architecture supported by the target.

*** Please report problems by opening a GitHub issue or Pull Request at:
*** https://github.com/zerotier/install.zerotier.com
*** Please include the content of `/etc/os-release` for your distribution.

*** ZeroTier appears to already be installed.
+ sudo apt install -y wireguard wireguard-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
wireguard is already the newest version (1.0.20210914-1).
wireguard-tools is already the newest version (1.0.20210914-1).
The following packages were automatically installed and are no longer required:
  libmbim-glib4 libmbim-proxy libmbim-utils libqmi-glib5 libqmi-proxy libqmi-utils libqrtr-glib0
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
stephendade commented 1 month ago

Thanks! merging...