Skip to content

Commit

Permalink
add in checks for arch and prevent upgrade of openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed May 3, 2024
1 parent 7a12c66 commit 188611d
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions build/root/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
# exit script if return code != 0
set -e

# release tag name from buildx arg, stripped of build ver using string manipulation
RELEASETAG="${1//-[0-9][0-9]/}"

# target arch from buildx arg
TARGETARCH="${2}"

if [[ -z "${RELEASETAG}" ]]; then
echo "[warn] Release tag name from build arg is empty, exiting script..."
exit 1
fi

if [[ -z "${TARGETARCH}" ]]; then
echo "[warn] Target architecture name from build arg is empty, exiting script..."
exit 1
fi

# build scripts
####

Expand All @@ -29,8 +45,19 @@ pacman -S --needed $pacman_packages --noconfirm

# workaround to pia related crl malformed validation dates
# this downgrades openssl which ignores the malformed crl validation dates
curl -o /tmp/openssl.zst -L https://archive.archlinux.org/packages/o/openssl/openssl-3.2.1-1-x86_64.pkg.tar.zst
pacman -U /tmp/openssl.zst --noconfirm
if [[ "${TARGETARCH}" == "amd64" ]]; then
curl -o /tmp/openssl.zst -L https://archive.archlinux.org/packages/o/openssl/openssl-3.2.1-1-x86_64.pkg.tar.zst
pacman -U /tmp/openssl.zst --noconfirm
elif [[ "${TARGETARCH}" == "arm64" ]]; then
curl -o /tmp/openssl.tar.xz -L https://mirror.yandex.ru/archlinux-arm/aarch64/core/openssl-3.2.1-1-aarch64.pkg.tar.xz
pacman -U /tmp/openssl.tar.xz --noconfirm
else
echo "[warn] TARGETARCH not supported for openssl downgrade, exiting..."
exit 1
fi

# prevent pacman upgrading openssl (filesystem is from arch-base ignore)
sed -i -e 's~#IgnorePkg.*~IgnorePkg = filesystem openssl~g' '/etc/pacman.conf'

# env vars
####
Expand Down

0 comments on commit 188611d

Please sign in to comment.