Whamcloud - gitweb
LU-9850 patchless client should conflict patched kernel 57/28557/3
authorBrian J. Murrell <brian.murrell@intel.com>
Wed, 9 Aug 2017 15:09:44 +0000 (11:09 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 17 Aug 2017 17:37:54 +0000 (17:37 +0000)
Due to how dependencies work in RPM (and a bug in how kmod RPMs generate
their dependency lists), on a node where the server and client repos are
both configured, YUM could allow the patched kernel to satisfy the
patchless-client RPM's requirements.

Add Conflicts: and Provides: to the kernel RPM and lustre-client RPM to
prevent this from happening.

This change also allows one to force the installation of the patched
kernel RPM (yum install kernel-lustre) if one desires.

Test-Parameters: trivial

Signed-off-by: Brian J. Murrell <brian.murrell@intel.com>
Change-Id: If9c44a93937cd7603b0246676ebc9c8260a43b11
Reviewed-on: https://review.whamcloud.com/28557
Tested-by: Jenkins
Reviewed-by: Minh Diep <minh.diep@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
contrib/lbuild/lbuild
contrib/lbuild/lbuild-rhel
contrib/lbuild/lbuild-rhel7

index 99dd601..bf9e754 100755 (executable)
@@ -934,8 +934,8 @@ build_lustre() {
     ./configure $configure_args $CONFIGURE_FLAGS 2>&1 ||
         fatal 1 "Error in configure."
 
-    if type -p apply_kmod_requires; then
-        apply_kmod_requires
+    if type -p apply_kmod_requires_conflicts; then
+        apply_kmod_requires_conflicts
     fi
 
     make rpms 2>&1 ||
index 8f20270..a2b0475 100644 (file)
@@ -6,7 +6,8 @@
 # in build/lbuild)
 #BUILD_GEN+=".0"
 #BUILD_GEN+=".1"       # refactor both rhel5 and rhel6
-BUILD_GEN+=".0"        # TT-107: don't cache the BUILD dir (reset major to 5)
+#BUILD_GEN+=".0"       # TT-107: don't cache the BUILD dir (reset major to 5)
+BUILD_GEN+=".2"        # LU-9850
 
 DEVEL_KERNEL_TYPE="devel"
 RPM_HELPERS_DIR="/usr/lib/rpm/redhat"
@@ -21,7 +22,11 @@ get_rpmbuildopts() {
 # patching common to all releases
 patch_spec_common() {
 
-    sed -i -e '/find $RPM_BUILD_ROOT\/lib\/modules\/$KernelVer/a\
+    sed -i -e '/Provides: kernel-uname-r =/a\
+Provides: kernel-lustre = %{KVRA}%{?1:.%{1}}\\' \
+           -e '/Provides: kernel-devel-uname-r =/a\
+Provides: kernel-devel-lustre = %{KVRA}%{?1:.%{1}}\\' \
+           -e '/find $RPM_BUILD_ROOT\/lib\/modules\/$KernelVer/a\
     cp -a fs/ext3/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext3 \
     cp -a fs/ext4/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext4' \
           SPECS/$SPEC_NAME 2>&1 || \
index d824b5b..6045984 100644 (file)
@@ -109,7 +109,7 @@ cleanup_rpmmacros() {
        sed -i "/^%kernel_module_package/,/^)}$/d" $RMAC
 }
 
-apply_kmod_requires() {
+apply_kmod_requires_conflicts() {
     # 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
@@ -120,4 +120,9 @@ apply_kmod_requires() {
     local linuxrelease=${kver##*-}
     local kabiminor=${linuxrelease%%.*}
     echo "Requires:       kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> rpm/kmp-lustre.preamble
+    if $PATCHLESS; then
+        # don't allow the patched kernel to be considered as a valid kernel
+        # for the patchless client
+        echo "Conflicts:      kernel-lustre" >> rpm/kmp-lustre.preamble
+    fi
 }