From 950c511276866efb6af8defe49213fd69b8883d2 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Tue, 25 Jul 2017 08:02:24 -0400 Subject: [PATCH] LU-9731 Limit work-around to EL7 only Since the workaround previously landed for LU-9731 only applies to EL7, only apply it for EL7 builds. Signed-off-by: Brian J. Murrell Change-Id: Id74f03f3af74f324320e094e32f7b7480259145c Reviewed-on: https://review.whamcloud.com/28202 Reviewed-by: Minh Diep Tested-by: Jenkins Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Oleg Drokin --- contrib/lbuild/lbuild | 15 +++++---------- contrib/lbuild/lbuild-rhel7 | 13 +++++++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/contrib/lbuild/lbuild b/contrib/lbuild/lbuild index 0cf39ba..8be0cfa 100755 --- a/contrib/lbuild/lbuild +++ b/contrib/lbuild/lbuild @@ -933,16 +933,11 @@ 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 + + if type -p apply_kmod_requires; then + apply_kmod_requires + fi + make rpms 2>&1 || fatal 1 "Error building rpms for $BUILD_ARCHS." diff --git a/contrib/lbuild/lbuild-rhel7 b/contrib/lbuild/lbuild-rhel7 index 68c2400..d824b5b 100644 --- a/contrib/lbuild/lbuild-rhel7 +++ b/contrib/lbuild/lbuild-rhel7 @@ -108,3 +108,16 @@ kernel_srpm_location() { cleanup_rpmmacros() { sed -i "/^%kernel_module_package/,/^)}$/d" $RMAC } + +apply_kmod_requires() { + # 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 +} -- 1.8.3.1