From 141ba0ffdea822d2f487ba898ac2b0d0412c7346 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sat, 8 May 2021 10:58:12 -0400 Subject: [PATCH 1/5] 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 From 4e3135d0d53623f83a49178ad49da3516e360fdb Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sat, 8 May 2021 11:01:12 -0400 Subject: [PATCH 2/5] syntax --- scripts/subinstallers/docker_raspbian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/subinstallers/docker_raspbian.sh b/scripts/subinstallers/docker_raspbian.sh index 29c1350..d4f7405 100755 --- a/scripts/subinstallers/docker_raspbian.sh +++ b/scripts/subinstallers/docker_raspbian.sh @@ -30,7 +30,7 @@ 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 +if [ $(compare_version "$LIBSECCOMP2_VERSION" "<" "2.5.1-1") -eq 0 ]; then # this is dumb but the raspbian repo managers aren't impressive pushd . cd /tmp From c13df241b5287b2fb8d18df6c57915b0a9eabdbe Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sat, 8 May 2021 11:54:23 -0400 Subject: [PATCH 3/5] bash fcn --- scripts/subinstallers/docker_raspbian.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/subinstallers/docker_raspbian.sh b/scripts/subinstallers/docker_raspbian.sh index d4f7405..797de92 100755 --- a/scripts/subinstallers/docker_raspbian.sh +++ b/scripts/subinstallers/docker_raspbian.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set +e compare_version() { local versionOne="${1}" @@ -28,9 +28,12 @@ compare_version() { return ${returncode} } # end of function compare_version +# libseccomp2 LIBSECCOMP2_VERSION=$(sudo -E apt-cache policy libseccomp2 | egrep ^\ *Inst | awk '{print $2}') -if [ $(compare_version "$LIBSECCOMP2_VERSION" "<" "2.5.1-1") -eq 0 ]; then +compare_version $LIBSECCOMP2_VERSION '<' '2.5.1-1' + +if [ $? -eq 0 ]; then # this is dumb but the raspbian repo managers aren't impressive pushd . cd /tmp From 1bfed78f17fac8bdde007148426a28913f4e6419 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sat, 8 May 2021 11:55:24 -0400 Subject: [PATCH 4/5] msg --- scripts/subinstallers/docker_raspbian.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/subinstallers/docker_raspbian.sh b/scripts/subinstallers/docker_raspbian.sh index 797de92..6a5e6ad 100755 --- a/scripts/subinstallers/docker_raspbian.sh +++ b/scripts/subinstallers/docker_raspbian.sh @@ -35,6 +35,7 @@ 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_armhf.deb From b06f55a33cad4509203bf7e6f42f5c97b0ce1caf Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Sat, 8 May 2021 12:15:04 -0400 Subject: [PATCH 5/5] no arch --- scripts/subinstallers/docker_raspbian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/subinstallers/docker_raspbian.sh b/scripts/subinstallers/docker_raspbian.sh index 6a5e6ad..8ecda9c 100755 --- a/scripts/subinstallers/docker_raspbian.sh +++ b/scripts/subinstallers/docker_raspbian.sh @@ -38,7 +38,7 @@ if [ $? -eq 0 ]; then echo "Installing newer libseccomp2" 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 + 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