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 %bcond_without manpages
16 %if %{without servers}
17 # --without servers overrides --with {ldiskfs|zfs}
18 # so undefine the internal variables set by bcond_*
19 %undefine with_ldiskfs
23 %{!?version: %global version @VERSION@}
24 %{!?kver: %global kver %(uname -r)}
25 %{!?kdir: %global kdir /lib/modules/%{kver}/source}
26 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{kver}/source" ]; then echo "/lib/modules/%{kver}/build"; else echo "%{kdir}"; fi)}
28 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
29 %{!?kversion: %global kversion %(files="include/generated/utsrelease.h include/linux/utsrelease.h include/linux/version.h"; for f in $files; do if test -r %{kobjdir}/$f && grep UTS_RELEASE %{kobjdir}/$f >/dev/null; then sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' %{kobjdir}/$f; break; fi; done)}
31 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
33 %if 0%{?build_src_rpm}
34 %{!?myrelease: %global myrelease 1}
36 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
37 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
38 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
40 %define krequires %(echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/\.aarch64$//' -e 's/-default$//')
43 # always append the buildid, even when the caller defines %release
44 %define fullrelease %{myrelease}%{buildid}
46 # in order to get kernel symset and/or kernel module dependencies into
47 # the RPM, in order to support weak-modules, the internal dependency gen-
48 # erator needs to be disabled
49 # this is done with (reduce the double % down to a single %):
51 # %%global _use_internal_dependency_generator 0
53 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
54 # defining it here (until Suse changes their mind)
56 # on RHEL5, however, we do need to explicitly disable the internal dep-
57 # endency generator and allow the external one be used
58 # but since RedHat's kABI is only a subset of the total kernel ABI, it
59 # doesn't include all of the symbols we (or OFED for that matter) need
60 # until RedHat includes all of the symbols we need in their symsets we
61 # cannot support weak-modules
62 # we did e-mail the maintainer of all of this stuff @redhat but got no
64 #%%global _use_internal_dependency_generator 0
66 # Set the package name prefix
67 %if %{undefined lustre_name}
69 %global lustre_name lustre
71 %global lustre_name lustre-client
75 %if %{undefined kmoddir}
76 %if %{defined kernel_module_package_moddir}
77 %global kmoddir %{kernel_module_package_moddir}
79 %if %{defined suse_kernel_module_package}
80 %global kmoddir updates
87 %if %{defined cross_path} && %{defined post_script}
88 %define rpm_post_base %(dirname %{cross_path})/%{lustre_name}
91 # SUSE don't support .debug_info section from cross compiler:
92 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
93 %if %{defined cross_path} && 0%{?suse_version}
94 %global __debug_install_post %{nil}
95 %global __debug_package %{nil}
96 %global debug_package %{nil}
99 Summary: Lustre File System
102 Release: %{fullrelease}
104 Group: Utilities/System
105 Source: lustre-%{version}.tar.gz
106 URL: https://wiki.hpdd.intel.com/
107 BuildRoot: %{_tmppath}/lustre-%{version}-root
108 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
109 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
110 Requires: %{name}-modules = %{version}
111 BuildRequires: libtool
113 BuildRequires: python-docutils
117 Requires: lustre-osd-mount
118 Provides: lustre-client = %{version}-%{fullrelease}
120 %if %{defined cross_requires}
121 Requires: %{cross_requires}
124 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
125 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
126 #suse don't support selinux
127 BuildRequires: libselinux-devel
133 Userspace tools and files for the Lustre file system.
135 %if %{with lustre_modules}
137 Summary: Kernel Lustre modules for Linux %{kversion}
138 %if %{defined cross_requires}
139 Requires: %{cross_requires}
142 # for SLES11, we need nothing here
143 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
144 %if %{defined krequires}
145 # for RHEL we need to require the specific kernel still since weak-modules
146 # support on RH is, well, weak, to be punny about it
147 Requires: kernel = %{krequires}
151 BuildRequires: libyaml-devel
155 Group: Development/Kernel
158 Lustre file system, server and network drivers for Linux %{kversion}.
162 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
163 Requires: lustre-modules = %{version}
164 Requires: module-init-tools >= 3.9
165 Requires: ldiskfsprogs >= 1.42.7.wc1
166 Requires: lustre-osd-ldiskfs-mount = %{version}
168 Obsoletes: lustre-ldiskfs
169 Group: Development/Kernel
171 %description osd-ldiskfs
172 The Lustre Object Storage Device (OSD) API is the interface to access and
173 modify data that is supposed to be stored persistently. This API is the interface
174 to code that bridges individual file systems. This specific package provides an
175 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
176 backing store of a Lustre server.
178 %if %{with lustre_utils}
179 %package osd-ldiskfs-mount
180 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
181 Provides: lustre-osd-mount
182 Group: Development/Kernel
184 %description osd-ldiskfs-mount
185 LDISKFS hooks for mount/mkfs into a dynamic library.
192 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
193 Requires: lustre-modules = %{version}, zfs-kmod
194 Requires: lustre-osd-zfs-mount = %{version}
196 Group: Development/Kernel
199 The Lustre Object Storage Device (OSD) API is the interface to access and
200 modify data that is supposed to be stored persistently. This API is the interface
201 to code that bridges individual file systems. This specific package provides an
202 implementation of the OSD API for using the ZFS filesystem as the underlying
203 backing store of a Lustre server.
205 %if %{with lustre_utils}
206 %package osd-zfs-mount
207 Summary: osd-zfs-mount contains mount's zfs specific dso.
208 Provides: lustre-osd-mount
209 Group: Development/Kernel
211 %description osd-zfs-mount
212 ZFS hooks for mount/mkfs into a dynamic library.
216 %endif # with lustre_modules
219 Summary: Object-Based Disk storage driver source
220 Group: Development/Kernel
223 Lustre sources for further development
225 # Since the RPMs we ship are to be used on both SLES and RHEL, we
226 # can't include any dependency information (since the package names
227 # are different on the two platforms).
229 # Instead, we can build these empty meta-packages that only include
230 # dependency information. These let people get the correct
231 # dependencies for their platform and lets them use tools like yum and
232 # red carpet to install the correct files.
234 # Unfortunately I have not seen this come up on the lists much, so I
235 # have disabled them (by commenting out their empty files section
236 # below) until it's clear that they resolve more confusion than they
240 Summary: Lustre dependencies meta-package for SLES
241 Group: Utilities/System
242 Provides: lustre-deps = %{version}
243 Requires: %{name} = %{version}, sles-release
244 Conflicts: %{name}-deps-rhel
246 %description deps-sles
247 This package has RPM dependencies appropriate for SLES systems.
250 Summary: Lustre dependencies meta-package for RHEL
251 Group: Utilities/System
252 Provides: lustre-deps = %{version}
253 Requires: %{name} = %{version}, redhat-release
254 Conflicts: %{name}-deps-sles
256 %description deps-rhel
257 This package has RPM dependencies appropriate for RHEL, RHL, and FC
261 Summary: Lustre testing framework
262 Group: Development/Kernel
263 Provides: %{name}-tests = %{version}
264 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
265 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
268 This package contains a set of test binaries and scripts that are intended
269 to be used by the Lustre testing framework.
271 %if %{with lustre_iokit}
272 %package -n lustre-iokit
273 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
274 Group: Applications/System
275 Requires: python > 2.2, sg3_utils
277 %description -n lustre-iokit
278 This package includes five tools:
280 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
283 This survey can be run in 3 modes to test disk I/O including the filesystem,
284 network I/O, and disk I/O via the network. The script does sequential I/O
285 with varying numbers of threads and objects (files) by using lctl::test_brw
286 to drive the echo_client connected to local or remote obdfilter instances,
287 or remote obdecho instances.
290 This survey tests the client-to-disk performance of individual OSTs, and
291 ranks then for comparison.
294 This script will collect IO stats on a defined set of nodes.
297 A script to run the IOR benchmark. The latest version can be downloaded from
298 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
301 This survey tests the local metadata performance using the echo_client to drive
302 the MDD layer to perform operations. It is run with multiple threads (to
303 simulate MDT service threads) locally on the MDS node, and does not need Lustre
304 clients in order to run
307 %if 0%{?suse_version}
311 %setup -qn lustre-%{version}
312 ln lustre/ChangeLog ChangeLog-lustre
313 ln lnet/ChangeLog ChangeLog-lnet
317 # Set an explicit path to our Linux tree, if we can.
318 cd $RPM_BUILD_DIR/lustre-%{version}
319 # override %optflags so that the vendor's overzealous flags don't create
321 %define optflags -g -O2 -Werror
323 CONFIGURE_ARGS="%{?configure_args}"
324 if [ -n "$CONFIGURE_ARGS" ]; then
325 # make sure %%kdir and %%kobjdir are not in the configure arguments
326 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
327 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
328 # remove --with-kmp-moddir from configure arguments,
329 # it will be set --with-kmp-moddir=%%kmoddir
330 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
333 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
334 # string in it which we don't want word splitted by the shell
335 # also remove (build|host|target) options because they will be specified
336 # inside $CONFIGURE_ARGS
337 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
339 %eval_configure $CONFIGURE_ARGS \
340 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
341 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
342 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
343 %{!?with_shared:--disable-shared} \
344 %{!?with_static:--disable-static} \
345 %{!?with_lustre_iokit:--disable-iokit} \
346 %{!?with_ldiskfs:--disable-ldiskfs} \
347 %{!?with_servers:--disable-server} \
348 %{!?with_zfs:--without-zfs} \
349 %{!?with_lnet_dlc:--disable-dlc} \
350 %{!?with_manpages:--disable-manpages} \
351 --with-release=%{release} \
352 --with-linux=%{kdir} \
353 --with-linux-obj=%{kobjdir} \
354 --with-kmp-moddir=%{kmoddir}
356 make %{?_smp_mflags} -s %{?make_args}
359 make install DESTDIR=$RPM_BUILD_ROOT
363 %if %{with servers} && %{with lustre_utils}
364 # The .ha_v2 extension identifies the heartbeat resource agent as using
365 # legacy syntax. Install a compatibility symlink to avoid conflicts when
366 # newer-style agents are added.
367 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
368 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
369 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
372 %if %{_vendor}=="redhat"
373 # The following scripts are Red Hat specific
375 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
376 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
378 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
381 # Create the pristine source directory.
382 cd $RPM_BUILD_DIR/lustre-%{version}
383 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
385 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
386 make distdir distdir=lustre-source/lustre-%{version}
387 chmod -R go-w lustre-source/lustre-%{version}
388 # fc18 needs 'x' permission for library files
389 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
392 rm -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.la
394 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
397 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
398 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files
403 echo '%{_libdir}/libiam.a' >>lustre.files
406 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
407 echo '%{_libdir}/lustre/snmp' >>lustre.files
408 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
411 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
412 -name \*.la -type f -exec rm -f {} \;
414 %if %{with lustre_tests}
415 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
416 echo '%{_bindir}/mcreate' >>lustre-tests.files
417 echo '%{_bindir}/munlink' >>lustre-tests.files
418 echo '%{_bindir}/req_layout' >>lustre-tests.files
419 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
420 echo '%{_sbindir}/wiretest' >>lustre-tests.files
421 %if %{with lustre_modules}
422 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
426 %if %{defined cross_path}
427 %if %{defined rpm_post_base}
428 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
429 if [ -f $POST_SCRIPT ]; then
430 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
431 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
432 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
434 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
435 %if %{with lustre_utils}
436 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
440 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
441 %if %{with lustre_utils}
442 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
445 %if %{with lustre_tests}
446 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
447 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
452 %if %{with lustre_modules}
453 # mark modules executable for find-debuginfo.sh
454 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
455 -name \*.ko -type f -exec chmod u+x {} \;
459 %files -f lustre.files
460 %defattr(-,root,root)
462 %exclude %{_sbindir}/wirecheck
463 %exclude %{_sbindir}/wiretest
465 %exclude %{_sbindir}/zfsobj2fid
467 %if %{with lustre_utils}
469 %{_libexecdir}/lustre/lc_common
470 %{_libexecdir}/lustre/haconfig
471 %{_bindir}/lustre_req_history
476 %{_bindir}/plot-llstat
479 %{_bindir}/lfs_migrate
480 %{?rootdir}/sbin/mount.lustre
481 %{_libdir}/libptlctl.a
482 %{_libdir}/libcfsutil.a
483 %{_libdir}/liblustreapi.a
484 %{_libdir}/liblustreapi.so
488 %{_includedir}/lustre
489 %{_includedir}/libcfs
492 %{_sysconfdir}/udev/rules.d/99-lustre.rules
493 %config(noreplace) %{_sysconfdir}/ldev.conf
494 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
496 %if %{with lustre_modules}
498 %defattr(-,root,root)
499 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
500 %if %{with lustre_tests}
501 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
504 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
505 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
508 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
510 %if %{defined rpm_post_base}
511 %attr(0555, root, root) %{rpm_post_base}-modules.sh
514 %doc ChangeLog-lustre
519 %defattr(-,root,root)
520 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
521 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
522 %if %{defined rpm_post_base}
523 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
525 %if %{with lustre_utils}
526 %files osd-ldiskfs-mount
527 %defattr(-,root,root)
528 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
529 %if %{defined rpm_post_base}
530 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
537 %defattr(-,root,root)
538 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
539 %{_sbindir}/zfsobj2fid
540 %if %{defined rpm_post_base}
541 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
543 %if %{with lustre_utils}
545 %defattr(-,root,root)
546 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
547 %if %{defined rpm_post_base}
548 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
552 %endif # with lustre_modules
555 %defattr(-,root,root)
556 %{_prefix}/src/lustre-%{version}
558 # uncomment these lines to enable deps packages
562 %if %{with lustre_tests}
563 %files tests -f lustre-tests.files
564 %defattr(-,root,root)
567 %if %{with lustre_iokit}
568 %files -n lustre-iokit
569 %defattr(-, root, root)
570 %{_bindir}/iokit-config
571 %{_bindir}/iokit-gather-stats
572 %{_bindir}/iokit-libecho
573 %{_bindir}/iokit-lstats
574 %{_bindir}/iokit-parse-ior
575 %{_bindir}/iokit-plot-obdfilter
576 %{_bindir}/iokit-plot-ost
577 %{_bindir}/iokit-plot-sgpdd
578 %{_bindir}/ior-survey
579 %{_bindir}/mds-survey
580 %{_bindir}/obdfilter-survey
581 %{_bindir}/ost-survey
582 %{_bindir}/sgpdd-survey
583 %doc lustre-iokit/ior-survey/README.ior-survey
584 %doc lustre-iokit/mds-survey/README.mds-survey
585 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
586 %doc lustre-iokit/ost-survey/README.ost-survey
587 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
588 %doc lustre-iokit/stats-collect/README.iokit-lstats
591 %if %{defined rpm_post_base}
593 if [ -x %{rpm_post_base}.sh ]; then
594 %{rpm_post_base}.sh %{cross_path} create
598 if [ -x %{rpm_post_base}.sh ]; then
599 %{rpm_post_base}.sh %{cross_path} remove
603 %if %{with lustre_modules}
605 %if %{defined rpm_post_base}
606 if [ -x %{rpm_post_base}-modules.sh ]; then
607 %{rpm_post_base}-modules.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 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
617 # "weak modules" support
619 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
620 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
621 /usr/lib/module-init-tools/weak-modules --add-modules
624 if [ -x /sbin/weak-modules ]; then
625 rpm -ql $MODULES_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}-osd-ldiskfs.sh ]; then
649 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
652 if [ -f /boot/System.map-%{kversion} ]; then
653 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
655 depmod -ae %{kversion} || exit 0
658 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
659 # "weak modules" support
661 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
662 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
663 /usr/lib/module-init-tools/weak-modules --add-modules
666 if [ -x /sbin/weak-modules ]; then
667 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
668 /sbin/weak-modules --add-modules
671 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
672 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
673 # print a warning so that users are aware of this issue.
674 if sysctl kernel.unsupported >/dev/null 2>&1 &&
675 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
676 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
678 warning: the Lustre modules are not supported by Novell. To use Lustre
679 on this system, you should put
681 allow_unsupported_modules 1
683 into /etc/modprobe.d/unsupported_modules"
686 %if %{with lustre_utils} && %{defined rpm_post_base}
687 %post osd-ldiskfs-mount
688 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
689 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
696 %if %{defined rpm_post_base}
697 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
698 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
701 if [ -f /boot/System.map-%{kversion} ]; then
702 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
704 depmod -ae %{kversion} || exit 0
707 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
708 # "weak modules" support
710 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
711 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
712 /usr/lib/module-init-tools/weak-modules --add-modules
715 if [ -x /sbin/weak-modules ]; then
716 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
717 /sbin/weak-modules --add-modules
720 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
721 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
722 # print a warning so that users are aware of this issue.
723 if sysctl kernel.unsupported >/dev/null 2>&1 &&
724 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
725 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
727 warning: the Lustre modules are not supported by Novell. To use Lustre
728 on this system, you should put
730 allow_unsupported_modules 1
732 into /etc/modprobe.d/unsupported_modules"
735 %if %{with lustre_utils} && %{defined rpm_post_base}
737 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
738 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
744 %if %{defined rpm_post_base}
745 if [ -x %{rpm_post_base}-modules.sh ]; then
746 %{rpm_post_base}-modules.sh %{cross_path} remove
749 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
750 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
755 %if %{defined rpm_post_base}
756 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
757 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
760 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
761 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
763 %if %{with lustre_utils} && %{defined rpm_post_base}
764 %preun osd-ldiskfs-mount
765 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
766 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
773 %if %{defined rpm_post_base}
774 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
775 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
778 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
779 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
781 %if %{with lustre_utils} && %{defined rpm_post_base}
783 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
784 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
789 %if %{undefined cross_path}
791 if [ -f /boot/System.map-%{kversion} ]; then
792 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
794 depmod -ae %{kversion} || exit 0
797 # "weak modules" support
799 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
800 cat /var/run/%{name}-modules |
801 /usr/lib/module-init-tools/weak-modules --remove-modules
804 if [ -x /sbin/weak-modules ]; then
805 cat /var/run/%{name}-modules |
806 /sbin/weak-modules --remove-modules
808 rm /var/run/%{name}-modules
812 if [ -f /boot/System.map-%{kversion} ]; then
813 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
815 depmod -ae %{kversion} || exit 0
818 # "weak modules" support
820 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
821 cat /var/run/%{name}-osd-ldiskfs |
822 /usr/lib/module-init-tools/weak-modules --remove-modules
825 if [ -x /sbin/weak-modules ]; then
826 cat /var/run/%{name}-osd-ldiskfs |
827 /sbin/weak-modules --remove-modules
829 rm /var/run/%{name}-osd-ldiskfs
834 if [ -f /boot/System.map-%{kversion} ]; then
835 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
837 depmod -ae %{kversion} || exit 0
840 # "weak modules" support
842 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
843 cat /var/run/%{name}-osd-zfs |
844 /usr/lib/module-init-tools/weak-modules --remove-modules
847 if [ -x /sbin/weak-modules ]; then
848 cat /var/run/%{name}-osd-zfs |
849 /sbin/weak-modules --remove-modules
851 rm /var/run/%{name}-osd-zfs
854 %endif # with lustre_modules
856 %if %{with lustre_tests}
857 %if %{defined rpm_post_base}
859 if [ -x %{rpm_post_base}-tests.sh ]; then
860 %{rpm_post_base}-tests.sh %{cross_path} create
864 if [ -x %{rpm_post_base}-tests.sh ]; then
865 %{rpm_post_base}-tests.sh %{cross_path} remove
868 %if %{with lustre_modules}
870 if [ -f /boot/System.map-%{kversion} ]; then
871 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
873 depmod -ae %{kversion} || exit 0
877 if [ -f /boot/System.map-%{kversion} ]; then
878 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
880 depmod -ae %{kversion} || exit 0
887 rm -rf $RPM_BUILD_ROOT