Skip to content

Commit

Permalink
#440: give modinfo a base dir, try both system and bundled lib
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemarsden committed Aug 2, 2018
1 parent 34c8d17 commit 0e6ba8e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmd/dotmesh-server/require_zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,25 @@ else
fi
fi

KERNEL_ZFS_VERSION=$(modinfo -F version zfs)
# System takes precedence over bundled version - if there is a
# system version, we'll use it
KERNEL_ZFS_VERSION=$(modinfo -F version -b /system-lib zfs ||true)
if [ -z "KERNEL_ZFS_VERSION" ]; then
KERNEL_ZFS_VERSION=$(modinfo -F version -b /bundled-lib zfs ||true)
echo "Using bundled ZFS kernel version $KERNEL_ZFS_VERSION"
else
echo "Using system ZFS kernel version $KERNEL_ZFS_VERSION"
fi

if [[ "$KERNEL_ZFS_VERSION" == "0.6"* ]]; then
echo "Detected ZFS 0.6 kernel modules ($KERNEL_ZFS_VERSION), using matching userland"
export ZFS_USERLAND_ROOT=/opt/zfs-0.6
elif [[ "$KERNEL_ZFS_VERSION" == "0.7"* ]]; then
echo "Detected ZFS 0.7 kernel modules ($KERNEL_ZFS_VERSION), using matching userland"
export ZFS_USERLAND_ROOT=/opt/zfs-0.7
else
echo "Kernel ZFS version doesn't match 0.6 or 0.7, not supported"
exit 1
fi

POOL_LOGFILE=$DIR/dotmesh_pool_log
Expand Down

0 comments on commit 0e6ba8e

Please sign in to comment.