From 99095f596dc23b2f360d3623551946003cac0773 Mon Sep 17 00:00:00 2001 From: Marcel Stangenberger Date: Sat, 19 Apr 2025 14:28:34 +0200 Subject: [PATCH] First attempt --- zfs/install.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 zfs/install.sh diff --git a/zfs/install.sh b/zfs/install.sh new file mode 100644 index 0000000..b149dbe --- /dev/null +++ b/zfs/install.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Setup build environment +if [ ! -d "/opt/build" ] +then + mkdir -p /opt/build +fi +chown -R sysadmin:admins /opt/build + +# Build and install +su sysadmin -c "git clone https://git.xoservice.nl/marcel/aur_zfs-utils.git /opt/build/zfs-utils" +su sysadmin -c "git clone https://git.xoservice.nl/marcel/aur_openzfs.git /opt/build/openzfs" + +BUILDVER=$(cat /opt/build/openzfs/PKGBUILD | grep _kernelver_full | cut -f 2 -d \") +KERNVER=$(uname -r) + +if [ ! "$BUILDVER-lts" == "$KERNVER" ] +then + echo "Kernel version not supported." + echo "Version $KERNVER found." + echo "Version $BUILDVER required." + exit +else + su sysadmin -c "cd /opt/build/zfs-utils && makepkg --noconfirm -si" + su sysadmin -c "cd /opt/build/openzfs && makepkg --noconfirm ---skipchecksums --skipgpgcheck -si" + echo "zfs" > /etc/modules-load.d/zfs.conf +fi