All the way back to 2004 Lustre has supported an option to
disable the compilation of the kernel modules. This can be useful
because there are situations where only the user space componets
are required.
For example, when the Lustre kernel modules are either a) provided
by the kernel, or b) proivded as a dkms package. In both of these
cases it's desirable to be able to build the lustre package without
building lustre-modules subpackage.
The patch adds that missing functionality to the existing lustre
spec file by leveraging the existing --disable-modules configure
option.
Additionally, a small fix was made to lustre/quota/autoMakefile.am
because it didn't properly support the --disable-modules option.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: Ic4f4f7f19da9951b47c587399a71c42fb0e720d0
Reviewed-on: http://review.whamcloud.com/6020
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
%bcond_with zfs
%bcond_without lustre_tests
%bcond_without lustre_iokit
%bcond_with zfs
%bcond_without lustre_tests
%bcond_without lustre_iokit
+%bcond_without lustre_modules
%if %{without servers}
# --without servers overrides --with {ldiskfs|zfs}
%if %{without servers}
# --without servers overrides --with {ldiskfs|zfs}
%description
Userspace tools and files for the Lustre file system.
%description
Userspace tools and files for the Lustre file system.
+%if %{with lustre_modules}
%package modules
Summary: Kernel Lustre modules for Linux %{kversion}
%if %{defined cross_requires}
%package modules
Summary: Kernel Lustre modules for Linux %{kversion}
%if %{defined cross_requires}
implementation of the OSD API for using the ZFS filesystem as the underlying
backing store of a Lustre server.
%endif
implementation of the OSD API for using the ZFS filesystem as the underlying
backing store of a Lustre server.
%endif
+%endif # with lustre_modules
%package source
Summary: Object-Based Disk storage driver source
%package source
Summary: Object-Based Disk storage driver source
CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
%endif
CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
%endif
+%if %{with lustre_modules}
+CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
+%else
+CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
+%endif
+
# if %%kdir was given, make sure it's not in the configure arguments
if [ -n "%kdir" ]; then
CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
# if %%kdir was given, make sure it's not in the configure arguments
if [ -n "%kdir" ]; then
CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
echo '%{_libdir}/lustre/tests/*' >lustre-tests.files
echo '%{_bindir}/mcreate' >>lustre-tests.files
echo '%{_bindir}/munlink' >>lustre-tests.files
echo '%{_libdir}/lustre/tests/*' >lustre-tests.files
echo '%{_bindir}/mcreate' >>lustre-tests.files
echo '%{_bindir}/munlink' >>lustre-tests.files
+%if %{with lustre_modules}
echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
echo '%{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
fi
if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
echo '%{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
fi
%files -f lustre.files
%defattr(-,root,root)
%files -f lustre.files
%defattr(-,root,root)
+%if %{with lustre_modules}
%files modules
%defattr(-,root,root)
%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
%files modules
%defattr(-,root,root)
%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
%attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
%endif
%endif
%attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
%endif
%endif
+%endif # with lustre_modules
%files source
%defattr(-,root,root)
%files source
%defattr(-,root,root)
+%if %{with lustre_modules}
%post modules
%if %{defined rpm_post_base}
if [ -x %{rpm_post_base}-modules.sh ]; then
%post modules
%if %{defined rpm_post_base}
if [ -x %{rpm_post_base}-modules.sh ]; then
rm /var/run/%{name}-osd-zfs
%endif
%endif
rm /var/run/%{name}-osd-zfs
%endif
%endif
+%endif # with lustre_modules
%if %{with lustre_tests}
%post tests
%if %{with lustre_tests}
%post tests
# Lustre is a trademark of Sun Microsystems, Inc.
#
# Lustre is a trademark of Sun Microsystems, Inc.
#
modulefs_DATA = lquota$(KMODEXT)
modulefs_DATA = lquota$(KMODEXT)
+endif LINUX
+endif MODULES
+
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@