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 python-docutils
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)
446 %exclude %{_sbindir}/zfsobj2fid
448 %if %{with lustre_utils}
450 %{_libexecdir}/lustre/lc_common
451 %{_libexecdir}/lustre/haconfig
452 %{_bindir}/lustre_req_history
457 %{_bindir}/plot-llstat
460 %{_bindir}/lfs_migrate
461 %{?rootdir}/sbin/mount.lustre
462 %{_libdir}/libptlctl.a
463 %{_libdir}/libcfsutil.a
464 %{_libdir}/liblustreapi.a
465 %{_libdir}/liblustreapi.so
467 %{_includedir}/lustre
468 %{_includedir}/libcfs
471 %{_sysconfdir}/udev/rules.d/99-lustre.rules
472 %config(noreplace) %{_sysconfdir}/ldev.conf
474 %if %{with lustre_modules}
476 %defattr(-,root,root)
477 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
478 %if %{with lustre_tests}
479 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
482 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
483 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
486 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
488 %if %{defined rpm_post_base}
489 %attr(0555, root, root) %{rpm_post_base}-modules.sh
492 %doc ChangeLog-lustre
497 %defattr(-,root,root)
498 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
499 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
500 %if %{defined rpm_post_base}
501 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
503 %if %{with lustre_utils}
504 %files osd-ldiskfs-mount
505 %defattr(-,root,root)
506 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
507 %if %{defined rpm_post_base}
508 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
515 %defattr(-,root,root)
516 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
517 %{_sbindir}/zfsobj2fid
518 %if %{defined rpm_post_base}
519 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
521 %if %{with lustre_utils}
523 %defattr(-,root,root)
524 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
525 %if %{defined rpm_post_base}
526 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
530 %endif # with lustre_modules
533 %defattr(-,root,root)
534 %{_prefix}/src/lustre-%{version}
536 # uncomment these lines to enable deps packages
540 %if %{with lustre_tests}
541 %files tests -f lustre-tests.files
542 %defattr(-,root,root)
545 %if %{with lustre_iokit}
546 %files -n lustre-iokit
547 %defattr(-, root, root)
548 %{_bindir}/iokit-config
549 %{_bindir}/iokit-gather-stats
550 %{_bindir}/iokit-libecho
551 %{_bindir}/iokit-lstats
552 %{_bindir}/iokit-parse-ior
553 %{_bindir}/iokit-plot-obdfilter
554 %{_bindir}/iokit-plot-ost
555 %{_bindir}/iokit-plot-sgpdd
556 %{_bindir}/ior-survey
557 %{_bindir}/mds-survey
558 %{_bindir}/obdfilter-survey
559 %{_bindir}/ost-survey
560 %{_bindir}/sgpdd-survey
561 %doc lustre-iokit/ior-survey/README.ior-survey
562 %doc lustre-iokit/mds-survey/README.mds-survey
563 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
564 %doc lustre-iokit/ost-survey/README.ost-survey
565 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
566 %doc lustre-iokit/stats-collect/README.iokit-lstats
569 %if %{defined rpm_post_base}
571 if [ -x %{rpm_post_base}.sh ]; then
572 %{rpm_post_base}.sh %{cross_path} create
576 if [ -x %{rpm_post_base}.sh ]; then
577 %{rpm_post_base}.sh %{cross_path} remove
581 %if %{with lustre_modules}
583 %if %{defined rpm_post_base}
584 if [ -x %{rpm_post_base}-modules.sh ]; then
585 %{rpm_post_base}-modules.sh %{cross_path} create
588 if [ -f /boot/System.map-%{kversion} ]; then
589 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
591 depmod -ae %{kversion} || exit 0
594 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
595 # "weak modules" support
597 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
598 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
599 /usr/lib/module-init-tools/weak-modules --add-modules
602 if [ -x /sbin/weak-modules ]; then
603 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
604 /sbin/weak-modules --add-modules
607 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
608 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
609 # print a warning so that users are aware of this issue.
610 if sysctl kernel.unsupported >/dev/null 2>&1 &&
611 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
612 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
614 warning: the Lustre modules are not supported by Novell. To use Lustre
615 on this system, you should put
617 allow_unsupported_modules 1
619 into /etc/modprobe.d/unsupported_modules"
625 %if %{defined rpm_post_base}
626 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
627 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
630 if [ -f /boot/System.map-%{kversion} ]; then
631 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
633 depmod -ae %{kversion} || exit 0
636 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
637 # "weak modules" support
639 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
640 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
641 /usr/lib/module-init-tools/weak-modules --add-modules
644 if [ -x /sbin/weak-modules ]; then
645 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
646 /sbin/weak-modules --add-modules
649 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
650 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
651 # print a warning so that users are aware of this issue.
652 if sysctl kernel.unsupported >/dev/null 2>&1 &&
653 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
654 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
656 warning: the Lustre modules are not supported by Novell. To use Lustre
657 on this system, you should put
659 allow_unsupported_modules 1
661 into /etc/modprobe.d/unsupported_modules"
664 %if %{with lustre_utils} && %{defined rpm_post_base}
665 %post osd-ldiskfs-mount
666 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
667 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
674 %if %{defined rpm_post_base}
675 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
676 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
679 if [ -f /boot/System.map-%{kversion} ]; then
680 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
682 depmod -ae %{kversion} || exit 0
685 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
686 # "weak modules" support
688 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
689 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
690 /usr/lib/module-init-tools/weak-modules --add-modules
693 if [ -x /sbin/weak-modules ]; then
694 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
695 /sbin/weak-modules --add-modules
698 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
699 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
700 # print a warning so that users are aware of this issue.
701 if sysctl kernel.unsupported >/dev/null 2>&1 &&
702 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
703 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
705 warning: the Lustre modules are not supported by Novell. To use Lustre
706 on this system, you should put
708 allow_unsupported_modules 1
710 into /etc/modprobe.d/unsupported_modules"
713 %if %{with lustre_utils} && %{defined rpm_post_base}
715 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
716 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
722 %if %{defined rpm_post_base}
723 if [ -x %{rpm_post_base}-modules.sh ]; then
724 %{rpm_post_base}-modules.sh %{cross_path} remove
727 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
728 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
733 %if %{defined rpm_post_base}
734 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
735 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
738 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
739 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
741 %if %{with lustre_utils} && %{defined rpm_post_base}
742 %preun osd-ldiskfs-mount
743 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
744 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
751 %if %{defined rpm_post_base}
752 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
753 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
756 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
757 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
759 %if %{with lustre_utils} && %{defined rpm_post_base}
761 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
762 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
767 %if %{undefined cross_path}
769 if [ -f /boot/System.map-%{kversion} ]; then
770 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
772 depmod -ae %{kversion} || exit 0
775 # "weak modules" support
777 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
778 cat /var/run/%{name}-modules |
779 /usr/lib/module-init-tools/weak-modules --remove-modules
782 if [ -x /sbin/weak-modules ]; then
783 cat /var/run/%{name}-modules |
784 /sbin/weak-modules --remove-modules
786 rm /var/run/%{name}-modules
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}-osd-ldiskfs |
800 /usr/lib/module-init-tools/weak-modules --remove-modules
803 if [ -x /sbin/weak-modules ]; then
804 cat /var/run/%{name}-osd-ldiskfs |
805 /sbin/weak-modules --remove-modules
807 rm /var/run/%{name}-osd-ldiskfs
812 if [ -f /boot/System.map-%{kversion} ]; then
813 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
815 depmod -ae %{kversion} || exit 0
818 # "weak modules" support
820 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
821 cat /var/run/%{name}-osd-zfs |
822 /usr/lib/module-init-tools/weak-modules --remove-modules
825 if [ -x /sbin/weak-modules ]; then
826 cat /var/run/%{name}-osd-zfs |
827 /sbin/weak-modules --remove-modules
829 rm /var/run/%{name}-osd-zfs
832 %endif # with lustre_modules
834 %if %{with lustre_tests}
835 %if %{defined rpm_post_base}
837 if [ -x %{rpm_post_base}-tests.sh ]; then
838 %{rpm_post_base}-tests.sh %{cross_path} create
842 if [ -x %{rpm_post_base}-tests.sh ]; then
843 %{rpm_post_base}-tests.sh %{cross_path} remove
846 %if %{with lustre_modules}
848 if [ -f /boot/System.map-%{kversion} ]; then
849 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
851 depmod -ae %{kversion} || exit 0
855 if [ -f /boot/System.map-%{kversion} ]; then
856 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
858 depmod -ae %{kversion} || exit 0
865 rm -rf $RPM_BUILD_ROOT