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
110 Requires: lustre-osd-mount
112 %if %{defined cross_requires}
113 Requires: %{cross_requires}
116 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
117 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
118 #suse don't support selinux
119 BuildRequires: libselinux-devel
125 Userspace tools and files for the Lustre file system.
127 %if %{with lustre_modules}
129 Summary: Kernel Lustre modules for Linux %{kversion}
130 %if %{defined cross_requires}
131 Requires: %{cross_requires}
134 # for SLES11, we need nothing here
135 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
136 # for RHEL we need to require the specific kernel still since weak-modules
137 # support on RH is, well, weak, to be punny about it
138 Requires: kernel = %{krequires}
141 BuildRequires: libyaml-devel
145 Group: Development/Kernel
148 Lustre file system, server and network drivers for Linux %{kversion}.
152 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
153 Requires: lustre-modules = %{version}
154 Requires: module-init-tools >= 3.9
155 Requires: ldiskfsprogs >= 1.42.7.wc1
156 Requires: lustre-osd-ldiskfs-mount
158 Obsoletes: lustre-ldiskfs
159 Group: Development/Kernel
161 %description osd-ldiskfs
162 The Lustre Object Storage Device (OSD) API is the interface to access and
163 modify data that is supposed to be stored persistently. This API is the interface
164 to code that bridges individual file systems. This specific package provides an
165 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
166 backing store of a Lustre server.
168 %if %{with lustre_utils}
169 %package osd-ldiskfs-mount
170 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
171 Provides: lustre-osd-mount
172 Group: Development/Kernel
174 %description osd-ldiskfs-mount
175 LDISKFS hooks for mount/mkfs into a dynamic library.
182 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
183 Requires: lustre-modules = %{version}, zfs-kmod
184 Requires: lustre-osd-zfs-mount
186 Group: Development/Kernel
189 The Lustre Object Storage Device (OSD) API is the interface to access and
190 modify data that is supposed to be stored persistently. This API is the interface
191 to code that bridges individual file systems. This specific package provides an
192 implementation of the OSD API for using the ZFS filesystem as the underlying
193 backing store of a Lustre server.
195 %if %{with lustre_utils}
196 %package osd-zfs-mount
197 Summary: osd-zfs-mount contains mount's ldiskfs specific dso.
198 Provides: lustre-osd-mount
199 Group: Development/Kernel
201 %description osd-zfs-mount
202 ZFS hooks for mount/mkfs into a dynamic library.
206 %endif # with lustre_modules
209 Summary: Object-Based Disk storage driver source
210 Group: Development/Kernel
213 Lustre sources for further development
215 # Since the RPMs we ship are to be used on both SLES and RHEL, we
216 # can't include any dependency information (since the package names
217 # are different on the two platforms).
219 # Instead, we can build these empty meta-packages that only include
220 # dependency information. These let people get the correct
221 # dependencies for their platform and lets them use tools like yum and
222 # red carpet to install the correct files.
224 # Unfortunately I have not seen this come up on the lists much, so I
225 # have disabled them (by commenting out their empty files section
226 # below) until it's clear that they resolve more confusion than they
230 Summary: Lustre dependencies meta-package for SLES
231 Group: Utilities/System
232 Provides: lustre-deps = %{version}
233 Requires: %{name} = %{version}, sles-release
234 Conflicts: %{name}-deps-rhel
236 %description deps-sles
237 This package has RPM dependencies appropriate for SLES systems.
240 Summary: Lustre dependencies meta-package for RHEL
241 Group: Utilities/System
242 Provides: lustre-deps = %{version}
243 Requires: %{name} = %{version}, redhat-release
244 Conflicts: %{name}-deps-sles
246 %description deps-rhel
247 This package has RPM dependencies appropriate for RHEL, RHL, and FC
251 Summary: Lustre testing framework
252 Group: Development/Kernel
253 Provides: %{name}-tests = %{version}
254 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
255 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
258 This package contains a set of test binaries and scripts that are intended
259 to be used by the Lustre testing framework.
261 %if %{with lustre_iokit}
262 %package -n lustre-iokit
263 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
264 Group: Applications/System
265 Requires: python > 2.2, sg3_utils
267 %description -n lustre-iokit
268 This package includes five tools:
270 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
273 This survey can be run in 3 modes to test disk I/O including the filesystem,
274 network I/O, and disk I/O via the network. The script does sequential I/O
275 with varying numbers of threads and objects (files) by using lctl::test_brw
276 to drive the echo_client connected to local or remote obdfilter instances,
277 or remote obdecho instances.
280 This survey tests the client-to-disk performance of individual OSTs, and
281 ranks then for comparison.
284 This script will collect IO stats on a defined set of nodes.
287 A script to run the IOR benchmark. The latest version can be downloaded from
288 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
291 This survey tests the local metadata performance using the echo_client to drive
292 the MDD layer to perform operations. It is run with multiple threads (to
293 simulate MDT service threads) locally on the MDS node, and does not need Lustre
294 clients in order to run
297 %if 0%{?suse_version}
301 %setup -qn lustre-%{version}
302 ln lustre/ChangeLog ChangeLog-lustre
303 ln lnet/ChangeLog ChangeLog-lnet
307 # Set an explicit path to our Linux tree, if we can.
308 cd $RPM_BUILD_DIR/lustre-%{version}
309 # override %optflags so that the vendor's overzealous flags don't create
311 %define optflags -g -O2 -Werror
312 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
314 %if %{with lustre_tests}
315 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests"
317 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests"
320 %if %{with lustre_utils}
321 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-utils"
323 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-utils"
326 %if %{without lustre_iokit}
327 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
330 %if %{with lustre_modules}
331 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
333 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
336 %if %{without servers}
337 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-server"
340 %if %{without ldiskfs}
341 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-ldiskfs"
345 CONFIGURE_ARGS="$CONFIGURE_ARGS --without-zfs"
348 # if %%kdir was given, make sure it's not in the configure arguments
349 if [ -n "%kdir" ]; then
350 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
352 # ditto for %%kobjdir
353 if [ -n "%kobjdir" ]; then
354 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
356 # remove --with-kmp-moddir from configure arguments,
357 # it will be set --with-kmp-moddir=%%kmoddir
358 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
360 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
361 # string in it which we don't want word splitted by the shell
362 # also remove (build|host|target) options because they will be specified
363 # inside $CONFIGURE_ARGS
364 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
367 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
368 $CONFIGURE_ARGS --with-kmp-moddir=%{kmoddir}
369 make %{?_smp_mflags} -s %{?make_args}
372 make install DESTDIR=$RPM_BUILD_ROOT
377 # The .ha_v2 extension identifies the heartbeat resource agent as using
378 # legacy syntax. Install a compatibility symlink to avoid conflicts when
379 # newer-style agents are added.
380 %if %{with lustre_utils}
381 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
382 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
383 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
386 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then
387 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
388 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
392 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then
393 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
396 # Create the pristine source directory.
397 cd $RPM_BUILD_DIR/lustre-%{version}
398 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
400 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
401 make distdir distdir=lustre-source/lustre-%{version}
402 chmod -R go-w lustre-source/lustre-%{version}
403 # fc18 needs 'x' permission for library files
404 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
406 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.a ] ; then
407 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
408 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
411 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
412 echo '%{_libdir}/liblustre.a' >>lustre.files
413 echo '%{_libdir}/liblustre.so' >>lustre.files
416 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
417 echo '%{_libdir}/libiam.a' >>lustre.files
420 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
421 echo '%{_libdir}/lustre/snmp' >>lustre.files
422 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
425 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@/ -name \*.la -type f -delete
427 %if %{with lustre_tests}
428 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
429 echo '%{_bindir}/mcreate' >>lustre-tests.files
430 echo '%{_bindir}/munlink' >>lustre-tests.files
431 echo '%{_bindir}/req_layout' >>lustre-tests.files
432 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
433 echo '%{_sbindir}/wiretest' >>lustre-tests.files
434 %if %{with lustre_modules}
435 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
439 %if %{defined cross_path}
440 %if %{defined rpm_post_base}
441 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
442 if [ -f $POST_SCRIPT ]; then
443 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
444 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
445 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
447 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
448 %if %{with lustre_utils}
449 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
453 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
454 %if %{with lustre_utils}
455 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
458 %if %{with lustre_tests}
459 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
460 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
465 %if %{with lustre_modules}
466 # mark modules executable for find-debuginfo.sh
467 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
468 -name \*.ko -type f -exec chmod u+x {} \;
472 %files -f lustre.files
473 %defattr(-,root,root)
475 %if %{with lustre_utils}
477 %{_libexecdir}/lustre/lc_common
478 %{_libexecdir}/lustre/haconfig
479 %{_bindir}/lustre_req_history
484 %{_bindir}/plot-llstat
487 %{_bindir}/lfs_migrate
488 %{?rootdir}/sbin/mount.lustre
489 %{_libdir}/libptlctl.a
490 %{_libdir}/libcfsutil.a
491 %{_libdir}/liblustreapi.a
492 %{_libdir}/liblustreapi.so
494 %{_includedir}/lustre
495 %{_includedir}/libcfs
496 %{_includedir}/linux/lustre_user.h
499 %{_sysconfdir}/udev/rules.d/99-lustre.rules
500 %config(noreplace) %{_sysconfdir}/ldev.conf
502 %if %{with lustre_modules}
504 %defattr(-,root,root)
505 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
506 %if %{with lustre_tests}
507 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
510 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
511 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
514 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
516 %if %{defined rpm_post_base}
517 %attr(0555, root, root) %{rpm_post_base}-modules.sh
520 %doc ChangeLog-lustre
525 %defattr(-,root,root)
526 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
527 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
528 %if %{defined rpm_post_base}
529 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
531 %if %{with lustre_utils}
532 %files osd-ldiskfs-mount
533 %defattr(-,root,root)
534 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
535 %if %{defined rpm_post_base}
536 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
543 %defattr(-,root,root)
544 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
545 %if %{defined rpm_post_base}
546 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
548 %if %{with lustre_utils}
550 %defattr(-,root,root)
551 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
552 %if %{defined rpm_post_base}
553 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
557 %endif # with lustre_modules
560 %defattr(-,root,root)
561 %{_prefix}/src/lustre-%{version}
563 # uncomment these lines to enable deps packages
567 %if %{with lustre_tests}
568 %files tests -f lustre-tests.files
569 %defattr(-,root,root)
572 %if %{with lustre_iokit}
573 %files -n lustre-iokit
574 %defattr(-, root, root)
575 %{_bindir}/iokit-config
576 %{_bindir}/iokit-gather-stats
577 %{_bindir}/iokit-libecho
578 %{_bindir}/iokit-lstats
579 %{_bindir}/iokit-parse-ior
580 %{_bindir}/iokit-plot-obdfilter
581 %{_bindir}/iokit-plot-ost
582 %{_bindir}/iokit-plot-sgpdd
583 %{_bindir}/ior-survey
584 %{_bindir}/mds-survey
585 %{_bindir}/obdfilter-survey
586 %{_bindir}/ost-survey
587 %{_bindir}/sgpdd-survey
588 %doc lustre-iokit/ior-survey/README.ior-survey
589 %doc lustre-iokit/mds-survey/README.mds-survey
590 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
591 %doc lustre-iokit/ost-survey/README.ost-survey
592 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
593 %doc lustre-iokit/stats-collect/README.iokit-lstats
596 %if %{defined rpm_post_base}
598 if [ -x %{rpm_post_base}.sh ]; then
599 %{rpm_post_base}.sh %{cross_path} create
603 if [ -x %{rpm_post_base}.sh ]; then
604 %{rpm_post_base}.sh %{cross_path} remove
608 %if %{with lustre_modules}
610 %if %{defined rpm_post_base}
611 if [ -x %{rpm_post_base}-modules.sh ]; then
612 %{rpm_post_base}-modules.sh %{cross_path} create
615 if [ -f /boot/System.map-%{kversion} ]; then
616 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
618 depmod -ae %{kversion} || exit 0
621 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
622 # "weak modules" support
624 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
625 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
626 /usr/lib/module-init-tools/weak-modules --add-modules
629 if [ -x /sbin/weak-modules ]; then
630 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
631 /sbin/weak-modules --add-modules
634 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
635 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
636 # print a warning so that users are aware of this issue.
637 if sysctl kernel.unsupported >/dev/null 2>&1 &&
638 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
639 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
641 warning: the Lustre modules are not supported by Novell. To use Lustre
642 on this system, you should put
644 allow_unsupported_modules 1
646 into /etc/modprobe.d/unsupported_modules"
652 %if %{defined rpm_post_base}
653 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
654 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
657 if [ -f /boot/System.map-%{kversion} ]; then
658 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
660 depmod -ae %{kversion} || exit 0
663 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
664 # "weak modules" support
666 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
667 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
668 /usr/lib/module-init-tools/weak-modules --add-modules
671 if [ -x /sbin/weak-modules ]; then
672 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
673 /sbin/weak-modules --add-modules
676 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
677 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
678 # print a warning so that users are aware of this issue.
679 if sysctl kernel.unsupported >/dev/null 2>&1 &&
680 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
681 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
683 warning: the Lustre modules are not supported by Novell. To use Lustre
684 on this system, you should put
686 allow_unsupported_modules 1
688 into /etc/modprobe.d/unsupported_modules"
691 %if %{with lustre_utils} && %{defined rpm_post_base}
692 %post osd-ldiskfs-mount
693 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
694 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
701 %if %{defined rpm_post_base}
702 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
703 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
706 if [ -f /boot/System.map-%{kversion} ]; then
707 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
709 depmod -ae %{kversion} || exit 0
712 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
713 # "weak modules" support
715 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
716 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
717 /usr/lib/module-init-tools/weak-modules --add-modules
720 if [ -x /sbin/weak-modules ]; then
721 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
722 /sbin/weak-modules --add-modules
725 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
726 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
727 # print a warning so that users are aware of this issue.
728 if sysctl kernel.unsupported >/dev/null 2>&1 &&
729 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
730 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
732 warning: the Lustre modules are not supported by Novell. To use Lustre
733 on this system, you should put
735 allow_unsupported_modules 1
737 into /etc/modprobe.d/unsupported_modules"
740 %if %{with lustre_utils} && %{defined rpm_post_base}
742 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
743 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
749 %if %{defined rpm_post_base}
750 if [ -x %{rpm_post_base}-modules.sh ]; then
751 %{rpm_post_base}-modules.sh %{cross_path} remove
754 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
755 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
760 %if %{defined rpm_post_base}
761 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
762 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
765 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
766 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
768 %if %{with lustre_utils} && %{defined rpm_post_base}
769 %preun osd-ldiskfs-mount
770 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
771 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
778 %if %{defined rpm_post_base}
779 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
780 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
783 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
784 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
786 %if %{with lustre_utils} && %{defined rpm_post_base}
788 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
789 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
794 %if %{undefined cross_path}
796 if [ -f /boot/System.map-%{kversion} ]; then
797 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
799 depmod -ae %{kversion} || exit 0
802 # "weak modules" support
804 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
805 cat /var/run/%{name}-modules |
806 /usr/lib/module-init-tools/weak-modules --remove-modules
809 if [ -x /sbin/weak-modules ]; then
810 cat /var/run/%{name}-modules |
811 /sbin/weak-modules --remove-modules
813 rm /var/run/%{name}-modules
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
823 # "weak modules" support
825 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
826 cat /var/run/%{name}-osd-ldiskfs |
827 /usr/lib/module-init-tools/weak-modules --remove-modules
830 if [ -x /sbin/weak-modules ]; then
831 cat /var/run/%{name}-osd-ldiskfs |
832 /sbin/weak-modules --remove-modules
834 rm /var/run/%{name}-osd-ldiskfs
839 if [ -f /boot/System.map-%{kversion} ]; then
840 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
842 depmod -ae %{kversion} || exit 0
845 # "weak modules" support
847 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
848 cat /var/run/%{name}-osd-zfs |
849 /usr/lib/module-init-tools/weak-modules --remove-modules
852 if [ -x /sbin/weak-modules ]; then
853 cat /var/run/%{name}-osd-zfs |
854 /sbin/weak-modules --remove-modules
856 rm /var/run/%{name}-osd-zfs
859 %endif # with lustre_modules
861 %if %{with lustre_tests}
862 %if %{defined rpm_post_base}
864 if [ -x %{rpm_post_base}-tests.sh ]; then
865 %{rpm_post_base}-tests.sh %{cross_path} create
869 if [ -x %{rpm_post_base}-tests.sh ]; then
870 %{rpm_post_base}-tests.sh %{cross_path} remove
873 %if %{with lustre_modules}
875 if [ -f /boot/System.map-%{kversion} ]; then
876 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
878 depmod -ae %{kversion} || exit 0
882 if [ -f /boot/System.map-%{kversion} ]; then
883 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
885 depmod -ae %{kversion} || exit 0
892 rm -rf $RPM_BUILD_ROOT