From 141ba0ffdea822d2f487ba898ac2b0d0412c7346 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sat, 8 May 2021 10:58:12 -0400 Subject: [PATCH] libseccomp2 --- scripts/subinstallers/docker_manual.sh | 5 +++ scripts/subinstallers/docker_raspbian.sh | 40 ++++++++++++++++++++++++ 2 files changed, 45 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..29c1350 --- /dev/null +++ b/scripts/subinstallers/docker_raspbian.sh @@ -0,0 +1,40 @@ +#!/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_VERSION=$(sudo -E apt-cache policy libseccomp2 | egrep ^\ *Inst | awk '{print $2}') + +if [ compare_version "$LIBSECCOMP2_VERSION" "<" "2.5.1-1" ]; then + # this is dumb but the raspbian repo managers aren't impressive + pushd . + cd /tmp + wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb + sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb + popd +fi