3 # Declare rpmbuild --with/--without parameters
7 %bcond_without lustre_tests
8 %bcond_without lustre_utils
9 %bcond_without lustre_iokit
10 %bcond_without lustre_modules
12 %if %{without servers}
13 # --without servers overrides --with {ldiskfs|zfs}
14 # so undefine the internal variables set by bcond_*
15 %undefine with_ldiskfs
19 %{!?version: %global version @VERSION@}
20 %{!?kver: %global kver ""}
21 %{!?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)}
23 %{!?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)}
25 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
26 %{!?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)}
28 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
30 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
32 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
34 # always append the buildid, even when the caller defines %release
35 %define fullrelease %{myrelease}%{buildid}
37 # in order to get kernel symset and/or kernel module dependencies into
38 # the RPM, in order to support weak-modules, the internal dependency gen-
39 # erator needs to be disabled
40 # this is done with (reduce the double % down to a single %):
42 # %%global _use_internal_dependency_generator 0
44 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
45 # defining it here (until Suse changes their mind)
47 # on RHEL5, however, we do need to explicitly disable the internal dep-
48 # endency generator and allow the external one be used
49 # but since RedHat's kABI is only a subset of the total kernel ABI, it
50 # doesn't include all of the symbols we (or OFED for that matter) need
51 # until RedHat includes all of the symbols we need in their symsets we
52 # cannot support weak-modules
53 # we did e-mail the maintainer of all of this stuff @redhat but got no
55 #%%global _use_internal_dependency_generator 0
57 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
59 %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$//'")
61 # Set the package name prefix
62 %if %{undefined lustre_name}
64 %global lustre_name lustre
66 %global lustre_name lustre-client
70 %if %{undefined kmoddir}
71 %if %{defined kernel_module_package_moddir}
72 %global kmoddir %{kernel_module_package_moddir}
74 %if %{defined suse_kernel_module_package}
75 %global kmoddir updates
82 %if %{defined cross_path} && %{defined post_script}
83 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
86 # SUSE don't support .debug_info section from cross compiler:
87 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
88 %if %{defined cross_path} && 0%{?suse_version}
89 %global __debug_install_post %{nil}
90 %global __debug_package %{nil}
91 %global debug_package %{nil}
94 Summary: Lustre File System
97 Release: %{fullrelease}
99 Group: Utilities/System
100 Source: lustre-%{version}.tar.gz
101 URL: https://wiki.hpdd.intel.com/
102 BuildRoot: %{_tmppath}/lustre-%{version}-root
103 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
104 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
105 Requires: %{name}-modules = %{version}
106 BuildRequires: libtool
110 %if %{defined cross_requires}
111 Requires: %{cross_requires}
114 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
115 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
116 #suse don't support selinux
117 BuildRequires: libselinux-devel
123 Userspace tools and files for the Lustre file system.
125 %if %{with lustre_modules}
127 Summary: Kernel Lustre modules for Linux %{kversion}
128 %if %{defined cross_requires}
129 Requires: %{cross_requires}
132 # for SLES11, we need nothing here
133 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
134 # for RHEL we need to require the specific kernel still since weak-modules
135 # support on RH is, well, weak, to be punny about it
136 Requires: kernel = %{krequires}
139 Group: Development/Kernel
142 Lustre file system, server and network drivers for Linux %{kversion}.
146 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
147 Requires: lustre-modules = %{version}
148 Requires: module-init-tools >= 3.9
149 Requires: ldiskfsprogs >= 1.42.7.wc1
151 Obsoletes: lustre-ldiskfs
152 Group: Development/Kernel
154 %description osd-ldiskfs
155 The Lustre Object Storage Device (OSD) API is the interface to access and
156 modify data that is supposed to be stored persistently. This API is the interface
157 to code that bridges individual file systems. This specific package provides an
158 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
159 backing store of a Lustre server.
164 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
165 Requires: lustre-modules = %{version}, zfs-kmod
167 Group: Development/Kernel
170 The Lustre Object Storage Device (OSD) API is the interface to access and
171 modify data that is supposed to be stored persistently. This API is the interface
172 to code that bridges individual file systems. This specific package provides an
173 implementation of the OSD API for using the ZFS filesystem as the underlying
174 backing store of a Lustre server.
176 %endif # with lustre_modules
179 Summary: Object-Based Disk storage driver source
180 Group: Development/Kernel
183 Lustre sources for further development
185 # Since the RPMs we ship are to be used on both SLES and RHEL, we
186 # can't include any dependency information (since the package names
187 # are different on the two platforms).
189 # Instead, we can build these empty meta-packages that only include
190 # dependency information. These let people get the correct
191 # dependencies for their platform and lets them use tools like yum and
192 # red carpet to install the correct files.
194 # Unfortunately I have not seen this come up on the lists much, so I
195 # have disabled them (by commenting out their empty files section
196 # below) until it's clear that they resolve more confusion than they
200 Summary: Lustre dependencies meta-package for SLES
201 Group: Utilities/System
202 Provides: lustre-deps = %{version}
203 Requires: %{name} = %{version}, sles-release
204 Conflicts: %{name}-deps-rhel
206 %description deps-sles
207 This package has RPM dependencies appropriate for SLES systems.
210 Summary: Lustre dependencies meta-package for RHEL
211 Group: Utilities/System
212 Provides: lustre-deps = %{version}
213 Requires: %{name} = %{version}, redhat-release
214 Conflicts: %{name}-deps-sles
216 %description deps-rhel
217 This package has RPM dependencies appropriate for RHEL, RHL, and FC
221 Summary: Lustre testing framework
222 Group: Development/Kernel
223 Provides: %{name}-tests = %{version}
224 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
225 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
228 This package contains a set of test binaries and scripts that are intended
229 to be used by the Lustre testing framework.
231 %if %{with lustre_iokit}
232 %package -n lustre-iokit
233 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
234 Group: Applications/System
235 Requires: python > 2.2, sg3_utils
237 %description -n lustre-iokit
238 This package includes five tools:
240 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
243 This survey can be run in 3 modes to test disk I/O including the filesystem,
244 network I/O, and disk I/O via the network. The script does sequential I/O
245 with varying numbers of threads and objects (files) by using lctl::test_brw
246 to drive the echo_client connected to local or remote obdfilter instances,
247 or remote obdecho instances.
250 This survey tests the client-to-disk performance of individual OSTs, and
251 ranks then for comparison.
254 This script will collect IO stats on a defined set of nodes.
257 A script to run the IOR benchmark. The latest version can be downloaded from
258 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
261 This survey tests the local metadata performance using the echo_client to drive
262 the MDD layer to perform operations. It is run with multiple threads (to
263 simulate MDT service threads) locally on the MDS node, and does not need Lustre
264 clients in order to run
267 %if 0%{?suse_version}
271 %setup -qn lustre-%{version}
272 ln lustre/ChangeLog ChangeLog-lustre
273 ln lnet/ChangeLog ChangeLog-lnet
277 # Set an explicit path to our Linux tree, if we can.
278 cd $RPM_BUILD_DIR/lustre-%{version}
279 # override %optflags so that the vendor's overzealous flags don't create
281 %define optflags -g -O2 -Werror
282 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
284 %if %{with lustre_tests}
285 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests"
287 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests"
290 %if %{with lustre_utils}
291 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-utils"
293 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-utils"
296 %if %{without lustre_iokit}
297 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
300 %if %{with lustre_modules}
301 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
303 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
306 %if %{without servers}
307 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-server"
310 %if %{without ldiskfs}
311 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-ldiskfs"
315 CONFIGURE_ARGS="$CONFIGURE_ARGS --without-zfs"
318 # if %%kdir was given, make sure it's not in the configure arguments
319 if [ -n "%kdir" ]; then
320 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
322 # ditto for %%kobjdir
323 if [ -n "%kobjdir" ]; then
324 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
326 # remove --with-kmp-moddir from configure arguments,
327 # it will be set --with-kmp-moddir=%%kmoddir
328 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
330 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
331 # string in it which we don't want word splitted by the shell
332 # also remove (build|host|target) options because they will be specified
333 # inside $CONFIGURE_ARGS
334 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
337 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
338 $CONFIGURE_ARGS --with-kmp-moddir=%{kmoddir}
339 make %{?_smp_mflags} -s %{?make_args}
342 make install DESTDIR=$RPM_BUILD_ROOT
347 # The .ha_v2 extension identifies the heartbeat resource agent as using
348 # legacy syntax. Install a compatibility symlink to avoid conflicts when
349 # newer-style agents are added.
350 %if %{with lustre_utils}
351 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
352 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
353 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
356 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then
357 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
358 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
362 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then
363 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
366 # Create the pristine source directory.
367 cd $RPM_BUILD_DIR/lustre-%{version}
368 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
370 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
371 make distdir distdir=lustre-source/lustre-%{version}
372 chmod -R go-w lustre-source/lustre-%{version}
373 # fc18 needs 'x' permission for library files
374 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
376 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
377 echo '%{_libdir}/libiam.a' >>lustre.files
380 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
381 echo '%{_libdir}/lustre/snmp' >>lustre.files
382 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
385 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@/ -name \*.la -type f -delete
387 %if %{with lustre_tests}
388 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
389 echo '%{_bindir}/mcreate' >>lustre-tests.files
390 echo '%{_bindir}/munlink' >>lustre-tests.files
391 echo '%{_bindir}/req_layout' >>lustre-tests.files
392 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
393 echo '%{_sbindir}/wiretest' >>lustre-tests.files
394 echo '%{_sbindir}/loadgen' >>lustre-tests.files
395 %if %{with lustre_modules}
396 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>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 %if %{with lustre_modules}
421 # mark modules executable for find-debuginfo.sh
422 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
423 -name \*.ko -type f -exec chmod u+x {} \;
427 %files -f lustre.files
428 %defattr(-,root,root)
430 %if %{with lustre_utils}
432 %{_libexecdir}/lustre/lc_common
433 %{_libexecdir}/lustre/haconfig
434 %{_bindir}/lustre_req_history
439 %{_bindir}/plot-llstat
442 %{_bindir}/lfs_migrate
443 %{?rootdir}/sbin/mount.lustre
444 %{_libdir}/libptlctl.a
445 %{_libdir}/libcfsutil.a
446 %{_libdir}/liblustreapi.a
447 %{_libdir}/liblustreapi.so
449 %{_includedir}/lustre
450 %{_includedir}/libcfs
451 %{_includedir}/linux/lustre_user.h
454 %{_sysconfdir}/udev/rules.d/99-lustre.rules
455 %config(noreplace) %{_sysconfdir}/ldev.conf
457 %if %{with lustre_modules}
459 %defattr(-,root,root)
460 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
461 %if %{with lustre_tests}
462 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
465 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
466 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
469 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
471 %if %{defined rpm_post_base}
472 %attr(0555, root, root) %{rpm_post_base}-modules.sh
475 %doc ChangeLog-lustre
480 %defattr(-,root,root)
481 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
482 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
483 %if %{with lustre_utils}
484 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
486 %if %{defined rpm_post_base}
487 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
493 %defattr(-,root,root)
494 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
495 %if %{with lustre_utils}
496 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
498 %if %{defined rpm_post_base}
499 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
502 %endif # with lustre_modules
505 %defattr(-,root,root)
506 %{_prefix}/src/lustre-%{version}
508 # uncomment these lines to enable deps packages
512 %if %{with lustre_tests}
513 %files tests -f lustre-tests.files
514 %defattr(-,root,root)
517 %if %{with lustre_iokit}
518 %files -n lustre-iokit
519 %defattr(-, root, root)
520 %{_bindir}/iokit-config
521 %{_bindir}/iokit-gather-stats
522 %{_bindir}/iokit-libecho
523 %{_bindir}/iokit-lstats
524 %{_bindir}/iokit-parse-ior
525 %{_bindir}/iokit-plot-obdfilter
526 %{_bindir}/iokit-plot-ost
527 %{_bindir}/iokit-plot-sgpdd
528 %{_bindir}/ior-survey
529 %{_bindir}/mds-survey
530 %{_bindir}/obdfilter-survey
531 %{_bindir}/ost-survey
532 %{_bindir}/sgpdd-survey
533 %doc lustre-iokit/ior-survey/README.ior-survey
534 %doc lustre-iokit/mds-survey/README.mds-survey
535 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
536 %doc lustre-iokit/ost-survey/README.ost-survey
537 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
538 %doc lustre-iokit/stats-collect/README.iokit-lstats
541 %if %{defined rpm_post_base}
543 if [ -x %{rpm_post_base}.sh ]; then
544 %{rpm_post_base}.sh %{cross_path} create
548 if [ -x %{rpm_post_base}.sh ]; then
549 %{rpm_post_base}.sh %{cross_path} remove
553 %if %{with lustre_modules}
555 %if %{defined rpm_post_base}
556 if [ -x %{rpm_post_base}-modules.sh ]; then
557 %{rpm_post_base}-modules.sh %{cross_path} create
560 if [ -f /boot/System.map-%{kversion} ]; then
561 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
563 depmod -ae %{kversion} || exit 0
566 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
567 # "weak modules" support
569 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
570 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
571 /usr/lib/module-init-tools/weak-modules --add-modules
574 if [ -x /sbin/weak-modules ]; then
575 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
576 /sbin/weak-modules --add-modules
579 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
580 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
581 # print a warning so that users are aware of this issue.
582 if sysctl kernel.unsupported >/dev/null 2>&1 &&
583 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
584 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
586 warning: the Lustre modules are not supported by Novell. To use Lustre
587 on this system, you should put
589 allow_unsupported_modules 1
591 into /etc/modprobe.d/unsupported_modules"
597 %if %{defined rpm_post_base}
598 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
599 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
602 if [ -f /boot/System.map-%{kversion} ]; then
603 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
605 depmod -ae %{kversion} || exit 0
608 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
609 # "weak modules" support
611 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
612 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
613 /usr/lib/module-init-tools/weak-modules --add-modules
616 if [ -x /sbin/weak-modules ]; then
617 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
618 /sbin/weak-modules --add-modules
621 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
622 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
623 # print a warning so that users are aware of this issue.
624 if sysctl kernel.unsupported >/dev/null 2>&1 &&
625 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
626 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
628 warning: the Lustre modules are not supported by Novell. To use Lustre
629 on this system, you should put
631 allow_unsupported_modules 1
633 into /etc/modprobe.d/unsupported_modules"
640 %if %{defined rpm_post_base}
641 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
642 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
645 if [ -f /boot/System.map-%{kversion} ]; then
646 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
648 depmod -ae %{kversion} || exit 0
651 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
652 # "weak modules" support
654 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
655 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
656 /usr/lib/module-init-tools/weak-modules --add-modules
659 if [ -x /sbin/weak-modules ]; then
660 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
661 /sbin/weak-modules --add-modules
664 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
665 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
666 # print a warning so that users are aware of this issue.
667 if sysctl kernel.unsupported >/dev/null 2>&1 &&
668 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
669 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
671 warning: the Lustre modules are not supported by Novell. To use Lustre
672 on this system, you should put
674 allow_unsupported_modules 1
676 into /etc/modprobe.d/unsupported_modules"
682 %if %{defined rpm_post_base}
683 if [ -x %{rpm_post_base}-modules.sh ]; then
684 %{rpm_post_base}-modules.sh %{cross_path} remove
687 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
688 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
693 %if %{defined rpm_post_base}
694 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
695 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
698 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
699 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
705 %if %{defined rpm_post_base}
706 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
707 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
710 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
711 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
715 %if %{undefined cross_path}
717 if [ -f /boot/System.map-%{kversion} ]; then
718 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
720 depmod -ae %{kversion} || exit 0
723 # "weak modules" support
725 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
726 cat /var/run/%{name}-modules |
727 /usr/lib/module-init-tools/weak-modules --remove-modules
730 if [ -x /sbin/weak-modules ]; then
731 cat /var/run/%{name}-modules |
732 /sbin/weak-modules --remove-modules
734 rm /var/run/%{name}-modules
738 if [ -f /boot/System.map-%{kversion} ]; then
739 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
741 depmod -ae %{kversion} || exit 0
744 # "weak modules" support
746 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
747 cat /var/run/%{name}-osd-ldiskfs |
748 /usr/lib/module-init-tools/weak-modules --remove-modules
751 if [ -x /sbin/weak-modules ]; then
752 cat /var/run/%{name}-osd-ldiskfs |
753 /sbin/weak-modules --remove-modules
755 rm /var/run/%{name}-osd-ldiskfs
760 if [ -f /boot/System.map-%{kversion} ]; then
761 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
763 depmod -ae %{kversion} || exit 0
766 # "weak modules" support
768 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
769 cat /var/run/%{name}-osd-zfs |
770 /usr/lib/module-init-tools/weak-modules --remove-modules
773 if [ -x /sbin/weak-modules ]; then
774 cat /var/run/%{name}-osd-zfs |
775 /sbin/weak-modules --remove-modules
777 rm /var/run/%{name}-osd-zfs
780 %endif # with lustre_modules
782 %if %{with lustre_tests}
783 %if %{defined rpm_post_base}
785 if [ -x %{rpm_post_base}-tests.sh ]; then
786 %{rpm_post_base}-tests.sh %{cross_path} create
790 if [ -x %{rpm_post_base}-tests.sh ]; then
791 %{rpm_post_base}-tests.sh %{cross_path} remove
794 %if %{with lustre_modules}
796 if [ -f /boot/System.map-%{kversion} ]; then
797 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
799 depmod -ae %{kversion} || exit 0
803 if [ -f /boot/System.map-%{kversion} ]; then
804 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
806 depmod -ae %{kversion} || exit 0
813 rm -rf $RPM_BUILD_ROOT