From c92afbcd4a8234994affa444d59645b80fa19ec5 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 9 Apr 2013 14:21:46 -0700 Subject: [PATCH] LU-1032 build: Honor --disable-modules option in spec file 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 Signed-off-by: Bruno Faccini Change-Id: Ic4f4f7f19da9951b47c587399a71c42fb0e720d0 Reviewed-on: http://review.whamcloud.com/6020 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Minh Diep Reviewed-by: Brian J. Murrell --- lustre.spec.in | 15 +++++++++++++++ lustre/quota/autoMakefile.am | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/lustre.spec.in b/lustre.spec.in index 48f5b17..3e2dddb 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -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 diff --git a/lustre/quota/autoMakefile.am b/lustre/quota/autoMakefile.am index 61517fd..3e6fddd 100644 --- a/lustre/quota/autoMakefile.am +++ b/lustre/quota/autoMakefile.am @@ -34,6 +34,12 @@ # Lustre is a trademark of Sun Microsystems, Inc. # +if MODULES +if LINUX + modulefs_DATA = lquota$(KMODEXT) +endif LINUX +endif MODULES + MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ -- 1.8.3.1