From e655a71db3cc8cf914a44c3056e3638782165ac4 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sat, 8 May 2021 16:35:30 +0000 Subject: [PATCH] Resolve "PostgresSQL not avaiable" --- scripts/subinstallers/docker_manual.sh | 5 +++ scripts/subinstallers/docker_raspbian.sh | 44 ++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 scripts/subinstallers/docker_raspbian.sh diff --git a/scripts/subinstallers/docker_manual.sh b/scripts/subinstallers/docker_manual.sh index 2d02ddb..2e065be 100755 --- a/scripts/subinstallers/docker_manual.sh +++ b/scripts/subinstallers/docker_manual.sh @@ -67,3 +67,8 @@ echo "Installing Docker Compose" sudo pip3 install cryptography==3.3.2 docker-compose #fi + +# check raspbian fixes +if [ "$DISTRO" == "raspbian" ] || [ "$DISTRO" == "raspios" ]; then + source ./scripts/subinstallers/docker_raspbian.sh +fi diff --git a/scripts/subinstallers/docker_raspbian.sh b/scripts/subinstallers/docker_raspbian.sh new file mode 100755 index 0000000..8ecda9c --- /dev/null +++ b/scripts/subinstallers/docker_raspbian.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set +e + +compare_version() { + local versionOne="${1}" + local comparision="${2}" + local versionTwo="${3}" + local result= + local sortOpt= + local returncode=1 + + if [[ "${versionOne}" == "${versionTwo}" ]] ; then + return 3 + fi + + case ${comparision} in + lower|smaller|older|lt|"<" ) sortOpt= ;; + higher|bigger|newer|bt|">" ) sortOpt='r' ;; + * ) return 2 ;; + esac + + result=($(printf "%s\n" "${versionOne}" "${versionTwo}" | sort -${sortOpt}V )) + if [[ "${versionOne}" == "${result[0]}" ]] ; then + returncode=0 + fi + + return ${returncode} +} # end of function compare_version + +# libseccomp2 +LIBSECCOMP2_VERSION=$(sudo -E apt-cache policy libseccomp2 | egrep ^\ *Inst | awk '{print $2}') + +compare_version $LIBSECCOMP2_VERSION '<' '2.5.1-1' + +if [ $? -eq 0 ]; then + # this is dumb but the raspbian repo managers aren't impressive + echo "Installing newer libseccomp2" + pushd . + cd /tmp + wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_$(dpkg --print-architecture).deb + sudo dpkg -i libseccomp2_2.5.1-1_$(dpkg --print-architecture).deb + popd +fi