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 echo '%{_sbindir}/loadgen' >>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
426 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-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
466 %{_includedir}/linux/lustre_user.h
469 %{_sysconfdir}/udev/rules.d/99-lustre.rules
470 %config(noreplace) %{_sysconfdir}/ldev.conf
472 %if %{with lustre_modules}
474 %defattr(-,root,root)
475 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
476 %if %{with lustre_tests}
477 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
480 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
481 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
484 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
486 %if %{defined rpm_post_base}
487 %attr(0555, root, root) %{rpm_post_base}-modules.sh
490 %doc ChangeLog-lustre
495 %defattr(-,root,root)
496 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
497 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
498 %if %{with lustre_utils}
499 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
501 %if %{defined rpm_post_base}
502 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
508 %defattr(-,root,root)
509 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
510 %if %{with lustre_utils}
511 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
513 %if %{defined rpm_post_base}
514 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
517 %endif # with lustre_modules
520 %defattr(-,root,root)
521 %{_prefix}/src/lustre-%{version}
523 # uncomment these lines to enable deps packages
527 %if %{with lustre_tests}
528 %files tests -f lustre-tests.files
529 %defattr(-,root,root)
532 %if %{with lustre_iokit}
533 %files -n lustre-iokit
534 %defattr(-, root, root)
535 %{_bindir}/iokit-config
536 %{_bindir}/iokit-gather-stats
537 %{_bindir}/iokit-libecho
538 %{_bindir}/iokit-lstats
539 %{_bindir}/iokit-parse-ior
540 %{_bindir}/iokit-plot-obdfilter
541 %{_bindir}/iokit-plot-ost
542 %{_bindir}/iokit-plot-sgpdd
543 %{_bindir}/ior-survey
544 %{_bindir}/mds-survey
545 %{_bindir}/obdfilter-survey
546 %{_bindir}/ost-survey
547 %{_bindir}/sgpdd-survey
548 %doc lustre-iokit/ior-survey/README.ior-survey
549 %doc lustre-iokit/mds-survey/README.mds-survey
550 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
551 %doc lustre-iokit/ost-survey/README.ost-survey
552 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
553 %doc lustre-iokit/stats-collect/README.iokit-lstats
556 %if %{defined rpm_post_base}
558 if [ -x %{rpm_post_base}.sh ]; then
559 %{rpm_post_base}.sh %{cross_path} create
563 if [ -x %{rpm_post_base}.sh ]; then
564 %{rpm_post_base}.sh %{cross_path} remove
568 %if %{with lustre_modules}
570 %if %{defined rpm_post_base}
571 if [ -x %{rpm_post_base}-modules.sh ]; then
572 %{rpm_post_base}-modules.sh %{cross_path} create
575 if [ -f /boot/System.map-%{kversion} ]; then
576 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
578 depmod -ae %{kversion} || exit 0
581 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
582 # "weak modules" support
584 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
585 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
586 /usr/lib/module-init-tools/weak-modules --add-modules
589 if [ -x /sbin/weak-modules ]; then
590 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
591 /sbin/weak-modules --add-modules
594 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
595 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
596 # print a warning so that users are aware of this issue.
597 if sysctl kernel.unsupported >/dev/null 2>&1 &&
598 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
599 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
601 warning: the Lustre modules are not supported by Novell. To use Lustre
602 on this system, you should put
604 allow_unsupported_modules 1
606 into /etc/modprobe.d/unsupported_modules"
612 %if %{defined rpm_post_base}
613 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
614 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
617 if [ -f /boot/System.map-%{kversion} ]; then
618 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
620 depmod -ae %{kversion} || exit 0
623 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
624 # "weak modules" support
626 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
627 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
628 /usr/lib/module-init-tools/weak-modules --add-modules
631 if [ -x /sbin/weak-modules ]; then
632 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
633 /sbin/weak-modules --add-modules
636 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
637 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
638 # print a warning so that users are aware of this issue.
639 if sysctl kernel.unsupported >/dev/null 2>&1 &&
640 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
641 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
643 warning: the Lustre modules are not supported by Novell. To use Lustre
644 on this system, you should put
646 allow_unsupported_modules 1
648 into /etc/modprobe.d/unsupported_modules"
655 %if %{defined rpm_post_base}
656 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
657 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
660 if [ -f /boot/System.map-%{kversion} ]; then
661 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
663 depmod -ae %{kversion} || exit 0
666 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
667 # "weak modules" support
669 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
670 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
671 /usr/lib/module-init-tools/weak-modules --add-modules
674 if [ -x /sbin/weak-modules ]; then
675 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
676 /sbin/weak-modules --add-modules
679 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
680 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
681 # print a warning so that users are aware of this issue.
682 if sysctl kernel.unsupported >/dev/null 2>&1 &&
683 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
684 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
686 warning: the Lustre modules are not supported by Novell. To use Lustre
687 on this system, you should put
689 allow_unsupported_modules 1
691 into /etc/modprobe.d/unsupported_modules"
697 %if %{defined rpm_post_base}
698 if [ -x %{rpm_post_base}-modules.sh ]; then
699 %{rpm_post_base}-modules.sh %{cross_path} remove
702 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
703 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
708 %if %{defined rpm_post_base}
709 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
710 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
713 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
714 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
720 %if %{defined rpm_post_base}
721 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
722 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
725 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
726 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
730 %if %{undefined cross_path}
732 if [ -f /boot/System.map-%{kversion} ]; then
733 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
735 depmod -ae %{kversion} || exit 0
738 # "weak modules" support
740 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
741 cat /var/run/%{name}-modules |
742 /usr/lib/module-init-tools/weak-modules --remove-modules
745 if [ -x /sbin/weak-modules ]; then
746 cat /var/run/%{name}-modules |
747 /sbin/weak-modules --remove-modules
749 rm /var/run/%{name}-modules
753 if [ -f /boot/System.map-%{kversion} ]; then
754 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
756 depmod -ae %{kversion} || exit 0
759 # "weak modules" support
761 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
762 cat /var/run/%{name}-osd-ldiskfs |
763 /usr/lib/module-init-tools/weak-modules --remove-modules
766 if [ -x /sbin/weak-modules ]; then
767 cat /var/run/%{name}-osd-ldiskfs |
768 /sbin/weak-modules --remove-modules
770 rm /var/run/%{name}-osd-ldiskfs
775 if [ -f /boot/System.map-%{kversion} ]; then
776 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
778 depmod -ae %{kversion} || exit 0
781 # "weak modules" support
783 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
784 cat /var/run/%{name}-osd-zfs |
785 /usr/lib/module-init-tools/weak-modules --remove-modules
788 if [ -x /sbin/weak-modules ]; then
789 cat /var/run/%{name}-osd-zfs |
790 /sbin/weak-modules --remove-modules
792 rm /var/run/%{name}-osd-zfs
795 %endif # with lustre_modules
797 %if %{with lustre_tests}
798 %if %{defined rpm_post_base}
800 if [ -x %{rpm_post_base}-tests.sh ]; then
801 %{rpm_post_base}-tests.sh %{cross_path} create
805 if [ -x %{rpm_post_base}-tests.sh ]; then
806 %{rpm_post_base}-tests.sh %{cross_path} remove
809 %if %{with lustre_modules}
811 if [ -f /boot/System.map-%{kversion} ]; then
812 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
814 depmod -ae %{kversion} || exit 0
818 if [ -f /boot/System.map-%{kversion} ]; then
819 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
821 depmod -ae %{kversion} || exit 0
828 rm -rf $RPM_BUILD_ROOT