From: Nathaniel Clark Date: Mon, 3 Dec 2018 19:04:37 +0000 (-0500) Subject: LU-11720 spec: srpm should be free of kernel requiements X-Git-Tag: 2.12.52~105 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3c280a95736a884bc2f36dad674505f1d5b00982;hp=22ea5c8edfc9608ee5be056b61dd9fc000865791 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 Signed-off-by: Nathaniel Clark Change-Id: I15f61c0e37182c0efbea3566d43b1e89f180d3e5 Reviewed-on: https://review.whamcloud.com/33771 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Gu Zheng Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/contrib/lbuild/lbuild-rhel7 b/contrib/lbuild/lbuild-rhel7 index a66eba4..721d56b 100644 --- a/contrib/lbuild/lbuild-rhel7 +++ b/contrib/lbuild/lbuild-rhel7 @@ -120,16 +120,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 7fe7e9f..8ab88ce 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -176,7 +176,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