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/-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
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
484 %if %{with lustre_modules}
486 %defattr(-,root,root)
487 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
488 %if %{with lustre_tests}
489 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
492 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
493 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
496 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
498 %if %{defined rpm_post_base}
499 %attr(0555, root, root) %{rpm_post_base}-modules.sh
502 %doc ChangeLog-lustre
507 %defattr(-,root,root)
508 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
509 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
510 %if %{defined rpm_post_base}
511 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
513 %if %{with lustre_utils}
514 %files osd-ldiskfs-mount
515 %defattr(-,root,root)
516 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
517 %if %{defined rpm_post_base}
518 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
525 %defattr(-,root,root)
526 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
527 %{_sbindir}/zfsobj2fid
528 %if %{defined rpm_post_base}
529 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
531 %if %{with lustre_utils}
533 %defattr(-,root,root)
534 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
535 %if %{defined rpm_post_base}
536 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
540 %endif # with lustre_modules
543 %defattr(-,root,root)
544 %{_prefix}/src/lustre-%{version}
546 # uncomment these lines to enable deps packages
550 %if %{with lustre_tests}
551 %files tests -f lustre-tests.files
552 %defattr(-,root,root)
555 %if %{with lustre_iokit}
556 %files -n lustre-iokit
557 %defattr(-, root, root)
558 %{_bindir}/iokit-config
559 %{_bindir}/iokit-gather-stats
560 %{_bindir}/iokit-libecho
561 %{_bindir}/iokit-lstats
562 %{_bindir}/iokit-parse-ior
563 %{_bindir}/iokit-plot-obdfilter
564 %{_bindir}/iokit-plot-ost
565 %{_bindir}/iokit-plot-sgpdd
566 %{_bindir}/ior-survey
567 %{_bindir}/mds-survey
568 %{_bindir}/obdfilter-survey
569 %{_bindir}/ost-survey
570 %{_bindir}/sgpdd-survey
571 %doc lustre-iokit/ior-survey/README.ior-survey
572 %doc lustre-iokit/mds-survey/README.mds-survey
573 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
574 %doc lustre-iokit/ost-survey/README.ost-survey
575 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
576 %doc lustre-iokit/stats-collect/README.iokit-lstats
579 %if %{defined rpm_post_base}
581 if [ -x %{rpm_post_base}.sh ]; then
582 %{rpm_post_base}.sh %{cross_path} create
586 if [ -x %{rpm_post_base}.sh ]; then
587 %{rpm_post_base}.sh %{cross_path} remove
591 %if %{with lustre_modules}
593 %if %{defined rpm_post_base}
594 if [ -x %{rpm_post_base}-modules.sh ]; then
595 %{rpm_post_base}-modules.sh %{cross_path} create
598 if [ -f /boot/System.map-%{kversion} ]; then
599 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
601 depmod -ae %{kversion} || exit 0
604 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
605 # "weak modules" support
607 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
608 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
609 /usr/lib/module-init-tools/weak-modules --add-modules
612 if [ -x /sbin/weak-modules ]; then
613 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
614 /sbin/weak-modules --add-modules
617 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
618 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
619 # print a warning so that users are aware of this issue.
620 if sysctl kernel.unsupported >/dev/null 2>&1 &&
621 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
622 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
624 warning: the Lustre modules are not supported by Novell. To use Lustre
625 on this system, you should put
627 allow_unsupported_modules 1
629 into /etc/modprobe.d/unsupported_modules"
635 %if %{defined rpm_post_base}
636 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
637 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
640 if [ -f /boot/System.map-%{kversion} ]; then
641 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
643 depmod -ae %{kversion} || exit 0
646 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
647 # "weak modules" support
649 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
650 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
651 /usr/lib/module-init-tools/weak-modules --add-modules
654 if [ -x /sbin/weak-modules ]; then
655 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
656 /sbin/weak-modules --add-modules
659 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
660 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
661 # print a warning so that users are aware of this issue.
662 if sysctl kernel.unsupported >/dev/null 2>&1 &&
663 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
664 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
666 warning: the Lustre modules are not supported by Novell. To use Lustre
667 on this system, you should put
669 allow_unsupported_modules 1
671 into /etc/modprobe.d/unsupported_modules"
674 %if %{with lustre_utils} && %{defined rpm_post_base}
675 %post osd-ldiskfs-mount
676 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
677 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
684 %if %{defined rpm_post_base}
685 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
686 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
689 if [ -f /boot/System.map-%{kversion} ]; then
690 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
692 depmod -ae %{kversion} || exit 0
695 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
696 # "weak modules" support
698 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
699 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
700 /usr/lib/module-init-tools/weak-modules --add-modules
703 if [ -x /sbin/weak-modules ]; then
704 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
705 /sbin/weak-modules --add-modules
708 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
709 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
710 # print a warning so that users are aware of this issue.
711 if sysctl kernel.unsupported >/dev/null 2>&1 &&
712 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
713 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
715 warning: the Lustre modules are not supported by Novell. To use Lustre
716 on this system, you should put
718 allow_unsupported_modules 1
720 into /etc/modprobe.d/unsupported_modules"
723 %if %{with lustre_utils} && %{defined rpm_post_base}
725 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
726 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
732 %if %{defined rpm_post_base}
733 if [ -x %{rpm_post_base}-modules.sh ]; then
734 %{rpm_post_base}-modules.sh %{cross_path} remove
737 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
738 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
743 %if %{defined rpm_post_base}
744 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
745 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
748 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
749 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
751 %if %{with lustre_utils} && %{defined rpm_post_base}
752 %preun osd-ldiskfs-mount
753 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
754 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
761 %if %{defined rpm_post_base}
762 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
763 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
766 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
767 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
769 %if %{with lustre_utils} && %{defined rpm_post_base}
771 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
772 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
777 %if %{undefined cross_path}
779 if [ -f /boot/System.map-%{kversion} ]; then
780 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
782 depmod -ae %{kversion} || exit 0
785 # "weak modules" support
787 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
788 cat /var/run/%{name}-modules |
789 /usr/lib/module-init-tools/weak-modules --remove-modules
792 if [ -x /sbin/weak-modules ]; then
793 cat /var/run/%{name}-modules |
794 /sbin/weak-modules --remove-modules
796 rm /var/run/%{name}-modules
800 if [ -f /boot/System.map-%{kversion} ]; then
801 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
803 depmod -ae %{kversion} || exit 0
806 # "weak modules" support
808 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
809 cat /var/run/%{name}-osd-ldiskfs |
810 /usr/lib/module-init-tools/weak-modules --remove-modules
813 if [ -x /sbin/weak-modules ]; then
814 cat /var/run/%{name}-osd-ldiskfs |
815 /sbin/weak-modules --remove-modules
817 rm /var/run/%{name}-osd-ldiskfs
822 if [ -f /boot/System.map-%{kversion} ]; then
823 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
825 depmod -ae %{kversion} || exit 0
828 # "weak modules" support
830 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
831 cat /var/run/%{name}-osd-zfs |
832 /usr/lib/module-init-tools/weak-modules --remove-modules
835 if [ -x /sbin/weak-modules ]; then
836 cat /var/run/%{name}-osd-zfs |
837 /sbin/weak-modules --remove-modules
839 rm /var/run/%{name}-osd-zfs
842 %endif # with lustre_modules
844 %if %{with lustre_tests}
845 %if %{defined rpm_post_base}
847 if [ -x %{rpm_post_base}-tests.sh ]; then
848 %{rpm_post_base}-tests.sh %{cross_path} create
852 if [ -x %{rpm_post_base}-tests.sh ]; then
853 %{rpm_post_base}-tests.sh %{cross_path} remove
856 %if %{with lustre_modules}
858 if [ -f /boot/System.map-%{kversion} ]; then
859 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
861 depmod -ae %{kversion} || exit 0
865 if [ -f /boot/System.map-%{kversion} ]; then
866 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
868 depmod -ae %{kversion} || exit 0
875 rm -rf $RPM_BUILD_ROOT