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
13 %if %{without servers}
14 # --without servers overrides --with {ldiskfs|zfs}
15 # so undefine the internal variables set by bcond_*
16 %undefine with_ldiskfs
20 %{!?version: %global version @VERSION@}
21 %{!?kver: %global kver %(uname -r)}
22 %{!?kdir: %global kdir /lib/modules/%{kver}/source}
23 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{kver}/source" ]; then echo "/lib/modules/%{kver}/build"; else echo "%{kdir}"; fi)}
25 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
26 %{!?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)}
28 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
30 %if 0%{?build_src_rpm}
31 %{!?myrelease: %global myrelease 1}
33 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
34 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
37 # always append the buildid, even when the caller defines %release
38 %define fullrelease %{myrelease}%{buildid}
40 # in order to get kernel symset and/or kernel module dependencies into
41 # the RPM, in order to support weak-modules, the internal dependency gen-
42 # erator needs to be disabled
43 # this is done with (reduce the double % down to a single %):
45 # %%global _use_internal_dependency_generator 0
47 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
48 # defining it here (until Suse changes their mind)
50 # on RHEL5, however, we do need to explicitly disable the internal dep-
51 # endency generator and allow the external one be used
52 # but since RedHat's kABI is only a subset of the total kernel ABI, it
53 # doesn't include all of the symbols we (or OFED for that matter) need
54 # until RedHat includes all of the symbols we need in their symsets we
55 # cannot support weak-modules
56 # we did e-mail the maintainer of all of this stuff @redhat but got no
58 #%%global _use_internal_dependency_generator 0
60 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
62 %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$//')
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
112 Requires: lustre-osd-mount
114 %if %{defined cross_requires}
115 Requires: %{cross_requires}
118 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
119 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
120 #suse don't support selinux
121 BuildRequires: libselinux-devel
127 Userspace tools and files for the Lustre file system.
129 %if %{with lustre_modules}
131 Summary: Kernel Lustre modules for Linux %{kversion}
132 %if %{defined cross_requires}
133 Requires: %{cross_requires}
136 # for SLES11, we need nothing here
137 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
138 # for RHEL we need to require the specific kernel still since weak-modules
139 # support on RH is, well, weak, to be punny about it
140 Requires: kernel = %{krequires}
143 BuildRequires: libyaml-devel
147 Group: Development/Kernel
150 Lustre file system, server and network drivers for Linux %{kversion}.
154 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
155 Requires: lustre-modules = %{version}
156 Requires: module-init-tools >= 3.9
157 Requires: ldiskfsprogs >= 1.42.7.wc1
158 Requires: lustre-osd-ldiskfs-mount
160 Obsoletes: lustre-ldiskfs
161 Group: Development/Kernel
163 %description osd-ldiskfs
164 The Lustre Object Storage Device (OSD) API is the interface to access and
165 modify data that is supposed to be stored persistently. This API is the interface
166 to code that bridges individual file systems. This specific package provides an
167 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
168 backing store of a Lustre server.
170 %if %{with lustre_utils}
171 %package osd-ldiskfs-mount
172 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
173 Provides: lustre-osd-mount
174 Group: Development/Kernel
176 %description osd-ldiskfs-mount
177 LDISKFS hooks for mount/mkfs into a dynamic library.
184 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
185 Requires: lustre-modules = %{version}, zfs-kmod
186 Requires: lustre-osd-zfs-mount
188 Group: Development/Kernel
191 The Lustre Object Storage Device (OSD) API is the interface to access and
192 modify data that is supposed to be stored persistently. This API is the interface
193 to code that bridges individual file systems. This specific package provides an
194 implementation of the OSD API for using the ZFS filesystem as the underlying
195 backing store of a Lustre server.
197 %if %{with lustre_utils}
198 %package osd-zfs-mount
199 Summary: osd-zfs-mount contains mount's ldiskfs specific dso.
200 Provides: lustre-osd-mount
201 Group: Development/Kernel
203 %description osd-zfs-mount
204 ZFS hooks for mount/mkfs into a dynamic library.
208 %endif # with lustre_modules
211 Summary: Object-Based Disk storage driver source
212 Group: Development/Kernel
215 Lustre sources for further development
217 # Since the RPMs we ship are to be used on both SLES and RHEL, we
218 # can't include any dependency information (since the package names
219 # are different on the two platforms).
221 # Instead, we can build these empty meta-packages that only include
222 # dependency information. These let people get the correct
223 # dependencies for their platform and lets them use tools like yum and
224 # red carpet to install the correct files.
226 # Unfortunately I have not seen this come up on the lists much, so I
227 # have disabled them (by commenting out their empty files section
228 # below) until it's clear that they resolve more confusion than they
232 Summary: Lustre dependencies meta-package for SLES
233 Group: Utilities/System
234 Provides: lustre-deps = %{version}
235 Requires: %{name} = %{version}, sles-release
236 Conflicts: %{name}-deps-rhel
238 %description deps-sles
239 This package has RPM dependencies appropriate for SLES systems.
242 Summary: Lustre dependencies meta-package for RHEL
243 Group: Utilities/System
244 Provides: lustre-deps = %{version}
245 Requires: %{name} = %{version}, redhat-release
246 Conflicts: %{name}-deps-sles
248 %description deps-rhel
249 This package has RPM dependencies appropriate for RHEL, RHL, and FC
253 Summary: Lustre testing framework
254 Group: Development/Kernel
255 Provides: %{name}-tests = %{version}
256 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
257 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
260 This package contains a set of test binaries and scripts that are intended
261 to be used by the Lustre testing framework.
263 %if %{with lustre_iokit}
264 %package -n lustre-iokit
265 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
266 Group: Applications/System
267 Requires: python > 2.2, sg3_utils
269 %description -n lustre-iokit
270 This package includes five tools:
272 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
275 This survey can be run in 3 modes to test disk I/O including the filesystem,
276 network I/O, and disk I/O via the network. The script does sequential I/O
277 with varying numbers of threads and objects (files) by using lctl::test_brw
278 to drive the echo_client connected to local or remote obdfilter instances,
279 or remote obdecho instances.
282 This survey tests the client-to-disk performance of individual OSTs, and
283 ranks then for comparison.
286 This script will collect IO stats on a defined set of nodes.
289 A script to run the IOR benchmark. The latest version can be downloaded from
290 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
293 This survey tests the local metadata performance using the echo_client to drive
294 the MDD layer to perform operations. It is run with multiple threads (to
295 simulate MDT service threads) locally on the MDS node, and does not need Lustre
296 clients in order to run
299 %if 0%{?suse_version}
303 %setup -qn lustre-%{version}
304 ln lustre/ChangeLog ChangeLog-lustre
305 ln lnet/ChangeLog ChangeLog-lnet
309 # Set an explicit path to our Linux tree, if we can.
310 cd $RPM_BUILD_DIR/lustre-%{version}
311 # override %optflags so that the vendor's overzealous flags don't create
313 %define optflags -g -O2 -Werror
315 CONFIGURE_ARGS="%{?configure_args}"
316 if [ -n "$CONFIGURE_ARGS" ]; then
317 # make sure %%kdir and %%kobjdir are not in the configure arguments
318 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
319 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
320 # remove --with-kmp-moddir from configure arguments,
321 # it will be set --with-kmp-moddir=%%kmoddir
322 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
325 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
326 # string in it which we don't want word splitted by the shell
327 # also remove (build|host|target) options because they will be specified
328 # inside $CONFIGURE_ARGS
329 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
331 %eval_configure $CONFIGURE_ARGS \
332 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
333 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
334 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
335 %{!?with_lustre_iokit:--disable-iokit} \
336 %{!?with_ldiskfs:--disable-ldiskfs} \
337 %{!?with_servers:--disable-server} \
338 %{!?with_zfs:--without-zfs} \
339 %{!?with_lnet_dlc:--disable-dlc} \
340 --with-release=%{release} \
341 --with-linux=%{kdir} \
342 --with-linux-obj=%{kobjdir} \
343 --with-kmp-moddir=%{kmoddir}
345 make %{?_smp_mflags} -s %{?make_args}
348 make install DESTDIR=$RPM_BUILD_ROOT
352 %if %{with servers} && %{with lustre_utils}
353 # The .ha_v2 extension identifies the heartbeat resource agent as using
354 # legacy syntax. Install a compatibility symlink to avoid conflicts when
355 # newer-style agents are added.
356 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
357 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
358 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
361 %if %{_vendor}=="redhat"
362 # The following scripts are Red Hat specific
364 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
365 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
367 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
370 # Create the pristine source directory.
371 cd $RPM_BUILD_DIR/lustre-%{version}
372 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
374 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
375 make distdir distdir=lustre-source/lustre-%{version}
376 chmod -R go-w lustre-source/lustre-%{version}
377 # fc18 needs 'x' permission for library files
378 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
381 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
382 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
386 echo '%{_libdir}/libiam.a' >>lustre.files
389 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
390 echo '%{_libdir}/lustre/snmp' >>lustre.files
391 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
394 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
395 -name \*.la -type f -exec rm -f {} \;
397 %if %{with lustre_tests}
398 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
399 echo '%{_bindir}/mcreate' >>lustre-tests.files
400 echo '%{_bindir}/munlink' >>lustre-tests.files
401 echo '%{_bindir}/req_layout' >>lustre-tests.files
402 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
403 echo '%{_sbindir}/wiretest' >>lustre-tests.files
404 %if %{with lustre_modules}
405 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
409 %if %{defined cross_path}
410 %if %{defined rpm_post_base}
411 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
412 if [ -f $POST_SCRIPT ]; then
413 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
414 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
415 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
417 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
418 %if %{with lustre_utils}
419 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
423 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
424 %if %{with lustre_utils}
425 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
428 %if %{with lustre_tests}
429 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
430 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
435 %if %{with lustre_modules}
436 # mark modules executable for find-debuginfo.sh
437 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
438 -name \*.ko -type f -exec chmod u+x {} \;
442 %files -f lustre.files
443 %defattr(-,root,root)
445 %if %{with lustre_utils}
447 %{_libexecdir}/lustre/lc_common
448 %{_libexecdir}/lustre/haconfig
449 %{_bindir}/lustre_req_history
454 %{_bindir}/plot-llstat
457 %{_bindir}/lfs_migrate
458 %{?rootdir}/sbin/mount.lustre
459 %{_libdir}/libptlctl.a
460 %{_libdir}/libcfsutil.a
461 %{_libdir}/liblustreapi.a
462 %{_libdir}/liblustreapi.so
464 %{_includedir}/lustre
465 %{_includedir}/libcfs
468 %{_sysconfdir}/udev/rules.d/99-lustre.rules
469 %config(noreplace) %{_sysconfdir}/ldev.conf
471 %if %{with lustre_modules}
473 %defattr(-,root,root)
474 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
475 %if %{with lustre_tests}
476 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
479 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
480 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
483 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
485 %if %{defined rpm_post_base}
486 %attr(0555, root, root) %{rpm_post_base}-modules.sh
489 %doc ChangeLog-lustre
494 %defattr(-,root,root)
495 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
496 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
497 %if %{defined rpm_post_base}
498 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
500 %if %{with lustre_utils}
501 %files osd-ldiskfs-mount
502 %defattr(-,root,root)
503 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
504 %if %{defined rpm_post_base}
505 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
512 %defattr(-,root,root)
513 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
514 %if %{defined rpm_post_base}
515 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
517 %if %{with lustre_utils}
519 %defattr(-,root,root)
520 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
521 %if %{defined rpm_post_base}
522 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
526 %endif # with lustre_modules
529 %defattr(-,root,root)
530 %{_prefix}/src/lustre-%{version}
532 # uncomment these lines to enable deps packages
536 %if %{with lustre_tests}
537 %files tests -f lustre-tests.files
538 %defattr(-,root,root)
541 %if %{with lustre_iokit}
542 %files -n lustre-iokit
543 %defattr(-, root, root)
544 %{_bindir}/iokit-config
545 %{_bindir}/iokit-gather-stats
546 %{_bindir}/iokit-libecho
547 %{_bindir}/iokit-lstats
548 %{_bindir}/iokit-parse-ior
549 %{_bindir}/iokit-plot-obdfilter
550 %{_bindir}/iokit-plot-ost
551 %{_bindir}/iokit-plot-sgpdd
552 %{_bindir}/ior-survey
553 %{_bindir}/mds-survey
554 %{_bindir}/obdfilter-survey
555 %{_bindir}/ost-survey
556 %{_bindir}/sgpdd-survey
557 %doc lustre-iokit/ior-survey/README.ior-survey
558 %doc lustre-iokit/mds-survey/README.mds-survey
559 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
560 %doc lustre-iokit/ost-survey/README.ost-survey
561 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
562 %doc lustre-iokit/stats-collect/README.iokit-lstats
565 %if %{defined rpm_post_base}
567 if [ -x %{rpm_post_base}.sh ]; then
568 %{rpm_post_base}.sh %{cross_path} create
572 if [ -x %{rpm_post_base}.sh ]; then
573 %{rpm_post_base}.sh %{cross_path} remove
577 %if %{with lustre_modules}
579 %if %{defined rpm_post_base}
580 if [ -x %{rpm_post_base}-modules.sh ]; then
581 %{rpm_post_base}-modules.sh %{cross_path} create
584 if [ -f /boot/System.map-%{kversion} ]; then
585 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
587 depmod -ae %{kversion} || exit 0
590 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
591 # "weak modules" support
593 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
594 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
595 /usr/lib/module-init-tools/weak-modules --add-modules
598 if [ -x /sbin/weak-modules ]; then
599 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
600 /sbin/weak-modules --add-modules
603 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
604 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
605 # print a warning so that users are aware of this issue.
606 if sysctl kernel.unsupported >/dev/null 2>&1 &&
607 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
608 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
610 warning: the Lustre modules are not supported by Novell. To use Lustre
611 on this system, you should put
613 allow_unsupported_modules 1
615 into /etc/modprobe.d/unsupported_modules"
621 %if %{defined rpm_post_base}
622 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
623 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
626 if [ -f /boot/System.map-%{kversion} ]; then
627 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
629 depmod -ae %{kversion} || exit 0
632 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
633 # "weak modules" support
635 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
636 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
637 /usr/lib/module-init-tools/weak-modules --add-modules
640 if [ -x /sbin/weak-modules ]; then
641 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
642 /sbin/weak-modules --add-modules
645 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
646 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
647 # print a warning so that users are aware of this issue.
648 if sysctl kernel.unsupported >/dev/null 2>&1 &&
649 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
650 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
652 warning: the Lustre modules are not supported by Novell. To use Lustre
653 on this system, you should put
655 allow_unsupported_modules 1
657 into /etc/modprobe.d/unsupported_modules"
660 %if %{with lustre_utils} && %{defined rpm_post_base}
661 %post osd-ldiskfs-mount
662 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
663 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
670 %if %{defined rpm_post_base}
671 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
672 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
675 if [ -f /boot/System.map-%{kversion} ]; then
676 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
678 depmod -ae %{kversion} || exit 0
681 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
682 # "weak modules" support
684 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
685 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
686 /usr/lib/module-init-tools/weak-modules --add-modules
689 if [ -x /sbin/weak-modules ]; then
690 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
691 /sbin/weak-modules --add-modules
694 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
695 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
696 # print a warning so that users are aware of this issue.
697 if sysctl kernel.unsupported >/dev/null 2>&1 &&
698 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
699 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
701 warning: the Lustre modules are not supported by Novell. To use Lustre
702 on this system, you should put
704 allow_unsupported_modules 1
706 into /etc/modprobe.d/unsupported_modules"
709 %if %{with lustre_utils} && %{defined rpm_post_base}
711 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
712 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
718 %if %{defined rpm_post_base}
719 if [ -x %{rpm_post_base}-modules.sh ]; then
720 %{rpm_post_base}-modules.sh %{cross_path} remove
723 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
724 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
729 %if %{defined rpm_post_base}
730 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
731 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
734 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
735 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
737 %if %{with lustre_utils} && %{defined rpm_post_base}
738 %preun osd-ldiskfs-mount
739 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
740 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
747 %if %{defined rpm_post_base}
748 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
749 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
752 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
753 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
755 %if %{with lustre_utils} && %{defined rpm_post_base}
757 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
758 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
763 %if %{undefined cross_path}
765 if [ -f /boot/System.map-%{kversion} ]; then
766 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
768 depmod -ae %{kversion} || exit 0
771 # "weak modules" support
773 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
774 cat /var/run/%{name}-modules |
775 /usr/lib/module-init-tools/weak-modules --remove-modules
778 if [ -x /sbin/weak-modules ]; then
779 cat /var/run/%{name}-modules |
780 /sbin/weak-modules --remove-modules
782 rm /var/run/%{name}-modules
786 if [ -f /boot/System.map-%{kversion} ]; then
787 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
789 depmod -ae %{kversion} || exit 0
792 # "weak modules" support
794 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
795 cat /var/run/%{name}-osd-ldiskfs |
796 /usr/lib/module-init-tools/weak-modules --remove-modules
799 if [ -x /sbin/weak-modules ]; then
800 cat /var/run/%{name}-osd-ldiskfs |
801 /sbin/weak-modules --remove-modules
803 rm /var/run/%{name}-osd-ldiskfs
808 if [ -f /boot/System.map-%{kversion} ]; then
809 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
811 depmod -ae %{kversion} || exit 0
814 # "weak modules" support
816 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
817 cat /var/run/%{name}-osd-zfs |
818 /usr/lib/module-init-tools/weak-modules --remove-modules
821 if [ -x /sbin/weak-modules ]; then
822 cat /var/run/%{name}-osd-zfs |
823 /sbin/weak-modules --remove-modules
825 rm /var/run/%{name}-osd-zfs
828 %endif # with lustre_modules
830 %if %{with lustre_tests}
831 %if %{defined rpm_post_base}
833 if [ -x %{rpm_post_base}-tests.sh ]; then
834 %{rpm_post_base}-tests.sh %{cross_path} create
838 if [ -x %{rpm_post_base}-tests.sh ]; then
839 %{rpm_post_base}-tests.sh %{cross_path} remove
842 %if %{with lustre_modules}
844 if [ -f /boot/System.map-%{kversion} ]; then
845 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
847 depmod -ae %{kversion} || exit 0
851 if [ -f /boot/System.map-%{kversion} ]; then
852 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
854 depmod -ae %{kversion} || exit 0
861 rm -rf $RPM_BUILD_ROOT