./configure $configure_args $CONFIGURE_FLAGS 2>&1 ||
fatal 1 "Error in configure."
+ # until we have achieved full kABI compatibility we need to
+ # restrict the kernel range that can be used to the kernel
+ # version from the RHEL minor release
+ # this is supposed to be done for kmods automatically but
+ # RHBZ#1467319 seems to be getting in the way
+ local kver=$(find_linux_release)
+ local linuxversion=${kver%%-*}
+ local linuxrelease=${kver##*-}
+ local kabiminor=${linuxrelease%%.*}
+ echo "Requires: kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> rpm/kmp-lustre.preamble
make rpms 2>&1 ||
fatal 1 "Error building rpms for $BUILD_ARCHS."
# need to fetch the repo in order to build it.
# default to github but allow override
- git clone ${SPLZFSGITREPO:-"https://github.com/zfsonlinux"}/$pkg.git $pkg 2>&1
+ git clone -n ${SPLZFSGITREPO:-"https://github.com/zfsonlinux"}/$pkg.git $pkg 2>&1
- pushd $pkg || return 255
- if [ -n "$SPLZFSTAG" ]; then
- git checkout $SPLZFSTAG
- else
- git checkout -b lbuild $pkg-$SPLZFSVER
- fi
+ pushd $pkg || return 255
+ local tag
+ if [ -n "$SPLZFSTAG" ]; then
+ tag=$SPLZFSTAG
+ else
+ tag=$pkg-$SPLZFSVER
+ fi
+ git checkout -b lbuild $tag || fatal 1 "Failed to checkout \"$tag\" for $pkg.git"
# This differentiates between older zfs versions
if [ -f $pkg-modules.spec.in ]; then