From 5fe982690dde421c0108f484ab694d2488c9042b Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Mon, 3 Dec 2018 14:04:37 -0500 Subject: [PATCH 1/1] LU-11720 spec: srpm should be free of kernel requiements 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 Change-Id: I15f61c0e37182c0efbea3566d43b1e89f180d3e5 Tested-by: Jenkins Reviewed-by: Gu Zheng Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/34268 Tested-by: Maloo --- contrib/lbuild/lbuild-rhel7 | 10 ---------- lustre.spec.in | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/contrib/lbuild/lbuild-rhel7 b/contrib/lbuild/lbuild-rhel7 index bf254e3..5149d26 100644 --- a/contrib/lbuild/lbuild-rhel7 +++ b/contrib/lbuild/lbuild-rhel7 @@ -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 diff --git a/lustre.spec.in b/lustre.spec.in index f43c7f7..742f006 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -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 -- 1.8.3.1