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
410 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
411 -name \*.la -type f -exec rm -f {} \;
413 %if %{with lustre_tests}
414 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
415 echo '%{_bindir}/mcreate' >>lustre-tests.files
416 echo '%{_bindir}/munlink' >>lustre-tests.files
417 echo '%{_bindir}/req_layout' >>lustre-tests.files
418 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
419 echo '%{_sbindir}/wiretest' >>lustre-tests.files
420 %if %{with lustre_modules}
421 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
425 %if %{defined cross_path}
426 %if %{defined rpm_post_base}
427 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
428 if [ -f $POST_SCRIPT ]; then
429 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
430 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
431 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
433 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
434 %if %{with lustre_utils}
435 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
439 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
440 %if %{with lustre_utils}
441 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
444 %if %{with lustre_tests}
445 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
446 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
451 %if %{with lustre_modules}
452 # mark modules executable for find-debuginfo.sh
453 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
454 -name \*.ko -type f -exec chmod u+x {} \;
458 %files -f lustre.files
459 %defattr(-,root,root)
461 %exclude %{_sbindir}/wirecheck
462 %exclude %{_sbindir}/wiretest
464 %exclude %{_sbindir}/zfsobj2fid
466 %if %{with lustre_utils}
468 %{_libexecdir}/lustre/lc_common
469 %{_libexecdir}/lustre/haconfig
470 %{_bindir}/lustre_req_history
475 %{_bindir}/plot-llstat
478 %{_bindir}/lfs_migrate
479 %{?rootdir}/sbin/mount.lustre
480 %{_libdir}/libptlctl.a
481 %{_libdir}/libcfsutil.a
482 %{_libdir}/liblustreapi.a
483 %{_libdir}/liblustreapi.so
487 %{_includedir}/lustre
488 %{_includedir}/libcfs
491 %{_sysconfdir}/udev/rules.d/99-lustre.rules
492 %config(noreplace) %{_sysconfdir}/ldev.conf
493 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
495 %if %{with lustre_modules}
497 %defattr(-,root,root)
498 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
499 %if %{with lustre_tests}
500 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
503 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
504 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
507 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
509 %if %{defined rpm_post_base}
510 %attr(0555, root, root) %{rpm_post_base}-modules.sh
513 %doc ChangeLog-lustre
518 %defattr(-,root,root)
519 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
520 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
521 %if %{defined rpm_post_base}
522 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
524 %if %{with lustre_utils}
525 %files osd-ldiskfs-mount
526 %defattr(-,root,root)
527 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
528 %if %{defined rpm_post_base}
529 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
536 %defattr(-,root,root)
537 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
538 %{_sbindir}/zfsobj2fid
539 %if %{defined rpm_post_base}
540 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
542 %if %{with lustre_utils}
544 %defattr(-,root,root)
545 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
546 %if %{defined rpm_post_base}
547 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
551 %endif # with lustre_modules
554 %defattr(-,root,root)
555 %{_prefix}/src/lustre-%{version}
557 # uncomment these lines to enable deps packages
561 %if %{with lustre_tests}
562 %files tests -f lustre-tests.files
563 %defattr(-,root,root)
566 %if %{with lustre_iokit}
567 %files -n lustre-iokit
568 %defattr(-, root, root)
569 %{_bindir}/iokit-config
570 %{_bindir}/iokit-gather-stats
571 %{_bindir}/iokit-libecho
572 %{_bindir}/iokit-lstats
573 %{_bindir}/iokit-parse-ior
574 %{_bindir}/iokit-plot-obdfilter
575 %{_bindir}/iokit-plot-ost
576 %{_bindir}/iokit-plot-sgpdd
577 %{_bindir}/ior-survey
578 %{_bindir}/mds-survey
579 %{_bindir}/obdfilter-survey
580 %{_bindir}/ost-survey
581 %{_bindir}/sgpdd-survey
582 %doc lustre-iokit/ior-survey/README.ior-survey
583 %doc lustre-iokit/mds-survey/README.mds-survey
584 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
585 %doc lustre-iokit/ost-survey/README.ost-survey
586 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
587 %doc lustre-iokit/stats-collect/README.iokit-lstats
590 %if %{defined rpm_post_base}
592 if [ -x %{rpm_post_base}.sh ]; then
593 %{rpm_post_base}.sh %{cross_path} create
597 if [ -x %{rpm_post_base}.sh ]; then
598 %{rpm_post_base}.sh %{cross_path} remove
602 %if %{with lustre_modules}
604 %if %{defined rpm_post_base}
605 if [ -x %{rpm_post_base}-modules.sh ]; then
606 %{rpm_post_base}-modules.sh %{cross_path} create
609 if [ -f /boot/System.map-%{kversion} ]; then
610 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
612 depmod -ae %{kversion} || exit 0
615 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
616 # "weak modules" support
618 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
619 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
620 /usr/lib/module-init-tools/weak-modules --add-modules
623 if [ -x /sbin/weak-modules ]; then
624 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
625 /sbin/weak-modules --add-modules
628 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
629 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
630 # print a warning so that users are aware of this issue.
631 if sysctl kernel.unsupported >/dev/null 2>&1 &&
632 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
633 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
635 warning: the Lustre modules are not supported by Novell. To use Lustre
636 on this system, you should put
638 allow_unsupported_modules 1
640 into /etc/modprobe.d/unsupported_modules"
646 %if %{defined rpm_post_base}
647 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
648 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
651 if [ -f /boot/System.map-%{kversion} ]; then
652 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
654 depmod -ae %{kversion} || exit 0
657 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
658 # "weak modules" support
660 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
661 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
662 /usr/lib/module-init-tools/weak-modules --add-modules
665 if [ -x /sbin/weak-modules ]; then
666 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
667 /sbin/weak-modules --add-modules
670 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
671 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
672 # print a warning so that users are aware of this issue.
673 if sysctl kernel.unsupported >/dev/null 2>&1 &&
674 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
675 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
677 warning: the Lustre modules are not supported by Novell. To use Lustre
678 on this system, you should put
680 allow_unsupported_modules 1
682 into /etc/modprobe.d/unsupported_modules"
685 %if %{with lustre_utils} && %{defined rpm_post_base}
686 %post osd-ldiskfs-mount
687 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
688 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
695 %if %{defined rpm_post_base}
696 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
697 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
700 if [ -f /boot/System.map-%{kversion} ]; then
701 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
703 depmod -ae %{kversion} || exit 0
706 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
707 # "weak modules" support
709 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
710 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
711 /usr/lib/module-init-tools/weak-modules --add-modules
714 if [ -x /sbin/weak-modules ]; then
715 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
716 /sbin/weak-modules --add-modules
719 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
720 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
721 # print a warning so that users are aware of this issue.
722 if sysctl kernel.unsupported >/dev/null 2>&1 &&
723 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
724 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
726 warning: the Lustre modules are not supported by Novell. To use Lustre
727 on this system, you should put
729 allow_unsupported_modules 1
731 into /etc/modprobe.d/unsupported_modules"
734 %if %{with lustre_utils} && %{defined rpm_post_base}
736 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
737 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
743 %if %{defined rpm_post_base}
744 if [ -x %{rpm_post_base}-modules.sh ]; then
745 %{rpm_post_base}-modules.sh %{cross_path} remove
748 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
749 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
754 %if %{defined rpm_post_base}
755 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
756 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
759 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
760 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
762 %if %{with lustre_utils} && %{defined rpm_post_base}
763 %preun osd-ldiskfs-mount
764 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
765 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
772 %if %{defined rpm_post_base}
773 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
774 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
777 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
778 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
780 %if %{with lustre_utils} && %{defined rpm_post_base}
782 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
783 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
788 %if %{undefined cross_path}
790 if [ -f /boot/System.map-%{kversion} ]; then
791 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
793 depmod -ae %{kversion} || exit 0
796 # "weak modules" support
798 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
799 cat /var/run/%{name}-modules |
800 /usr/lib/module-init-tools/weak-modules --remove-modules
803 if [ -x /sbin/weak-modules ]; then
804 cat /var/run/%{name}-modules |
805 /sbin/weak-modules --remove-modules
807 rm /var/run/%{name}-modules
811 if [ -f /boot/System.map-%{kversion} ]; then
812 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
814 depmod -ae %{kversion} || exit 0
817 # "weak modules" support
819 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
820 cat /var/run/%{name}-osd-ldiskfs |
821 /usr/lib/module-init-tools/weak-modules --remove-modules
824 if [ -x /sbin/weak-modules ]; then
825 cat /var/run/%{name}-osd-ldiskfs |
826 /sbin/weak-modules --remove-modules
828 rm /var/run/%{name}-osd-ldiskfs
833 if [ -f /boot/System.map-%{kversion} ]; then
834 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
836 depmod -ae %{kversion} || exit 0
839 # "weak modules" support
841 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
842 cat /var/run/%{name}-osd-zfs |
843 /usr/lib/module-init-tools/weak-modules --remove-modules
846 if [ -x /sbin/weak-modules ]; then
847 cat /var/run/%{name}-osd-zfs |
848 /sbin/weak-modules --remove-modules
850 rm /var/run/%{name}-osd-zfs
853 %endif # with lustre_modules
855 %if %{with lustre_tests}
856 %if %{defined rpm_post_base}
858 if [ -x %{rpm_post_base}-tests.sh ]; then
859 %{rpm_post_base}-tests.sh %{cross_path} create
863 if [ -x %{rpm_post_base}-tests.sh ]; then
864 %{rpm_post_base}-tests.sh %{cross_path} remove
867 %if %{with lustre_modules}
869 if [ -f /boot/System.map-%{kversion} ]; then
870 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
872 depmod -ae %{kversion} || exit 0
876 if [ -f /boot/System.map-%{kversion} ]; then
877 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
879 depmod -ae %{kversion} || exit 0
886 rm -rf $RPM_BUILD_ROOT