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 ""}
22 %{!?kdir: %global kdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; echo "/lib/modules/$kversion/source"; fi)}
24 %{!?kobjdir: %global kobjdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux-obj=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; if [ "%kdir" = "/lib/modules/$kversion/source" ]; then echo "/lib/modules/$kversion/build"; else echo "%kdir"; fi; fi)}
26 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
27 %{!?kversion: %global kversion %(if test -s %kobjdir/include/generated/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/generated/utsrelease.h ; elif test -s %kobjdir/include/linux/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/linux/utsrelease.h ; else LINUXRELEASEHEADER=%kobjdir/include/linux/version.h; fi; sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' $LINUXRELEASEHEADER)}
29 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
31 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
33 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
35 # always append the buildid, even when the caller defines %release
36 %define fullrelease %{myrelease}%{buildid}
38 # in order to get kernel symset and/or kernel module dependencies into
39 # the RPM, in order to support weak-modules, the internal dependency gen-
40 # erator needs to be disabled
41 # this is done with (reduce the double % down to a single %):
43 # %%global _use_internal_dependency_generator 0
45 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
46 # defining it here (until Suse changes their mind)
48 # on RHEL5, however, we do need to explicitly disable the internal dep-
49 # endency generator and allow the external one be used
50 # but since RedHat's kABI is only a subset of the total kernel ABI, it
51 # doesn't include all of the symbols we (or OFED for that matter) need
52 # until RedHat includes all of the symbols we need in their symsets we
53 # cannot support weak-modules
54 # we did e-mail the maintainer of all of this stuff @redhat but got no
56 #%%global _use_internal_dependency_generator 0
58 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
60 %define krequires %(bash -c "echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/-ppc64$//' -e 's/-default$//'")
62 # Set the package name prefix
63 %if %{undefined lustre_name}
65 %global lustre_name lustre
67 %global lustre_name lustre-client
71 %if %{undefined kmoddir}
72 %if %{defined kernel_module_package_moddir}
73 %global kmoddir %{kernel_module_package_moddir}
75 %if %{defined suse_kernel_module_package}
76 %global kmoddir updates
83 %if %{defined cross_path} && %{defined post_script}
84 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
87 # SUSE don't support .debug_info section from cross compiler:
88 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
89 %if %{defined cross_path} && 0%{?suse_version}
90 %global __debug_install_post %{nil}
91 %global __debug_package %{nil}
92 %global debug_package %{nil}
95 Summary: Lustre File System
98 Release: %{fullrelease}
100 Group: Utilities/System
101 Source: lustre-%{version}.tar.gz
102 URL: https://wiki.hpdd.intel.com/
103 BuildRoot: %{_tmppath}/lustre-%{version}-root
104 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
105 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
106 Requires: %{name}-modules = %{version}
107 BuildRequires: libtool
111 %if %{defined cross_requires}
112 Requires: %{cross_requires}
115 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
116 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
117 #suse don't support selinux
118 BuildRequires: libselinux-devel
124 Userspace tools and files for the Lustre file system.
126 %if %{with lustre_modules}
128 Summary: Kernel Lustre modules for Linux %{kversion}
129 %if %{defined cross_requires}
130 Requires: %{cross_requires}
133 # for SLES11, we need nothing here
134 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
135 # for RHEL we need to require the specific kernel still since weak-modules
136 # support on RH is, well, weak, to be punny about it
137 Requires: kernel = %{krequires}
140 BuildRequires: libyaml-devel
144 Group: Development/Kernel
147 Lustre file system, server and network drivers for Linux %{kversion}.
151 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
152 Requires: lustre-modules = %{version}
153 Requires: module-init-tools >= 3.9
154 Requires: ldiskfsprogs >= 1.42.7.wc1
156 Obsoletes: lustre-ldiskfs
157 Group: Development/Kernel
159 %description osd-ldiskfs
160 The Lustre Object Storage Device (OSD) API is the interface to access and
161 modify data that is supposed to be stored persistently. This API is the interface
162 to code that bridges individual file systems. This specific package provides an
163 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
164 backing store of a Lustre server.
169 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
170 Requires: lustre-modules = %{version}, zfs-kmod
172 Group: Development/Kernel
175 The Lustre Object Storage Device (OSD) API is the interface to access and
176 modify data that is supposed to be stored persistently. This API is the interface
177 to code that bridges individual file systems. This specific package provides an
178 implementation of the OSD API for using the ZFS filesystem as the underlying
179 backing store of a Lustre server.
181 %endif # with lustre_modules
184 Summary: Object-Based Disk storage driver source
185 Group: Development/Kernel
188 Lustre sources for further development
190 # Since the RPMs we ship are to be used on both SLES and RHEL, we
191 # can't include any dependency information (since the package names
192 # are different on the two platforms).
194 # Instead, we can build these empty meta-packages that only include
195 # dependency information. These let people get the correct
196 # dependencies for their platform and lets them use tools like yum and
197 # red carpet to install the correct files.
199 # Unfortunately I have not seen this come up on the lists much, so I
200 # have disabled them (by commenting out their empty files section
201 # below) until it's clear that they resolve more confusion than they
205 Summary: Lustre dependencies meta-package for SLES
206 Group: Utilities/System
207 Provides: lustre-deps = %{version}
208 Requires: %{name} = %{version}, sles-release
209 Conflicts: %{name}-deps-rhel
211 %description deps-sles
212 This package has RPM dependencies appropriate for SLES systems.
215 Summary: Lustre dependencies meta-package for RHEL
216 Group: Utilities/System
217 Provides: lustre-deps = %{version}
218 Requires: %{name} = %{version}, redhat-release
219 Conflicts: %{name}-deps-sles
221 %description deps-rhel
222 This package has RPM dependencies appropriate for RHEL, RHL, and FC
226 Summary: Lustre testing framework
227 Group: Development/Kernel
228 Provides: %{name}-tests = %{version}
229 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
230 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
233 This package contains a set of test binaries and scripts that are intended
234 to be used by the Lustre testing framework.
236 %if %{with lustre_iokit}
237 %package -n lustre-iokit
238 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
239 Group: Applications/System
240 Requires: python > 2.2, sg3_utils
242 %description -n lustre-iokit
243 This package includes five tools:
245 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
248 This survey can be run in 3 modes to test disk I/O including the filesystem,
249 network I/O, and disk I/O via the network. The script does sequential I/O
250 with varying numbers of threads and objects (files) by using lctl::test_brw
251 to drive the echo_client connected to local or remote obdfilter instances,
252 or remote obdecho instances.
255 This survey tests the client-to-disk performance of individual OSTs, and
256 ranks then for comparison.
259 This script will collect IO stats on a defined set of nodes.
262 A script to run the IOR benchmark. The latest version can be downloaded from
263 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
266 This survey tests the local metadata performance using the echo_client to drive
267 the MDD layer to perform operations. It is run with multiple threads (to
268 simulate MDT service threads) locally on the MDS node, and does not need Lustre
269 clients in order to run
272 %if 0%{?suse_version}
276 %setup -qn lustre-%{version}
277 ln lustre/ChangeLog ChangeLog-lustre
278 ln lnet/ChangeLog ChangeLog-lnet
282 # Set an explicit path to our Linux tree, if we can.
283 cd $RPM_BUILD_DIR/lustre-%{version}
284 # override %optflags so that the vendor's overzealous flags don't create
286 %define optflags -g -O2 -Werror
287 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
289 %if %{with lustre_tests}
290 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests"
292 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests"
295 %if %{with lustre_utils}
296 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-utils"
298 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-utils"
301 %if %{without lustre_iokit}
302 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
305 %if %{with lustre_modules}
306 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
308 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
311 %if %{without servers}
312 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-server"
315 %if %{without ldiskfs}
316 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-ldiskfs"
320 CONFIGURE_ARGS="$CONFIGURE_ARGS --without-zfs"
323 # if %%kdir was given, make sure it's not in the configure arguments
324 if [ -n "%kdir" ]; then
325 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
327 # ditto for %%kobjdir
328 if [ -n "%kobjdir" ]; then
329 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
331 # remove --with-kmp-moddir from configure arguments,
332 # it will be set --with-kmp-moddir=%%kmoddir
333 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
335 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
336 # string in it which we don't want word splitted by the shell
337 # also remove (build|host|target) options because they will be specified
338 # inside $CONFIGURE_ARGS
339 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
342 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
343 $CONFIGURE_ARGS --with-kmp-moddir=%{kmoddir}
344 make %{?_smp_mflags} -s %{?make_args}
347 make install DESTDIR=$RPM_BUILD_ROOT
352 # The .ha_v2 extension identifies the heartbeat resource agent as using
353 # legacy syntax. Install a compatibility symlink to avoid conflicts when
354 # newer-style agents are added.
355 %if %{with lustre_utils}
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 [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then
362 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
363 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
367 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then
368 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
371 # Create the pristine source directory.
372 cd $RPM_BUILD_DIR/lustre-%{version}
373 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
375 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
376 make distdir distdir=lustre-source/lustre-%{version}
377 chmod -R go-w lustre-source/lustre-%{version}
378 # fc18 needs 'x' permission for library files
379 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
381 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.a ] ; then
382 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
383 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
386 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
387 echo '%{_libdir}/liblustre.a' >>lustre.files
388 echo '%{_libdir}/liblustre.so' >>lustre.files
391 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
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@/ -name \*.la -type f -delete
402 %if %{with lustre_tests}
403 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
404 echo '%{_bindir}/mcreate' >>lustre-tests.files
405 echo '%{_bindir}/munlink' >>lustre-tests.files
406 echo '%{_bindir}/req_layout' >>lustre-tests.files
407 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
408 echo '%{_sbindir}/wiretest' >>lustre-tests.files
409 %if %{with lustre_modules}
410 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
414 %if %{defined cross_path}
415 %if %{defined rpm_post_base}
416 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
417 if [ -f $POST_SCRIPT ]; then
418 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
419 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
420 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
422 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
425 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
427 %if %{with lustre_tests}
428 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
429 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
434 %if %{with lustre_modules}
435 # mark modules executable for find-debuginfo.sh
436 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
437 -name \*.ko -type f -exec chmod u+x {} \;
441 %files -f lustre.files
442 %defattr(-,root,root)
444 %if %{with lustre_utils}
446 %{_libexecdir}/lustre/lc_common
447 %{_libexecdir}/lustre/haconfig
448 %{_bindir}/lustre_req_history
453 %{_bindir}/plot-llstat
456 %{_bindir}/lfs_migrate
457 %{?rootdir}/sbin/mount.lustre
458 %{_libdir}/libptlctl.a
459 %{_libdir}/libcfsutil.a
460 %{_libdir}/liblustreapi.a
461 %{_libdir}/liblustreapi.so
463 %{_includedir}/lustre
464 %{_includedir}/libcfs
465 %{_includedir}/linux/lustre_user.h
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 %{with lustre_utils}
498 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
500 %if %{defined rpm_post_base}
501 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
507 %defattr(-,root,root)
508 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
509 %if %{with lustre_utils}
510 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
512 %if %{defined rpm_post_base}
513 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
516 %endif # with lustre_modules
519 %defattr(-,root,root)
520 %{_prefix}/src/lustre-%{version}
522 # uncomment these lines to enable deps packages
526 %if %{with lustre_tests}
527 %files tests -f lustre-tests.files
528 %defattr(-,root,root)
531 %if %{with lustre_iokit}
532 %files -n lustre-iokit
533 %defattr(-, root, root)
534 %{_bindir}/iokit-config
535 %{_bindir}/iokit-gather-stats
536 %{_bindir}/iokit-libecho
537 %{_bindir}/iokit-lstats
538 %{_bindir}/iokit-parse-ior
539 %{_bindir}/iokit-plot-obdfilter
540 %{_bindir}/iokit-plot-ost
541 %{_bindir}/iokit-plot-sgpdd
542 %{_bindir}/ior-survey
543 %{_bindir}/mds-survey
544 %{_bindir}/obdfilter-survey
545 %{_bindir}/ost-survey
546 %{_bindir}/sgpdd-survey
547 %doc lustre-iokit/ior-survey/README.ior-survey
548 %doc lustre-iokit/mds-survey/README.mds-survey
549 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
550 %doc lustre-iokit/ost-survey/README.ost-survey
551 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
552 %doc lustre-iokit/stats-collect/README.iokit-lstats
555 %if %{defined rpm_post_base}
557 if [ -x %{rpm_post_base}.sh ]; then
558 %{rpm_post_base}.sh %{cross_path} create
562 if [ -x %{rpm_post_base}.sh ]; then
563 %{rpm_post_base}.sh %{cross_path} remove
567 %if %{with lustre_modules}
569 %if %{defined rpm_post_base}
570 if [ -x %{rpm_post_base}-modules.sh ]; then
571 %{rpm_post_base}-modules.sh %{cross_path} create
574 if [ -f /boot/System.map-%{kversion} ]; then
575 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
577 depmod -ae %{kversion} || exit 0
580 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
581 # "weak modules" support
583 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
584 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
585 /usr/lib/module-init-tools/weak-modules --add-modules
588 if [ -x /sbin/weak-modules ]; then
589 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
590 /sbin/weak-modules --add-modules
593 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
594 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
595 # print a warning so that users are aware of this issue.
596 if sysctl kernel.unsupported >/dev/null 2>&1 &&
597 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
598 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
600 warning: the Lustre modules are not supported by Novell. To use Lustre
601 on this system, you should put
603 allow_unsupported_modules 1
605 into /etc/modprobe.d/unsupported_modules"
611 %if %{defined rpm_post_base}
612 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
613 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
616 if [ -f /boot/System.map-%{kversion} ]; then
617 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
619 depmod -ae %{kversion} || exit 0
622 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
623 # "weak modules" support
625 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
626 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
627 /usr/lib/module-init-tools/weak-modules --add-modules
630 if [ -x /sbin/weak-modules ]; then
631 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
632 /sbin/weak-modules --add-modules
635 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
636 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
637 # print a warning so that users are aware of this issue.
638 if sysctl kernel.unsupported >/dev/null 2>&1 &&
639 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
640 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
642 warning: the Lustre modules are not supported by Novell. To use Lustre
643 on this system, you should put
645 allow_unsupported_modules 1
647 into /etc/modprobe.d/unsupported_modules"
654 %if %{defined rpm_post_base}
655 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
656 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
659 if [ -f /boot/System.map-%{kversion} ]; then
660 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
662 depmod -ae %{kversion} || exit 0
665 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
666 # "weak modules" support
668 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
669 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
670 /usr/lib/module-init-tools/weak-modules --add-modules
673 if [ -x /sbin/weak-modules ]; then
674 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
675 /sbin/weak-modules --add-modules
678 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
679 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
680 # print a warning so that users are aware of this issue.
681 if sysctl kernel.unsupported >/dev/null 2>&1 &&
682 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
683 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
685 warning: the Lustre modules are not supported by Novell. To use Lustre
686 on this system, you should put
688 allow_unsupported_modules 1
690 into /etc/modprobe.d/unsupported_modules"
696 %if %{defined rpm_post_base}
697 if [ -x %{rpm_post_base}-modules.sh ]; then
698 %{rpm_post_base}-modules.sh %{cross_path} remove
701 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
702 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
707 %if %{defined rpm_post_base}
708 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
709 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
712 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
713 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
719 %if %{defined rpm_post_base}
720 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
721 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
724 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
725 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
729 %if %{undefined cross_path}
731 if [ -f /boot/System.map-%{kversion} ]; then
732 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
734 depmod -ae %{kversion} || exit 0
737 # "weak modules" support
739 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
740 cat /var/run/%{name}-modules |
741 /usr/lib/module-init-tools/weak-modules --remove-modules
744 if [ -x /sbin/weak-modules ]; then
745 cat /var/run/%{name}-modules |
746 /sbin/weak-modules --remove-modules
748 rm /var/run/%{name}-modules
752 if [ -f /boot/System.map-%{kversion} ]; then
753 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
755 depmod -ae %{kversion} || exit 0
758 # "weak modules" support
760 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
761 cat /var/run/%{name}-osd-ldiskfs |
762 /usr/lib/module-init-tools/weak-modules --remove-modules
765 if [ -x /sbin/weak-modules ]; then
766 cat /var/run/%{name}-osd-ldiskfs |
767 /sbin/weak-modules --remove-modules
769 rm /var/run/%{name}-osd-ldiskfs
774 if [ -f /boot/System.map-%{kversion} ]; then
775 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
777 depmod -ae %{kversion} || exit 0
780 # "weak modules" support
782 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
783 cat /var/run/%{name}-osd-zfs |
784 /usr/lib/module-init-tools/weak-modules --remove-modules
787 if [ -x /sbin/weak-modules ]; then
788 cat /var/run/%{name}-osd-zfs |
789 /sbin/weak-modules --remove-modules
791 rm /var/run/%{name}-osd-zfs
794 %endif # with lustre_modules
796 %if %{with lustre_tests}
797 %if %{defined rpm_post_base}
799 if [ -x %{rpm_post_base}-tests.sh ]; then
800 %{rpm_post_base}-tests.sh %{cross_path} create
804 if [ -x %{rpm_post_base}-tests.sh ]; then
805 %{rpm_post_base}-tests.sh %{cross_path} remove
808 %if %{with lustre_modules}
810 if [ -f /boot/System.map-%{kversion} ]; then
811 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
813 depmod -ae %{kversion} || exit 0
817 if [ -f /boot/System.map-%{kversion} ]; then
818 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
820 depmod -ae %{kversion} || exit 0
827 rm -rf $RPM_BUILD_ROOT