Whamcloud - gitweb
LU-11720 spec: srpm should be free of kernel requiements 68/34268/2
authorNathaniel Clark <nclark@whamcloud.com>
Mon, 3 Dec 2018 19:04:37 +0000 (14:04 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Feb 2019 05:10:04 +0000 (05:10 +0000)
This moves the fix for LU-9731 into spec file and out of lbuild.
This lets "make rpms" benefit from the fix.
This also prevents the srpm from being incorrectly locked to the
kernel present when lbuild was used to create it (via
kmp-lustre.preamble).

Test-Parameters: trivial

Lustre-change: https://review.whamcloud.com/33771
Lustre-commit: 3c280a95736a884bc2f36dad674505f1d5b00982

Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Change-Id: I15f61c0e37182c0efbea3566d43b1e89f180d3e5
Tested-by: Jenkins
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34268
Tested-by: Maloo <maloo@whamcloud.com>
contrib/lbuild/lbuild-rhel7
lustre.spec.in

index bf254e3..5149d26 100644 (file)
@@ -121,16 +121,6 @@ cleanup_rpmmacros() {
 }
 
 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
-    # 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 $PATCHLESS; then
         # don't allow the patched kernel to be considered as a valid kernel
         # for the patchless client
index f43c7f7..742f006 100644 (file)
@@ -164,7 +164,27 @@ BuildRequires: systemd
 Userspace tools and files for the Lustre file system.
 
 %if %{with lustre_modules}
-%kernel_module_package -n %{name} -p %SOURCE1 -f %SOURCE2 default
+%if 0%{?rhel} == 7
+# 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
+# this is true for el7.0 through el7.4
+%define preamble %{expand:%(
+TMPFILE=`mktemp`
+cat %{SOURCE1} > $TMPFILE
+kver=%{kver}
+linuxversion=${kver%%%%-*}
+linuxrelease=${kver##*-}
+kabiminor=${linuxrelease%%%%.*}
+echo "Requires:       kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
+echo $TMPFILE
+)}
+%else
+%define preamble %{SOURCE1}
+%endif
+%kernel_module_package -n %{name} -p %preamble -f %SOURCE2 default
 
 %if %{with ldiskfs}
 %kernel_module_package -n %{name}-osd-ldiskfs -p %SOURCE3 -f %SOURCE4 default