3 # Declare rpmbuild --with/--without parameters
7 %bcond_without lustre_tests
8 %bcond_without lustre_iokit
9 %bcond_without lustre_modules
11 %if %{without servers}
12 # --without servers overrides --with {ldiskfs|zfs}
13 # so undefine the internal variables set by bcond_*
14 %undefine with_ldiskfs
18 %{!?version: %global version @VERSION@}
19 %{!?kver: %global kver ""}
20 %{!?kdir: %global kdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; echo "/lib/modules/$kversion/source"; fi)}
22 %{!?kobjdir: %global kobjdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux-obj=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; if [ "%kdir" = "/lib/modules/$kversion/source" ]; then echo "/lib/modules/$kversion/build"; else echo "%kdir"; fi; fi)}
24 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
25 %{!?kversion: %global kversion %(if test -s %kobjdir/include/generated/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/generated/utsrelease.h ; elif test -s %kobjdir/include/linux/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/linux/utsrelease.h ; else LINUXRELEASEHEADER=%kobjdir/include/linux/version.h; fi; sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' $LINUXRELEASEHEADER)}
27 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
29 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
31 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
33 # always append the buildid, even when the caller defines %release
34 %define fullrelease %{myrelease}%{buildid}
36 # in order to get kernel symset and/or kernel module dependencies into
37 # the RPM, in order to support weak-modules, the internal dependency gen-
38 # erator needs to be disabled
39 # this is done with (reduce the double % down to a single %):
41 # %%global _use_internal_dependency_generator 0
43 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
44 # defining it here (until Suse changes their mind)
46 # on RHEL5, however, we do need to explicitly disable the internal dep-
47 # endency generator and allow the external one be used
48 # but since RedHat's kABI is only a subset of the total kernel ABI, it
49 # doesn't include all of the symbols we (or OFED for that matter) need
50 # until RedHat includes all of the symbols we need in their symsets we
51 # cannot support weak-modules
52 # we did e-mail the maintainer of all of this stuff @redhat but got no
54 #%%global _use_internal_dependency_generator 0
56 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
58 %define krequires %(bash -c "echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/-ppc64$//' -e 's/-default$//'")
60 # Set the package name prefix
61 %if %{undefined lustre_name}
63 %global lustre_name lustre
65 %global lustre_name lustre-client
69 %if %{undefined kmoddir}
70 %if %{defined kernel_module_package_moddir}
71 %global kmoddir %{kernel_module_package_moddir}
73 %if %{defined suse_kernel_module_package}
74 %global kmoddir updates
81 %if %{defined cross_path} && %{defined post_script}
82 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
85 Summary: Lustre File System
88 Release: %{fullrelease}
90 Group: Utilities/System
91 Source: lustre-%{version}.tar.gz
92 URL: http://wiki.whamcloud.com/
93 BuildRoot: %{_tmppath}/lustre-%{version}-root
94 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
95 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
96 Requires: %{name}-modules = %{version}
100 %if %{defined cross_requires}
101 Requires: %{cross_requires}
104 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
105 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
106 #suse don't support selinux
107 BuildRequires: libselinux-devel
113 Userspace tools and files for the Lustre file system.
115 %if %{with lustre_modules}
117 Summary: Kernel Lustre modules for Linux %{kversion}
118 %if %{defined cross_requires}
119 Requires: %{cross_requires}
122 # for SLES11, we need nothing here
123 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
124 # for RHEL we need to require the specific kernel still since weak-modules
125 # support on RH is, well, weak, to be punny about it
126 Requires: kernel = %{krequires}
129 Group: Development/Kernel
132 Lustre file system, server and network drivers for Linux %{kversion}.
136 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
137 Requires: lustre-modules = %{version}
138 Requires: modutils >= 2.4.10
139 Requires: ldiskfsprogs >= 1.42.7.wc1
141 Obsoletes: lustre-ldiskfs
142 Group: Development/Kernel
144 %description osd-ldiskfs
145 The Lustre Object Storage Device (OSD) API is the interface to access and
146 modify data that is supposed to be stored persistently. This API is the interface
147 to code that bridges individual file systems. This specific package provides an
148 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
149 backing store of a Lustre server.
154 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
155 Requires: lustre-modules = %{version}, zfs-kmod
157 Group: Development/Kernel
160 The Lustre Object Storage Device (OSD) API is the interface to access and
161 modify data that is supposed to be stored persistently. This API is the interface
162 to code that bridges individual file systems. This specific package provides an
163 implementation of the OSD API for using the ZFS filesystem as the underlying
164 backing store of a Lustre server.
166 %endif # with lustre_modules
169 Summary: Object-Based Disk storage driver source
170 Group: Development/Kernel
173 Lustre sources for further development
175 # Since the RPMs we ship are to be used on both SLES and RHEL, we
176 # can't include any dependency information (since the package names
177 # are different on the two platforms).
179 # Instead, we can build these empty meta-packages that only include
180 # dependency information. These let people get the correct
181 # dependencies for their platform and lets them use tools like yum and
182 # red carpet to install the correct files.
184 # Unfortunately I have not seen this come up on the lists much, so I
185 # have disabled them (by commenting out their empty files section
186 # below) until it's clear that they resolve more confusion than they
190 Summary: Lustre dependencies meta-package for SLES
191 Group: Utilities/System
192 Provides: lustre-deps = %{version}
193 Requires: %{name} = %{version}, sles-release
194 Conflicts: %{name}-deps-rhel
196 %description deps-sles
197 This package has RPM dependencies appropriate for SLES systems.
200 Summary: Lustre dependencies meta-package for RHEL
201 Group: Utilities/System
202 Provides: lustre-deps = %{version}
203 Requires: %{name} = %{version}, redhat-release
204 Conflicts: %{name}-deps-sles
206 %description deps-rhel
207 This package has RPM dependencies appropriate for RHEL, RHL, and FC
211 Summary: Lustre testing framework
212 Group: Development/Kernel
213 Provides: %{name}-tests = %{version}
214 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
217 This package contains a set of test binaries and scripts that are intended
218 to be used by the Lustre testing framework.
220 %if %{with lustre_iokit}
221 %package -n lustre-iokit
222 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
223 Group: Applications/System
224 Requires: python > 2.2, sg3_utils
226 %description -n lustre-iokit
227 This package includes five tools:
229 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
232 This survey can be run in 3 modes to test disk I/O including the filesystem,
233 network I/O, and disk I/O via the network. The script does sequential I/O
234 with varying numbers of threads and objects (files) by using lctl::test_brw
235 to drive the echo_client connected to local or remote obdfilter instances,
236 or remote obdecho instances.
239 This survey tests the client-to-disk performance of individual OSTs, and
240 ranks then for comparison.
243 This script will collect IO stats on a defined set of nodes.
246 A script to run the IOR benchmark. The latest version can be downloaded from
247 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
250 This survey tests the local metadata performance using the echo_client to drive
251 the MDD layer to perform operations. It is run with multiple threads (to
252 simulate MDT service threads) locally on the MDS node, and does not need Lustre
253 clients in order to run
256 %if 0%{?suse_version}
260 %setup -qn lustre-%{version}
261 ln lustre/ChangeLog ChangeLog-lustre
262 ln lnet/ChangeLog ChangeLog-lnet
266 # Set an explicit path to our Linux tree, if we can.
267 cd $RPM_BUILD_DIR/lustre-%{version}
268 # override %optflags so that the vendor's overzealous flags don't create
270 %define optflags -g -O2 -Werror
271 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
272 %if %{with lustre_tests}
273 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
275 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
277 %if %{without lustre_iokit}
278 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
281 %if %{with lustre_modules}
282 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
284 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
287 # if %%kdir was given, make sure it's not in the configure arguments
288 if [ -n "%kdir" ]; then
289 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
291 # ditto for %%kobjdir
292 if [ -n "%kobjdir" ]; then
293 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
295 # remove --with-kmp-moddir from configure arguments,
296 # it will be set --with-kmp-moddir=%%kmoddir
297 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
299 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
300 # string in it which we don't want word splitted by the shell
301 # also remove (build|host|target) options because they will be specified
302 # inside $CONFIGURE_ARGS
303 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
306 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
307 $CONFIGURE_ARGS --with-kmp-moddir=%{kmoddir}
308 make %{?_smp_mflags} -s %{?make_args}
311 make install DESTDIR=$RPM_BUILD_ROOT
312 # hack to avoid changing the libsysio code for "make install"
313 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
315 # The .ha_v2 extension identifies the heartbeat resource agent as using
316 # legacy syntax. Install a compatibility symlink to avoid conflicts when
317 # newer-style agents are added.
318 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
320 # Create the pristine source directory.
321 cd $RPM_BUILD_DIR/lustre-%{version}
322 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
324 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
325 make distdir distdir=lustre-source/lustre-%{version}
326 chmod -R go-w lustre-source/lustre-%{version}
327 # fc18 needs 'x' permission for library files
328 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
330 cat >lustre.files <<EOF
331 %{?rootdir}/sbin/mount.lustre
334 %{_bindir}/lfs_migrate
338 %{_bindir}/lustre_req_history
339 %{_bindir}/plot-llstat
340 %{_bindir}/req_layout
341 %{_libdir}/libptlctl.a
342 %{_libdir}/liblustreapi.a
343 %{_libdir}/liblustreapi.so
346 %{_includedir}/lustre
347 %{_includedir}/libcfs
348 %{_libexecdir}/lustre/lc_common
349 %{_sysconfdir}/udev/rules.d/99-lustre.rules
350 %{_sysconfdir}/init.d/lnet
351 %{_sysconfdir}/init.d/lustre
352 %config(noreplace) %{_sysconfdir}/ldev.conf
353 %{_sysconfdir}/sysconfig/lustre
354 %{_libexecdir}/lustre/haconfig
355 %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
356 %{_sysconfdir}/ha.d/resource.d/Lustre
359 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
360 echo '%{_libdir}/libcfsutil.a' >>lustre.files
363 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
364 echo '%{_libdir}/liblustre.a' >>lustre.files
365 echo '%{_libdir}/liblustre.so' >>lustre.files
368 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
369 echo '%{_libdir}/libiam.a' >>lustre.files
372 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
373 echo '%{_libdir}/lustre/snmp' >>lustre.files
374 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
377 # Have universal lustre headers
378 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
379 echo '%{_includedir}/linux/lustre_user.h' >>lustre.files
381 echo '%{_includedir}/linux/lustre_idl.h' >>lustre.files
384 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
385 echo '%{_includedir}/linux/lustre_types.h' >>lustre.files
388 %if %{with lustre_tests}
389 echo '%{_libdir}/lustre/tests/*' >lustre-tests.files
390 echo '%{_bindir}/mcreate' >>lustre-tests.files
391 echo '%{_bindir}/munlink' >>lustre-tests.files
392 %if %{with lustre_modules}
393 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
395 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
396 echo '%{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
400 %if %{defined cross_path}
401 %if %{defined rpm_post_base}
402 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
403 if [ -f $POST_SCRIPT ]; then
404 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
405 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
406 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
408 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
411 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
413 %if %{with lustre_tests}
414 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
415 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
420 # mark modules executable for find-debuginfo.sh
421 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} -name "*.ko" -type f | \
422 xargs --no-run-if-empty chmod u+x
425 %files -f lustre.files
426 %defattr(-,root,root)
428 %if %{with lustre_modules}
430 %defattr(-,root,root)
431 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
432 %if %{with lustre_tests}
433 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
436 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
437 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
440 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
442 %if %{defined rpm_post_base}
443 %attr(0555, root, root) %{rpm_post_base}-modules.sh
446 %doc ChangeLog-lustre
451 %defattr(-,root,root)
452 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
453 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
454 %if %{defined rpm_post_base}
455 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
461 %defattr(-,root,root)
462 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
463 %if %{defined rpm_post_base}
464 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
467 %endif # with lustre_modules
470 %defattr(-,root,root)
471 %{_prefix}/src/lustre-%{version}
473 # uncomment these lines to enable deps packages
477 %if %{with lustre_tests}
478 %files tests -f lustre-tests.files
479 %defattr(-,root,root)
482 %if %{with lustre_iokit}
483 %files -n lustre-iokit
484 %defattr(-, root, root)
485 %{_bindir}/ior-survey
488 %{_bindir}/obdfilter-survey
489 %{_bindir}/plot-obdfilter
491 %{_bindir}/ost-survey
492 %{_bindir}/sgpdd-survey
493 %{_bindir}/plot-sgpdd
495 %{_bindir}/gather_stats_everywhere.sh
497 %{_bindir}/mds-survey
498 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
499 %doc lustre-iokit/ior-survey/README.ior-survey
500 %doc lustre-iokit/ost-survey/README.ost-survey
501 %doc lustre-iokit/mds-survey/README.mds-survey
502 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
503 %doc lustre-iokit/stats-collect/README.lstats.sh
506 %if %{defined rpm_post_base}
508 if [ -x %{rpm_post_base}.sh ]; then
509 %{rpm_post_base}.sh %{cross_path} create
513 if [ -x %{rpm_post_base}.sh ]; then
514 %{rpm_post_base}.sh %{cross_path} remove
518 %if %{with lustre_modules}
520 %if %{defined rpm_post_base}
521 if [ -x %{rpm_post_base}-modules.sh ]; then
522 %{rpm_post_base}-modules.sh %{cross_path} create
525 if [ -f /boot/System.map-%{kversion} ]; then
526 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
528 depmod -ae %{kversion} || exit 0
531 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
532 # "weak modules" support
534 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
535 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
536 /usr/lib/module-init-tools/weak-modules --add-modules
539 if [ -x /sbin/weak-modules ]; then
540 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
541 /sbin/weak-modules --add-modules
544 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
545 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
546 # print a warning so that users are aware of this issue.
547 if sysctl kernel.unsupported >/dev/null 2>&1 &&
548 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
549 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
551 warning: the Lustre modules are not supported by Novell. To use Lustre
552 on this system, you should put
554 allow_unsupported_modules 1
556 into /etc/modprobe.d/unsupported_modules"
562 %if %{defined rpm_post_base}
563 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
564 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
567 if [ -f /boot/System.map-%{kversion} ]; then
568 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
570 depmod -ae %{kversion} || exit 0
573 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
574 # "weak modules" support
576 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
577 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
578 /usr/lib/module-init-tools/weak-modules --add-modules
581 if [ -x /sbin/weak-modules ]; then
582 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
583 /sbin/weak-modules --add-modules
586 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
587 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
588 # print a warning so that users are aware of this issue.
589 if sysctl kernel.unsupported >/dev/null 2>&1 &&
590 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
591 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
593 warning: the Lustre modules are not supported by Novell. To use Lustre
594 on this system, you should put
596 allow_unsupported_modules 1
598 into /etc/modprobe.d/unsupported_modules"
605 %if %{defined rpm_post_base}
606 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
607 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
610 if [ -f /boot/System.map-%{kversion} ]; then
611 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
613 depmod -ae %{kversion} || exit 0
616 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
617 # "weak modules" support
619 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
620 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
621 /usr/lib/module-init-tools/weak-modules --add-modules
624 if [ -x /sbin/weak-modules ]; then
625 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
626 /sbin/weak-modules --add-modules
629 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
630 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
631 # print a warning so that users are aware of this issue.
632 if sysctl kernel.unsupported >/dev/null 2>&1 &&
633 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
634 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
636 warning: the Lustre modules are not supported by Novell. To use Lustre
637 on this system, you should put
639 allow_unsupported_modules 1
641 into /etc/modprobe.d/unsupported_modules"
647 %if %{defined rpm_post_base}
648 if [ -x %{rpm_post_base}-modules.sh ]; then
649 %{rpm_post_base}-modules.sh %{cross_path} remove
652 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
653 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
658 %if %{defined rpm_post_base}
659 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
660 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
663 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
664 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
670 %if %{defined rpm_post_base}
671 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
672 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
675 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
676 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
680 %if %{undefined cross_path}
682 if [ -f /boot/System.map-%{kversion} ]; then
683 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
685 depmod -ae %{kversion} || exit 0
688 # "weak modules" support
690 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
691 cat /var/run/%{name}-modules |
692 /usr/lib/module-init-tools/weak-modules --remove-modules
695 if [ -x /sbin/weak-modules ]; then
696 cat /var/run/%{name}-modules |
697 /sbin/weak-modules --remove-modules
699 rm /var/run/%{name}-modules
703 if [ -f /boot/System.map-%{kversion} ]; then
704 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
706 depmod -ae %{kversion} || exit 0
709 # "weak modules" support
711 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
712 cat /var/run/%{name}-osd-ldiskfs |
713 /usr/lib/module-init-tools/weak-modules --remove-modules
716 if [ -x /sbin/weak-modules ]; then
717 cat /var/run/%{name}-osd-ldiskfs |
718 /sbin/weak-modules --remove-modules
720 rm /var/run/%{name}-osd-ldiskfs
725 if [ -f /boot/System.map-%{kversion} ]; then
726 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
728 depmod -ae %{kversion} || exit 0
731 # "weak modules" support
733 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
734 cat /var/run/%{name}-osd-zfs |
735 /usr/lib/module-init-tools/weak-modules --remove-modules
738 if [ -x /sbin/weak-modules ]; then
739 cat /var/run/%{name}-osd-zfs |
740 /sbin/weak-modules --remove-modules
742 rm /var/run/%{name}-osd-zfs
745 %endif # with lustre_modules
747 %if %{with lustre_tests}
749 %if %{defined rpm_post_base}
750 if [ -x %{rpm_post_base}-tests.sh ]; then
751 %{rpm_post_base}-tests.sh %{cross_path} create
755 if [ -x %{rpm_post_base}-tests.sh ]; then
756 %{rpm_post_base}-tests.sh %{cross_path} remove
759 if [ -f /boot/System.map-%{kversion} ]; then
760 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
762 depmod -ae %{kversion} || exit 0
766 if [ -f /boot/System.map-%{kversion} ]; then
767 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
769 depmod -ae %{kversion} || exit 0
775 rm -rf $RPM_BUILD_ROOT