Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Change-Id: Ic4f4f7f19da9951b47c587399a71c42fb0e720d0
  • Loading branch information
behlendorf committed Aug 8, 2013
1 parent 4afc957 commit f7aeb9d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
29 changes: 29 additions & 0 deletions lustre.spec.in
Expand Up @@ -20,6 +20,7 @@
%{!?lustre_name: %global lustre_name lustre}
%{!?build_lustre_tests: %global build_lustre_tests 1}

%{!?build_lustre_modules: %global build_lustre_modules 1}
%{!?build_lustre_osd_ldiskfs: %global build_lustre_osd_ldiskfs 0}
%{!?build_lustre_osd_zfs: %global build_lustre_osd_zfs 0}

Expand Down Expand Up @@ -83,6 +84,7 @@ Requires: lustre-osd
%description
Userspace tools and files for the Lustre file system.

%if %{build_lustre_modules}
%package modules
Summary: Kernel Lustre modules for Linux %{kversion}
%if %{defined cross_requires}
Expand Down Expand Up @@ -134,6 +136,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

%package source
Summary: Object-Based Disk storage driver source
Expand Down Expand Up @@ -221,6 +224,26 @@ CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
%endif

%if %{build_lustre_modules}
CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
%else
CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
%endif

# May be enabled when build_lustre_modules=0 to enable utility support.
%if %{build_lustre_osd_ldiskfs}
CONFIGURE_ARGS="$CONFIGURE_ARGS --with-ldiskfs"
%else
CONFIGURE_ARGS="$CONFIGURE_ARGS --without-ldiskfs"
%endif

# May be enabled when build_lustre_modules=0 to enable utility support.
%if %{build_lustre_osd_zfs}
CONFIGURE_ARGS="$CONFIGURE_ARGS --with-zfs"
%else
CONFIGURE_ARGS="$CONFIGURE_ARGS --without-zfs"
%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=[^ ][^ ]* \?//')
Expand Down Expand Up @@ -324,7 +347,9 @@ fi

%if %{build_lustre_tests}
echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
%if %{build_lustre_modules}
echo '%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
%endif
if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
fi
Expand Down Expand Up @@ -357,6 +382,7 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -ty

%files -f lustre.files

%if %{build_lustre_modules}
%files modules
%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/*
%if %{build_lustre_tests}
Expand Down Expand Up @@ -390,6 +416,7 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -ty
%attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
%endif
%endif
%endif

%files source
%attr(-, root, root) %{_prefix}/src/lustre-%{version}
Expand All @@ -414,6 +441,7 @@ if [ -x %{rpm_post_base}.sh ]; then
fi
%endif

%if %{build_lustre_modules}
%post modules
%if %{defined rpm_post_base}
if [ -x %{rpm_post_base}-modules.sh ]; then
Expand Down Expand Up @@ -640,6 +668,7 @@ fi
rm /var/run/%{name}-osd-zfs
%endif
%endif
%endif

%if %{build_lustre_tests}
%post tests
Expand Down
6 changes: 6 additions & 0 deletions lustre/quota/autoMakefile.am
Expand Up @@ -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@

0 comments on commit f7aeb9d

Please sign in to comment.