From b39463f39a7fcb4e715a114145e3348f9335dde1 Mon Sep 17 00:00:00 2001 From: Aaron W Morris Date: Mon, 9 Oct 2023 11:14:42 -0400 Subject: [PATCH] Debian 12 updates --- README.md | 1 + misc/build_indi.sh | 49 ++++++++++- misc/setup_gpsd.sh | 18 +++- misc/setup_hotspot.sh | 16 +++- misc/setup_mosquitto.sh | 24 +++++- misc/setup_rtc_i2c.sh | 13 ++- misc/setup_usb_automount.sh | 21 ++++- misc/upgrade_web.sh | 32 ++++++- setup.sh | 164 +++++++++++++++++++++++++++++++++++- 9 files changed, 329 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b88092925..cf4824dc2 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ https://github.com/aaronwmorris/indi-allsky/wiki/FAQ | Raspbian 11 32-bit | armhf | Compile indi with build_indi.sh | | Raspbian 10 (Legacy) | armhf | (NOT RECOMMENDED) Compile indi with build_indi.sh | | Armbian | aarch64/armhf | Compile indi with build_indi.sh
https://github.com/aaronwmorris/indi-allsky/wiki/Armbian-Tuning | +| Debian 12 | x86_64 | Compile indi with build_indi.sh | | Debian 11 | x86_64 | Compile indi with build_indi.sh | | Debian 10 | x86_64 | (NOT RECOMMENDED) Compile indi with build_indi.sh | | Ubuntu 22.04 | aarch64 | Indi installed from ppa:mutlaqja/ppa | diff --git a/misc/build_indi.sh b/misc/build_indi.sh index 0f9e67dc7..3757e2e59 100755 --- a/misc/build_indi.sh +++ b/misc/build_indi.sh @@ -132,7 +132,54 @@ START_TIME=$(date +%s) echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + BLOCKING_PACKAGES="indi-full libindi-data libindi-dev libindi-plugins" + for p in $BLOCKING_PACKAGES; do + if dpkg -s "$p" >/dev/null 2>&1; then + echo + echo + echo "Package $p needs to be uninstalled" + echo + exit 1 + fi + done + + sudo apt-get update + sudo apt-get -y install \ + build-essential \ + git \ + ca-certificates \ + cmake \ + fxload \ + pkg-config \ + libavcodec-dev \ + libavdevice-dev \ + libboost-dev \ + libboost-regex-dev \ + libcfitsio-dev \ + libcurl4-gnutls-dev \ + libdc1394-dev \ + libev-dev \ + libfftw3-dev \ + libftdi1-dev \ + libftdi-dev \ + libgmock-dev \ + libgphoto2-dev \ + libgps-dev \ + libgsl-dev \ + libjpeg-dev \ + liblimesuite-dev \ + libnova-dev \ + libraw-dev \ + librtlsdr-dev \ + libtheora-dev \ + libtiff-dev \ + libusb-1.0-0-dev \ + libnutclient-dev \ + zlib1g-dev + + +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then BLOCKING_PACKAGES="indi-full libindi-data libindi-dev libindi-plugins" for p in $BLOCKING_PACKAGES; do if dpkg -s "$p" >/dev/null 2>&1; then diff --git a/misc/setup_gpsd.sh b/misc/setup_gpsd.sh index b4f48f669..0408d7879 100755 --- a/misc/setup_gpsd.sh +++ b/misc/setup_gpsd.sh @@ -67,7 +67,15 @@ sudo true echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + sudo apt-get update + sudo apt-get -y install \ + telnet \ + gpsd \ + gpsd-tools \ + gpsd-clients + +elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update sudo apt-get -y install \ telnet \ @@ -83,6 +91,14 @@ elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "10" ]]; then gpsd-tools \ gpsd-clients +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then + sudo apt-get update + sudo apt-get -y install \ + telnet \ + gpsd \ + gpsd-tools \ + gpsd-clients + elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update sudo apt-get -y install \ diff --git a/misc/setup_hotspot.sh b/misc/setup_hotspot.sh index a922a7241..f9d73c0f1 100755 --- a/misc/setup_hotspot.sh +++ b/misc/setup_hotspot.sh @@ -79,7 +79,14 @@ sudo true echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + + sudo apt-get update + sudo apt-get -y install \ + network-manager \ + tzdata + +elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update sudo apt-get -y install \ @@ -93,6 +100,13 @@ elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "10" ]]; then network-manager \ tzdata +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then + + sudo apt-get update + sudo apt-get -y install \ + network-manager \ + tzdata + elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update diff --git a/misc/setup_mosquitto.sh b/misc/setup_mosquitto.sh index 12c4017b4..79d9f02a5 100755 --- a/misc/setup_mosquitto.sh +++ b/misc/setup_mosquitto.sh @@ -52,7 +52,18 @@ sudo true echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + #MOSQUITTO_USER=mosquitto + MOSQUITTO_GROUP=mosquitto + + sudo apt-get update + sudo apt-get -y install \ + mosquitto \ + mosquitto-clients \ + mosquitto-dev \ + ca-certificates + +elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then #MOSQUITTO_USER=mosquitto MOSQUITTO_GROUP=mosquitto @@ -74,6 +85,17 @@ elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "10" ]]; then mosquitto-dev \ ca-certificates +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then + #MOSQUITTO_USER=mosquitto + MOSQUITTO_GROUP=mosquitto + + sudo apt-get update + sudo apt-get -y install \ + mosquitto \ + mosquitto-clients \ + mosquitto-dev \ + ca-certificates + elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "11" ]]; then #MOSQUITTO_USER=mosquitto MOSQUITTO_GROUP=mosquitto diff --git a/misc/setup_rtc_i2c.sh b/misc/setup_rtc_i2c.sh index 7b7178a26..d4e57409f 100755 --- a/misc/setup_rtc_i2c.sh +++ b/misc/setup_rtc_i2c.sh @@ -57,17 +57,26 @@ sudo true echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + sudo apt-get update + sudo apt-get -y install \ + i2c-tools + +elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update sudo apt-get -y install \ i2c-tools - elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "10" ]]; then sudo apt-get update sudo apt-get -y install \ i2c-tools +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then + sudo apt-get update + sudo apt-get -y install \ + i2c-tools + elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update sudo apt-get -y install \ diff --git a/misc/setup_usb_automount.sh b/misc/setup_usb_automount.sh index 77a24d43f..ff1c88d12 100755 --- a/misc/setup_usb_automount.sh +++ b/misc/setup_usb_automount.sh @@ -60,7 +60,17 @@ sudo true echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + + sudo apt-get update + sudo apt-get -y install \ + udisks2 \ + udiskie \ + exfatprogs \ + dosfstools + + +elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update sudo apt-get -y install \ @@ -78,6 +88,15 @@ elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "10" ]]; then exfat-utils \ dosfstools +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then + + sudo apt-get update + sudo apt-get -y install \ + udisks2 \ + udiskie \ + exfatprogs \ + dosfstools + elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "11" ]]; then sudo apt-get update diff --git a/misc/upgrade_web.sh b/misc/upgrade_web.sh index 4a750428c..60fe7eadf 100755 --- a/misc/upgrade_web.sh +++ b/misc/upgrade_web.sh @@ -90,7 +90,22 @@ START_TIME=$(date +%s) echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + PYTHON_BIN=python3 + + if [ "$CPU_ARCH" == "armv7l" ]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + elif [ "$CPU_ARCH" == "i686" ]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + elif [[ "$CPU_ARCH" == "aarch64" && "$CPU_BITS" == "32" ]]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + elif [[ "$CPU_ARCH" == "x86_64" && "$CPU_BITS" == "32" ]]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + else + VIRTUALENV_REQ=requirements/requirements_latest.txt + fi + +elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then PYTHON_BIN=python3 if [ "$CPU_ARCH" == "armv7l" ]; then @@ -110,6 +125,21 @@ elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "10" ]]; then VIRTUALENV_REQ=requirements/requirements_debian10.txt +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then + PYTHON_BIN=python3 + + if [ "$CPU_ARCH" == "armv7l" ]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + elif [ "$CPU_ARCH" == "i686" ]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + elif [[ "$CPU_ARCH" == "aarch64" && "$CPU_BITS" == "32" ]]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + elif [[ "$CPU_ARCH" == "x86_64" && "$CPU_BITS" == "32" ]]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + else + VIRTUALENV_REQ=requirements/requirements_latest.txt + fi + elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "11" ]]; then PYTHON_BIN=python3 diff --git a/setup.sh b/setup.sh index 7b57d4c06..0db3c8f33 100755 --- a/setup.sh +++ b/setup.sh @@ -299,7 +299,169 @@ sudo find "$(dirname "$0")" -type f ! -perm -444 -exec chmod ugo+r {} \; echo "**** Installing packages... ****" -if [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then +if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "12" ]]; then + DEBIAN_DISTRO=1 + REDHAT_DISTRO=0 + + RSYSLOG_USER=root + RSYSLOG_GROUP=adm + + MYSQL_ETC="/etc/mysql" + + PYTHON_BIN=python3 + + if [ "$CPU_ARCH" == "armv7l" ]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + VIRTUALENV_REQ_POST=requirements/requirements_latest_32_post.txt + elif [ "$CPU_ARCH" == "armv6l" ]; then + VIRTUALENV_REQ=requirements/requirements_latest_armv6l.txt + VIRTUALENV_REQ_POST=requirements/requirements_latest_32_post.txt + elif [ "$CPU_ARCH" == "i686" ]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + VIRTUALENV_REQ_POST=requirements/requirements_latest_32_post.txt + elif [[ "$CPU_ARCH" == "aarch64" && "$CPU_BITS" == "32" ]]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + VIRTUALENV_REQ_POST=requirements/requirements_latest_32_post.txt + elif [[ "$CPU_ARCH" == "x86_64" && "$CPU_BITS" == "32" ]]; then + VIRTUALENV_REQ=requirements/requirements_latest_32.txt + VIRTUALENV_REQ_POST=requirements/requirements_latest_32_post.txt + else + VIRTUALENV_REQ=requirements/requirements_latest.txt + VIRTUALENV_REQ_POST=requirements/requirements_empty.txt + fi + + + # reconfigure system timezone + if [ -n "${INDIALLSKY_TIMEZONE:-}" ]; then + # this is not validated + echo + echo "Setting timezone to $INDIALLSKY_TIMEZONE" + echo "$INDIALLSKY_TIMEZONE" | sudo tee /etc/timezone + sudo dpkg-reconfigure -f noninteractive tzdata + else + sudo dpkg-reconfigure tzdata + fi + + + INSTALL_INDI="false" + + if [[ ! -f "${INDI_DRIVER_PATH}/indiserver" && ! -f "/usr/local/bin/indiserver" ]]; then + echo + echo + echo "There are not prebuilt indi packages for this distribution" + echo "Please run ./misc/build_indi.sh before running setup.sh" + echo + echo + exit 1 + fi + + + sudo apt-get update + sudo apt-get -y install \ + build-essential \ + python3 \ + python3-dev \ + python3-venv \ + python3-pip \ + virtualenv \ + cmake \ + gfortran \ + whiptail \ + rsyslog \ + cron \ + git \ + cpio \ + tzdata \ + ca-certificates \ + avahi-daemon \ + apache2 \ + swig \ + libatlas-base-dev \ + libilmbase-dev \ + libopenexr-dev \ + libgtk-3-0 \ + libssl-dev \ + libxml2-dev \ + libxslt-dev \ + libgnutls28-dev \ + libcurl4-gnutls-dev \ + libcfitsio-dev \ + libnova-dev \ + libdbus-1-dev \ + libglib2.0-dev \ + libffi-dev \ + libopencv-dev \ + libopenblas-dev \ + libraw-dev \ + libgeos-dev \ + libtiff5-dev \ + libjpeg62-turbo-dev \ + libopenjp2-7-dev \ + zlib1g-dev \ + libfreetype6-dev \ + liblcms2-dev \ + libwebp-dev \ + tcl8.6-dev \ + tk8.6-dev \ + python3-tk \ + libharfbuzz-dev \ + libfribidi-dev \ + libxcb1-dev \ + default-libmysqlclient-dev \ + pkg-config \ + rustc \ + cargo \ + ffmpeg \ + gifsicle \ + jq \ + sqlite3 \ + policykit-1 \ + dbus-user-session + + + if [[ "$USE_MYSQL_DATABASE" == "true" ]]; then + sudo apt-get -y install \ + mariadb-server + fi + + + if [[ "$INSTALL_INDI" == "true" && -f "/usr/bin/indiserver" ]]; then + if ! whiptail --title "indi software update" --yesno "INDI is already installed, would you like to upgrade the software?" 0 0 --defaultno; then + INSTALL_INDI="false" + fi + fi + + if [[ "$INSTALL_INDI" == "true" ]]; then + sudo apt-get -y install \ + indi-full \ + libindi-dev \ + indi-webcam \ + indi-asi \ + libasi \ + indi-qhy \ + libqhy \ + indi-playerone \ + libplayerone \ + indi-sv305 \ + libsv305 \ + libaltaircam \ + libmallincam \ + libmicam \ + libnncam \ + indi-toupbase \ + libtoupcam \ + indi-gphoto \ + indi-sx \ + indi-gpsd \ + indi-gpsnmea + fi + + if [[ "$INSTALL_LIBCAMERA" == "true" ]]; then + sudo apt-get -y install \ + libcamera-apps + fi + +elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "12" ]]; then DEBIAN_DISTRO=1 REDHAT_DISTRO=0