Whamcloud - gitweb
LU-1032 build: Honor --disable-modules option in spec file 20/6020/8
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 9 Apr 2013 21:21:46 +0000 (14:21 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Feb 2014 02:35:56 +0000 (02:35 +0000)
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>
lustre.spec.in
lustre/quota/autoMakefile.am

index 48f5b17..3e2dddb 100644 (file)
@@ -6,6 +6,7 @@
 %bcond_with zfs
 %bcond_without lustre_tests
 %bcond_without lustre_iokit
+%bcond_without lustre_modules
 
 %if %{without servers}
     # --without servers overrides --with {ldiskfs|zfs}
@@ -111,6 +112,7 @@ Requires: libselinux
 %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}
@@ -161,6 +163,7 @@ to code that bridges individual file systems. This specific package provides an
 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
@@ -275,6 +278,12 @@ CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
 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=[^ ][^ ]* \?//')
@@ -380,7 +389,9 @@ fi
 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
+%endif
 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
   echo '%{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
 fi
@@ -414,6 +425,7 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} -name "*.ko"
 %files -f lustre.files
 %defattr(-,root,root)
 
+%if %{with lustre_modules}
 %files modules
 %defattr(-,root,root)
 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
@@ -452,6 +464,7 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} -name "*.ko"
 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
 %endif
 %endif
+%endif # with lustre_modules
 
 %files source
 %defattr(-,root,root)
@@ -502,6 +515,7 @@ if [ -x %{rpm_post_base}.sh ]; then
 fi
 %endif
 
+%if %{with lustre_modules}
 %post modules
 %if %{defined rpm_post_base}
 if [ -x %{rpm_post_base}-modules.sh ]; then
@@ -728,6 +742,7 @@ fi
 rm /var/run/%{name}-osd-zfs
 %endif
 %endif
+%endif # with lustre_modules
 
 %if %{with lustre_tests}
 %post tests
index 61517fd..3e6fddd 100644 (file)
 # Lustre is a trademark of Sun Microsystems, Inc.
 #
 
+if MODULES
+if LINUX
+
 modulefs_DATA = lquota$(KMODEXT)
 
+endif LINUX
+endif MODULES
+
 MOSTLYCLEANFILES := @MOSTLYCLEANFILES@