Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

refactor: zfs version patch logic is more correct #14

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions build-kmod-zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ curl -L -O https://github.com/openzfs/zfs/releases/download/zfs-${ZFS_VERSION}/z
tar xzf zfs-${ZFS_VERSION}.tar.gz

# patch the zfs-kmod.spec.in file for older zfs versions
ZFS_MAJ=$(echo $ZFS_VERSION | cut -f1 -d.)
ZFS_MIN=$(echo $ZFS_VERSION | cut -f2 -d.)
ZFS_PATCH=$(echo $ZFS_VERSION | cut -f3 -d.)
if [ "${ZFS_MIN}" -lt "3" ]; then
if [ "${ZFS_PATCH}" -lt "3" ]; then
patch -b -uN -i zfs-kmod-spec-in.patch zfs-${ZFS_VERSION}/rpm/generic/zfs-kmod.spec.in
fi
DO_PATCH=1
if [ "${ZFS_MAJ}" -lt "2" ]; then
DO_PATCH=0
elif [ "${ZFS_MAJ}" -eq "2" ] && [ "${ZFS_MIN}" -lt "2" ]; then
DO_PATCH=0
elif [ "${ZFS_MAJ}" -eq "2" ] && [ "${ZFS_MIN}" -eq "2" ] && [ "${ZFS_PATCH}" -lt "3" ]; then
DO_PATCH=0
fi
if [ "${DO_PATCH}" -eq "0" ]; then
patch -b -uN -i zfs-kmod-spec-in.patch zfs-${ZFS_VERSION}/rpm/generic/zfs-kmod.spec.in
fi

cd /tmp/zfs-${ZFS_VERSION}
./configure \
-with-linux=/usr/src/kernels/${KERNEL}/ \
Expand Down
Loading