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
14 %if %{without servers}
15 # --without servers overrides --with {ldiskfs|zfs}
16 # so undefine the internal variables set by bcond_*
17 %undefine with_ldiskfs
21 %{!?version: %global version @VERSION@}
22 %{!?kver: %global kver %(uname -r)}
23 %{!?kdir: %global kdir /lib/modules/%{kver}/source}
24 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{kver}/source" ]; then echo "/lib/modules/%{kver}/build"; else echo "%{kdir}"; fi)}
26 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
27 %{!?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)}
29 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
31 %if 0%{?build_src_rpm}
32 %{!?myrelease: %global myrelease 1}
34 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
35 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
36 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
38 %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$//')
41 # always append the buildid, even when the caller defines %release
42 %define fullrelease %{myrelease}%{buildid}
44 # in order to get kernel symset and/or kernel module dependencies into
45 # the RPM, in order to support weak-modules, the internal dependency gen-
46 # erator needs to be disabled
47 # this is done with (reduce the double % down to a single %):
49 # %%global _use_internal_dependency_generator 0
51 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
52 # defining it here (until Suse changes their mind)
54 # on RHEL5, however, we do need to explicitly disable the internal dep-
55 # endency generator and allow the external one be used
56 # but since RedHat's kABI is only a subset of the total kernel ABI, it
57 # doesn't include all of the symbols we (or OFED for that matter) need
58 # until RedHat includes all of the symbols we need in their symsets we
59 # cannot support weak-modules
60 # we did e-mail the maintainer of all of this stuff @redhat but got no
62 #%%global _use_internal_dependency_generator 0
64 # Set the package name prefix
65 %if %{undefined lustre_name}
67 %global lustre_name lustre
69 %global lustre_name lustre-client
73 %if %{undefined kmoddir}
74 %if %{defined kernel_module_package_moddir}
75 %global kmoddir %{kernel_module_package_moddir}
77 %if %{defined suse_kernel_module_package}
78 %global kmoddir updates
85 %if %{defined cross_path} && %{defined post_script}
86 %define rpm_post_base %(dirname %{cross_path})/%{lustre_name}
89 # SUSE don't support .debug_info section from cross compiler:
90 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
91 %if %{defined cross_path} && 0%{?suse_version}
92 %global __debug_install_post %{nil}
93 %global __debug_package %{nil}
94 %global debug_package %{nil}
97 Summary: Lustre File System
100 Release: %{fullrelease}
102 Group: Utilities/System
103 Source: lustre-%{version}.tar.gz
104 URL: https://wiki.hpdd.intel.com/
105 BuildRoot: %{_tmppath}/lustre-%{version}-root
106 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
107 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
108 Requires: %{name}-modules = %{version}
109 BuildRequires: libtool
111 BuildRequires: python-docutils
115 Requires: lustre-osd-mount
117 %if %{defined cross_requires}
118 Requires: %{cross_requires}
121 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
122 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
123 #suse don't support selinux
124 BuildRequires: libselinux-devel
130 Userspace tools and files for the Lustre file system.
132 %if %{with lustre_modules}
134 Summary: Kernel Lustre modules for Linux %{kversion}
135 %if %{defined cross_requires}
136 Requires: %{cross_requires}
139 # for SLES11, we need nothing here
140 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
141 %if %{defined krequires}
142 # for RHEL we need to require the specific kernel still since weak-modules
143 # support on RH is, well, weak, to be punny about it
144 Requires: kernel = %{krequires}
148 BuildRequires: libyaml-devel
152 Group: Development/Kernel
155 Lustre file system, server and network drivers for Linux %{kversion}.
159 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
160 Requires: lustre-modules = %{version}
161 Requires: module-init-tools >= 3.9
162 Requires: ldiskfsprogs >= 1.42.7.wc1
163 Requires: lustre-osd-ldiskfs-mount = %{version}
165 Obsoletes: lustre-ldiskfs
166 Group: Development/Kernel
168 %description osd-ldiskfs
169 The Lustre Object Storage Device (OSD) API is the interface to access and
170 modify data that is supposed to be stored persistently. This API is the interface
171 to code that bridges individual file systems. This specific package provides an
172 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
173 backing store of a Lustre server.
175 %if %{with lustre_utils}
176 %package osd-ldiskfs-mount
177 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
178 Provides: lustre-osd-mount
179 Group: Development/Kernel
181 %description osd-ldiskfs-mount
182 LDISKFS hooks for mount/mkfs into a dynamic library.
189 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
190 Requires: lustre-modules = %{version}, zfs-kmod
191 Requires: lustre-osd-zfs-mount = %{version}
193 Group: Development/Kernel
196 The Lustre Object Storage Device (OSD) API is the interface to access and
197 modify data that is supposed to be stored persistently. This API is the interface
198 to code that bridges individual file systems. This specific package provides an
199 implementation of the OSD API for using the ZFS filesystem as the underlying
200 backing store of a Lustre server.
202 %if %{with lustre_utils}
203 %package osd-zfs-mount
204 Summary: osd-zfs-mount contains mount's zfs specific dso.
205 Provides: lustre-osd-mount
206 Group: Development/Kernel
208 %description osd-zfs-mount
209 ZFS hooks for mount/mkfs into a dynamic library.
213 %endif # with lustre_modules
216 Summary: Object-Based Disk storage driver source
217 Group: Development/Kernel
220 Lustre sources for further development
222 # Since the RPMs we ship are to be used on both SLES and RHEL, we
223 # can't include any dependency information (since the package names
224 # are different on the two platforms).
226 # Instead, we can build these empty meta-packages that only include
227 # dependency information. These let people get the correct
228 # dependencies for their platform and lets them use tools like yum and
229 # red carpet to install the correct files.
231 # Unfortunately I have not seen this come up on the lists much, so I
232 # have disabled them (by commenting out their empty files section
233 # below) until it's clear that they resolve more confusion than they
237 Summary: Lustre dependencies meta-package for SLES
238 Group: Utilities/System
239 Provides: lustre-deps = %{version}
240 Requires: %{name} = %{version}, sles-release
241 Conflicts: %{name}-deps-rhel
243 %description deps-sles
244 This package has RPM dependencies appropriate for SLES systems.
247 Summary: Lustre dependencies meta-package for RHEL
248 Group: Utilities/System
249 Provides: lustre-deps = %{version}
250 Requires: %{name} = %{version}, redhat-release
251 Conflicts: %{name}-deps-sles
253 %description deps-rhel
254 This package has RPM dependencies appropriate for RHEL, RHL, and FC
258 Summary: Lustre testing framework
259 Group: Development/Kernel
260 Provides: %{name}-tests = %{version}
261 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
262 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
265 This package contains a set of test binaries and scripts that are intended
266 to be used by the Lustre testing framework.
268 %if %{with lustre_iokit}
269 %package -n lustre-iokit
270 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
271 Group: Applications/System
272 Requires: python > 2.2, sg3_utils
274 %description -n lustre-iokit
275 This package includes five tools:
277 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
280 This survey can be run in 3 modes to test disk I/O including the filesystem,
281 network I/O, and disk I/O via the network. The script does sequential I/O
282 with varying numbers of threads and objects (files) by using lctl::test_brw
283 to drive the echo_client connected to local or remote obdfilter instances,
284 or remote obdecho instances.
287 This survey tests the client-to-disk performance of individual OSTs, and
288 ranks then for comparison.
291 This script will collect IO stats on a defined set of nodes.
294 A script to run the IOR benchmark. The latest version can be downloaded from
295 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
298 This survey tests the local metadata performance using the echo_client to drive
299 the MDD layer to perform operations. It is run with multiple threads (to
300 simulate MDT service threads) locally on the MDS node, and does not need Lustre
301 clients in order to run
304 %if 0%{?suse_version}
308 %setup -qn lustre-%{version}
309 ln lustre/ChangeLog ChangeLog-lustre
310 ln lnet/ChangeLog ChangeLog-lnet
314 # Set an explicit path to our Linux tree, if we can.
315 cd $RPM_BUILD_DIR/lustre-%{version}
316 # override %optflags so that the vendor's overzealous flags don't create
318 %define optflags -g -O2 -Werror
320 CONFIGURE_ARGS="%{?configure_args}"
321 if [ -n "$CONFIGURE_ARGS" ]; then
322 # make sure %%kdir and %%kobjdir are not in the configure arguments
323 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
324 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
325 # remove --with-kmp-moddir from configure arguments,
326 # it will be set --with-kmp-moddir=%%kmoddir
327 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')
336 %eval_configure $CONFIGURE_ARGS \
337 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
338 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
339 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
340 %{!?with_lustre_iokit:--disable-iokit} \
341 %{!?with_ldiskfs:--disable-ldiskfs} \
342 %{!?with_servers:--disable-server} \
343 %{!?with_zfs:--without-zfs} \
344 %{!?with_lnet_dlc:--disable-dlc} \
345 %{!?with_manpages:--disable-manpages} \
346 --with-release=%{release} \
347 --with-linux=%{kdir} \
348 --with-linux-obj=%{kobjdir} \
349 --with-kmp-moddir=%{kmoddir}
351 make %{?_smp_mflags} -s %{?make_args}
354 make install DESTDIR=$RPM_BUILD_ROOT
358 %if %{with servers} && %{with lustre_utils}
359 # The .ha_v2 extension identifies the heartbeat resource agent as using
360 # legacy syntax. Install a compatibility symlink to avoid conflicts when
361 # newer-style agents are added.
362 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
363 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
364 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
367 %if %{_vendor}=="redhat"
368 # The following scripts are Red Hat specific
370 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
371 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
373 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
376 # Create the pristine source directory.
377 cd $RPM_BUILD_DIR/lustre-%{version}
378 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
380 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
381 make distdir distdir=lustre-source/lustre-%{version}
382 chmod -R go-w lustre-source/lustre-%{version}
383 # fc18 needs 'x' permission for library files
384 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
387 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
388 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
392 echo '%{_libdir}/libiam.a' >>lustre.files
395 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
396 echo '%{_libdir}/lustre/snmp' >>lustre.files
397 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
400 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
401 -name \*.la -type f -exec rm -f {} \;
403 %if %{with lustre_tests}
404 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
405 echo '%{_bindir}/mcreate' >>lustre-tests.files
406 echo '%{_bindir}/munlink' >>lustre-tests.files
407 echo '%{_bindir}/req_layout' >>lustre-tests.files
408 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
409 echo '%{_sbindir}/wiretest' >>lustre-tests.files
410 %if %{with lustre_modules}
411 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
415 %if %{defined cross_path}
416 %if %{defined rpm_post_base}
417 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
418 if [ -f $POST_SCRIPT ]; then
419 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
420 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
421 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
423 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
424 %if %{with lustre_utils}
425 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
429 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
430 %if %{with lustre_utils}
431 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
434 %if %{with lustre_tests}
435 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
436 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
441 %if %{with lustre_modules}
442 # mark modules executable for find-debuginfo.sh
443 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
444 -name \*.ko -type f -exec chmod u+x {} \;
448 %files -f lustre.files
449 %defattr(-,root,root)
451 %exclude %{_sbindir}/wirecheck
452 %exclude %{_sbindir}/wiretest
454 %exclude %{_sbindir}/zfsobj2fid
456 %if %{with lustre_utils}
458 %{_libexecdir}/lustre/lc_common
459 %{_libexecdir}/lustre/haconfig
460 %{_bindir}/lustre_req_history
465 %{_bindir}/plot-llstat
468 %{_bindir}/lfs_migrate
469 %{?rootdir}/sbin/mount.lustre
470 %{_libdir}/libptlctl.a
471 %{_libdir}/libcfsutil.a
472 %{_libdir}/liblustreapi.a
473 %{_libdir}/liblustreapi.so
477 %{_includedir}/lustre
478 %{_includedir}/libcfs
481 %{_sysconfdir}/udev/rules.d/99-lustre.rules
482 %config(noreplace) %{_sysconfdir}/ldev.conf
483 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
485 %if %{with lustre_modules}
487 %defattr(-,root,root)
488 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
489 %if %{with lustre_tests}
490 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
493 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
494 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
497 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
499 %if %{defined rpm_post_base}
500 %attr(0555, root, root) %{rpm_post_base}-modules.sh
503 %doc ChangeLog-lustre
508 %defattr(-,root,root)
509 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
510 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
511 %if %{defined rpm_post_base}
512 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
514 %if %{with lustre_utils}
515 %files osd-ldiskfs-mount
516 %defattr(-,root,root)
517 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
518 %if %{defined rpm_post_base}
519 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
526 %defattr(-,root,root)
527 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
528 %{_sbindir}/zfsobj2fid
529 %if %{defined rpm_post_base}
530 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
532 %if %{with lustre_utils}
534 %defattr(-,root,root)
535 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
536 %if %{defined rpm_post_base}
537 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
541 %endif # with lustre_modules
544 %defattr(-,root,root)
545 %{_prefix}/src/lustre-%{version}
547 # uncomment these lines to enable deps packages
551 %if %{with lustre_tests}
552 %files tests -f lustre-tests.files
553 %defattr(-,root,root)
556 %if %{with lustre_iokit}
557 %files -n lustre-iokit
558 %defattr(-, root, root)
559 %{_bindir}/iokit-config
560 %{_bindir}/iokit-gather-stats
561 %{_bindir}/iokit-libecho
562 %{_bindir}/iokit-lstats
563 %{_bindir}/iokit-parse-ior
564 %{_bindir}/iokit-plot-obdfilter
565 %{_bindir}/iokit-plot-ost
566 %{_bindir}/iokit-plot-sgpdd
567 %{_bindir}/ior-survey
568 %{_bindir}/mds-survey
569 %{_bindir}/obdfilter-survey
570 %{_bindir}/ost-survey
571 %{_bindir}/sgpdd-survey
572 %doc lustre-iokit/ior-survey/README.ior-survey
573 %doc lustre-iokit/mds-survey/README.mds-survey
574 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
575 %doc lustre-iokit/ost-survey/README.ost-survey
576 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
577 %doc lustre-iokit/stats-collect/README.iokit-lstats
580 %if %{defined rpm_post_base}
582 if [ -x %{rpm_post_base}.sh ]; then
583 %{rpm_post_base}.sh %{cross_path} create
587 if [ -x %{rpm_post_base}.sh ]; then
588 %{rpm_post_base}.sh %{cross_path} remove
592 %if %{with lustre_modules}
594 %if %{defined rpm_post_base}
595 if [ -x %{rpm_post_base}-modules.sh ]; then
596 %{rpm_post_base}-modules.sh %{cross_path} create
599 if [ -f /boot/System.map-%{kversion} ]; then
600 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
602 depmod -ae %{kversion} || exit 0
605 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
606 # "weak modules" support
608 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
609 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
610 /usr/lib/module-init-tools/weak-modules --add-modules
613 if [ -x /sbin/weak-modules ]; then
614 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
615 /sbin/weak-modules --add-modules
618 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
619 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
620 # print a warning so that users are aware of this issue.
621 if sysctl kernel.unsupported >/dev/null 2>&1 &&
622 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
623 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
625 warning: the Lustre modules are not supported by Novell. To use Lustre
626 on this system, you should put
628 allow_unsupported_modules 1
630 into /etc/modprobe.d/unsupported_modules"
636 %if %{defined rpm_post_base}
637 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
638 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
641 if [ -f /boot/System.map-%{kversion} ]; then
642 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
644 depmod -ae %{kversion} || exit 0
647 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
648 # "weak modules" support
650 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
651 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
652 /usr/lib/module-init-tools/weak-modules --add-modules
655 if [ -x /sbin/weak-modules ]; then
656 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
657 /sbin/weak-modules --add-modules
660 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
661 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
662 # print a warning so that users are aware of this issue.
663 if sysctl kernel.unsupported >/dev/null 2>&1 &&
664 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
665 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
667 warning: the Lustre modules are not supported by Novell. To use Lustre
668 on this system, you should put
670 allow_unsupported_modules 1
672 into /etc/modprobe.d/unsupported_modules"
675 %if %{with lustre_utils} && %{defined rpm_post_base}
676 %post osd-ldiskfs-mount
677 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
678 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
685 %if %{defined rpm_post_base}
686 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
687 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
690 if [ -f /boot/System.map-%{kversion} ]; then
691 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
693 depmod -ae %{kversion} || exit 0
696 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
697 # "weak modules" support
699 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
700 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
701 /usr/lib/module-init-tools/weak-modules --add-modules
704 if [ -x /sbin/weak-modules ]; then
705 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
706 /sbin/weak-modules --add-modules
709 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
710 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
711 # print a warning so that users are aware of this issue.
712 if sysctl kernel.unsupported >/dev/null 2>&1 &&
713 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
714 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
716 warning: the Lustre modules are not supported by Novell. To use Lustre
717 on this system, you should put
719 allow_unsupported_modules 1
721 into /etc/modprobe.d/unsupported_modules"
724 %if %{with lustre_utils} && %{defined rpm_post_base}
726 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
727 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
733 %if %{defined rpm_post_base}
734 if [ -x %{rpm_post_base}-modules.sh ]; then
735 %{rpm_post_base}-modules.sh %{cross_path} remove
738 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
739 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
744 %if %{defined rpm_post_base}
745 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
746 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
749 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
750 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
752 %if %{with lustre_utils} && %{defined rpm_post_base}
753 %preun osd-ldiskfs-mount
754 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
755 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
762 %if %{defined rpm_post_base}
763 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
764 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
767 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
768 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
770 %if %{with lustre_utils} && %{defined rpm_post_base}
772 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
773 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
778 %if %{undefined cross_path}
780 if [ -f /boot/System.map-%{kversion} ]; then
781 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
783 depmod -ae %{kversion} || exit 0
786 # "weak modules" support
788 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
789 cat /var/run/%{name}-modules |
790 /usr/lib/module-init-tools/weak-modules --remove-modules
793 if [ -x /sbin/weak-modules ]; then
794 cat /var/run/%{name}-modules |
795 /sbin/weak-modules --remove-modules
797 rm /var/run/%{name}-modules
801 if [ -f /boot/System.map-%{kversion} ]; then
802 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
804 depmod -ae %{kversion} || exit 0
807 # "weak modules" support
809 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
810 cat /var/run/%{name}-osd-ldiskfs |
811 /usr/lib/module-init-tools/weak-modules --remove-modules
814 if [ -x /sbin/weak-modules ]; then
815 cat /var/run/%{name}-osd-ldiskfs |
816 /sbin/weak-modules --remove-modules
818 rm /var/run/%{name}-osd-ldiskfs
823 if [ -f /boot/System.map-%{kversion} ]; then
824 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
826 depmod -ae %{kversion} || exit 0
829 # "weak modules" support
831 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
832 cat /var/run/%{name}-osd-zfs |
833 /usr/lib/module-init-tools/weak-modules --remove-modules
836 if [ -x /sbin/weak-modules ]; then
837 cat /var/run/%{name}-osd-zfs |
838 /sbin/weak-modules --remove-modules
840 rm /var/run/%{name}-osd-zfs
843 %endif # with lustre_modules
845 %if %{with lustre_tests}
846 %if %{defined rpm_post_base}
848 if [ -x %{rpm_post_base}-tests.sh ]; then
849 %{rpm_post_base}-tests.sh %{cross_path} create
853 if [ -x %{rpm_post_base}-tests.sh ]; then
854 %{rpm_post_base}-tests.sh %{cross_path} remove
857 %if %{with lustre_modules}
859 if [ -f /boot/System.map-%{kversion} ]; then
860 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
862 depmod -ae %{kversion} || exit 0
866 if [ -f /boot/System.map-%{kversion} ]; then
867 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
869 depmod -ae %{kversion} || exit 0
876 rm -rf $RPM_BUILD_ROOT