Whamcloud - gitweb
LU-12068 tests: add debug for sanity-lfsck test_6b
[fs/lustre-release.git] / lustre.spec.in
index 322c0fa..75a705c 100644 (file)
@@ -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
@@ -374,23 +394,26 @@ echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
 # systemd is on redhat, fedora, and suse
 %if %{with systemd}
 echo '%{_unitdir}/lnet.service' >>lustre.files
+echo '%{_unitdir}/lustre.service' >>lustre.files
 %endif
 
 %if %{_vendor}=="redhat"
 # The following scripts are Red Hat specific
 %if %{with servers}
-echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
 %if %{with gss_keyring}
 echo '%{_sysconfdir}/init.d/lsvcgss' >>lustre.files
 echo '%{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files
-echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
 %endif
 %endif
 
 %if %{without systemd}
 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
+echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
+%endif
 %endif
+%if %{with gss_keyring}
+echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
 %endif
 
 # fc18 needs 'x' permission for library files
@@ -550,15 +573,18 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files
 %post
 %if %{with systemd}
 %systemd_post lnet.service
+%systemd_post lustre.service
 %endif
 
 %preun
 %if %{with systemd}
+%systemd_preun lustre.service
 %systemd_preun lnet.service
 %endif
 
 %postun
 %if %{with systemd}
+%systemd_postun_with_restart lustre.service
 %systemd_postun_with_restart lnet.service
 %endif