Whamcloud - gitweb
LU-9731 kmods need to be limited to EL minor release kernel
[fs/lustre-release.git] / contrib / lbuild / lbuild
index 3562c9c..0cf39ba 100755 (executable)
@@ -933,6 +933,16 @@ build_lustre() {
 
     ./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."
 
@@ -1009,14 +1019,16 @@ build_spl_zfs() {
 
         # 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