From c2d9875782af28a79919833b0a480bddfe277740 Mon Sep 17 00:00:00 2001 From: "thorsten.spille" Date: Wed, 6 Sep 2023 14:10:22 +0200 Subject: [PATCH] Fix architecture for znapzend rebuild --- setup-nasbeery | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup-nasbeery b/setup-nasbeery index 3e1a762..3b3085c 100644 --- a/setup-nasbeery +++ b/setup-nasbeery @@ -127,16 +127,18 @@ apt -qq update echo "Installing samba" DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt -y -qq -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" install -t bullseye-backports acl samba-dsdb-modules samba-vfs-modules samba winbind wsdd zfs-dkms zfsutils-linux zfs-auto-snapshot -if [[ "$(arch)" == "aarch64" ]]; then +ARCH=$(arch) + +if [[ "${ARCH}" == "aarch64" ]] || [[ "${ARCH}" == "riscv64" ]]; then znapzend_version=$(apt search znapzend 2>/dev/null | grep znapzend | cut -d ' ' -f2) wget -O znapzend_${znapzend_version}_amd64.deb https://repo.45drives.com/debian/pool/main/z/znapzend/znapzend_${znapzend_version}_amd64.deb mkdir znapzend dpkg-deb -R znapzend_${znapzend_version}_amd64.deb ./znapzend - sed -i "s/amd64/arm64/g" ./znapzend/DEBIAN/control - sed -i "s/x86_64-linux-gnu/aarch64-linux-gnu/g" znapzend/usr/bin/* - mv znapzend/usr/lib/x86_64-linux-gnu znapzend/usr/lib/aarch64-linux-gnu - dpkg-deb -b znapzend znapzend_${znapzend_version}_arm64.deb - apt install ./znapzend_${znapzend_version}_arm64.deb + sed -i "s/amd64/${ARCH}/g" ./znapzend/DEBIAN/control + sed -i "s/x86_64-linux-gnu/${ARCH}-linux-gnu/g" znapzend/usr/bin/* + mv znapzend/usr/lib/x86_64-linux-gnu znapzend/usr/lib/${ARCH}-linux-gnu + dpkg-deb -b znapzend znapzend_${znapzend_version}_${ARCH}.deb + apt install ./znapzend_${znapzend_version}_${ARCH}.deb systemctl disable znapzend.service rm -r znapzend* fi