3 # Declare rpmbuild --with/--without parameters
7 %bcond_without lustre_tests
8 %bcond_without lustre_iokit
9 %bcond_without lustre_modules
11 %if %{without servers}
12 # --without servers overrides --with {ldiskfs|zfs}
13 # so undefine the internal variables set by bcond_*
14 %undefine with_ldiskfs
18 %{!?version: %global version @VERSION@}
19 %{!?kver: %global kver ""}
20 %{!?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)}
22 %{!?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)}
24 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
25 %{!?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)}
27 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
29 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
31 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
33 # always append the buildid, even when the caller defines %release
34 %define fullrelease %{myrelease}%{buildid}
36 # in order to get kernel symset and/or kernel module dependencies into
37 # the RPM, in order to support weak-modules, the internal dependency gen-
38 # erator needs to be disabled
39 # this is done with (reduce the double % down to a single %):
41 # %%global _use_internal_dependency_generator 0
43 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
44 # defining it here (until Suse changes their mind)
46 # on RHEL5, however, we do need to explicitly disable the internal dep-
47 # endency generator and allow the external one be used
48 # but since RedHat's kABI is only a subset of the total kernel ABI, it
49 # doesn't include all of the symbols we (or OFED for that matter) need
50 # until RedHat includes all of the symbols we need in their symsets we
51 # cannot support weak-modules
52 # we did e-mail the maintainer of all of this stuff @redhat but got no
54 #%%global _use_internal_dependency_generator 0
56 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
58 %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$//'")
60 # Set the package name prefix
61 %if %{undefined lustre_name}
63 %global lustre_name lustre
65 %global lustre_name lustre-client
69 %if %{undefined kmoddir}
70 %if %{defined kernel_module_package_moddir}
71 %global kmoddir %{kernel_module_package_moddir}
73 %if %{defined suse_kernel_module_package}
74 %global kmoddir updates
81 %if %{defined cross_path} && %{defined post_script}
82 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
85 # SUSE don't support .debug_info section from cross compiler:
86 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
87 %if %{defined cross_path} && 0%{?suse_version}
88 %global __debug_install_post %{nil}
89 %global __debug_package %{nil}
90 %global debug_package %{nil}
93 Summary: Lustre File System
96 Release: %{fullrelease}
98 Group: Utilities/System
99 Source: lustre-%{version}.tar.gz
100 URL: https://wiki.hpdd.intel.com/
101 BuildRoot: %{_tmppath}/lustre-%{version}-root
102 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
103 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
104 Requires: %{name}-modules = %{version}
105 BuildRequires: libtool
109 %if %{defined cross_requires}
110 Requires: %{cross_requires}
113 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
114 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
115 #suse don't support selinux
116 BuildRequires: libselinux-devel
122 Userspace tools and files for the Lustre file system.
124 %if %{with lustre_modules}
126 Summary: Kernel Lustre modules for Linux %{kversion}
127 %if %{defined cross_requires}
128 Requires: %{cross_requires}
131 # for SLES11, we need nothing here
132 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
133 # for RHEL we need to require the specific kernel still since weak-modules
134 # support on RH is, well, weak, to be punny about it
135 Requires: kernel = %{krequires}
138 Group: Development/Kernel
141 Lustre file system, server and network drivers for Linux %{kversion}.
145 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
146 Requires: lustre-modules = %{version}
147 Requires: module-init-tools >= 3.9
148 Requires: ldiskfsprogs >= 1.42.7.wc1
150 Obsoletes: lustre-ldiskfs
151 Group: Development/Kernel
153 %description osd-ldiskfs
154 The Lustre Object Storage Device (OSD) API is the interface to access and
155 modify data that is supposed to be stored persistently. This API is the interface
156 to code that bridges individual file systems. This specific package provides an
157 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
158 backing store of a Lustre server.
163 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
164 Requires: lustre-modules = %{version}, zfs-kmod
166 Group: Development/Kernel
169 The Lustre Object Storage Device (OSD) API is the interface to access and
170 modify data that is supposed to be stored persistently. This API is the interface
171 to code that bridges individual file systems. This specific package provides an
172 implementation of the OSD API for using the ZFS filesystem as the underlying
173 backing store of a Lustre server.
175 %endif # with lustre_modules
178 Summary: Object-Based Disk storage driver source
179 Group: Development/Kernel
182 Lustre sources for further development
184 # Since the RPMs we ship are to be used on both SLES and RHEL, we
185 # can't include any dependency information (since the package names
186 # are different on the two platforms).
188 # Instead, we can build these empty meta-packages that only include
189 # dependency information. These let people get the correct
190 # dependencies for their platform and lets them use tools like yum and
191 # red carpet to install the correct files.
193 # Unfortunately I have not seen this come up on the lists much, so I
194 # have disabled them (by commenting out their empty files section
195 # below) until it's clear that they resolve more confusion than they
199 Summary: Lustre dependencies meta-package for SLES
200 Group: Utilities/System
201 Provides: lustre-deps = %{version}
202 Requires: %{name} = %{version}, sles-release
203 Conflicts: %{name}-deps-rhel
205 %description deps-sles
206 This package has RPM dependencies appropriate for SLES systems.
209 Summary: Lustre dependencies meta-package for RHEL
210 Group: Utilities/System
211 Provides: lustre-deps = %{version}
212 Requires: %{name} = %{version}, redhat-release
213 Conflicts: %{name}-deps-sles
215 %description deps-rhel
216 This package has RPM dependencies appropriate for RHEL, RHL, and FC
220 Summary: Lustre testing framework
221 Group: Development/Kernel
222 Provides: %{name}-tests = %{version}
223 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
224 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
227 This package contains a set of test binaries and scripts that are intended
228 to be used by the Lustre testing framework.
230 %if %{with lustre_iokit}
231 %package -n lustre-iokit
232 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
233 Group: Applications/System
234 Requires: python > 2.2, sg3_utils
236 %description -n lustre-iokit
237 This package includes five tools:
239 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
242 This survey can be run in 3 modes to test disk I/O including the filesystem,
243 network I/O, and disk I/O via the network. The script does sequential I/O
244 with varying numbers of threads and objects (files) by using lctl::test_brw
245 to drive the echo_client connected to local or remote obdfilter instances,
246 or remote obdecho instances.
249 This survey tests the client-to-disk performance of individual OSTs, and
250 ranks then for comparison.
253 This script will collect IO stats on a defined set of nodes.
256 A script to run the IOR benchmark. The latest version can be downloaded from
257 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
260 This survey tests the local metadata performance using the echo_client to drive
261 the MDD layer to perform operations. It is run with multiple threads (to
262 simulate MDT service threads) locally on the MDS node, and does not need Lustre
263 clients in order to run
266 %if 0%{?suse_version}
270 %setup -qn lustre-%{version}
271 ln lustre/ChangeLog ChangeLog-lustre
272 ln lnet/ChangeLog ChangeLog-lnet
276 # Set an explicit path to our Linux tree, if we can.
277 cd $RPM_BUILD_DIR/lustre-%{version}
278 # override %optflags so that the vendor's overzealous flags don't create
280 %define optflags -g -O2 -Werror
281 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
282 %if %{with lustre_tests}
283 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests"
285 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests"
287 %if %{without lustre_iokit}
288 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
291 %if %{with lustre_modules}
292 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
294 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
298 CONFIGURE_ARGS="$CONFIGURE_ARGS --without-zfs"
301 # if %%kdir was given, make sure it's not in the configure arguments
302 if [ -n "%kdir" ]; then
303 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
305 # ditto for %%kobjdir
306 if [ -n "%kobjdir" ]; then
307 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
309 # remove --with-kmp-moddir from configure arguments,
310 # it will be set --with-kmp-moddir=%%kmoddir
311 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
313 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
314 # string in it which we don't want word splitted by the shell
315 # also remove (build|host|target) options because they will be specified
316 # inside $CONFIGURE_ARGS
317 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
320 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
321 $CONFIGURE_ARGS --with-kmp-moddir=%{kmoddir}
322 make %{?_smp_mflags} -s %{?make_args}
325 make install DESTDIR=$RPM_BUILD_ROOT
330 # The .ha_v2 extension identifies the heartbeat resource agent as using
331 # legacy syntax. Install a compatibility symlink to avoid conflicts when
332 # newer-style agents are added.
333 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
334 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
335 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
337 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then
338 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
339 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
343 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then
344 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
347 # Create the pristine source directory.
348 cd $RPM_BUILD_DIR/lustre-%{version}
349 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
351 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
352 make distdir distdir=lustre-source/lustre-%{version}
353 chmod -R go-w lustre-source/lustre-%{version}
354 # fc18 needs 'x' permission for library files
355 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
357 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
358 echo '%{_libdir}/libiam.a' >>lustre.files
361 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
362 echo '%{_libdir}/lustre/snmp' >>lustre.files
363 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
366 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@/ -name \*.la -delete
368 %if %{with lustre_tests}
369 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
370 echo '%{_bindir}/mcreate' >>lustre-tests.files
371 echo '%{_bindir}/munlink' >>lustre-tests.files
372 %if %{with lustre_modules}
373 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
377 %if %{defined cross_path}
378 %if %{defined rpm_post_base}
379 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
380 if [ -f $POST_SCRIPT ]; then
381 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
382 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
383 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
385 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
388 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
390 %if %{with lustre_tests}
391 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
392 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
397 # mark modules executable for find-debuginfo.sh
398 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} -name "*.ko" -type f | \
399 xargs --no-run-if-empty chmod u+x
402 %files -f lustre.files
403 %defattr(-,root,root)
404 %{?rootdir}/sbin/mount.lustre
407 %{_bindir}/lfs_migrate
411 %{_bindir}/lustre_req_history
412 %{_bindir}/plot-llstat
413 %{_bindir}/req_layout
414 %{_libdir}/libptlctl.a
415 %{_libdir}/libcfsutil.a
416 %{_libdir}/liblustreapi.a
417 %{_libdir}/liblustreapi.so
420 %{_includedir}/lustre
421 %{_includedir}/libcfs
422 %{_includedir}/linux/lustre_user.h
423 %{_libexecdir}/lustre/lc_common
424 %{_libexecdir}/lustre/haconfig
425 %{_sysconfdir}/udev/rules.d/99-lustre.rules
426 %config(noreplace) %{_sysconfdir}/ldev.conf
428 %if %{with lustre_modules}
430 %defattr(-,root,root)
431 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
432 %if %{with lustre_tests}
433 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
436 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
437 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
440 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
442 %if %{defined rpm_post_base}
443 %attr(0555, root, root) %{rpm_post_base}-modules.sh
446 %doc ChangeLog-lustre
451 %defattr(-,root,root)
452 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
453 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
454 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
455 %if %{defined rpm_post_base}
456 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
462 %defattr(-,root,root)
463 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
464 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
465 %if %{defined rpm_post_base}
466 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
469 %endif # with lustre_modules
472 %defattr(-,root,root)
473 %{_prefix}/src/lustre-%{version}
475 # uncomment these lines to enable deps packages
479 %if %{with lustre_tests}
480 %files tests -f lustre-tests.files
481 %defattr(-,root,root)
484 %if %{with lustre_iokit}
485 %files -n lustre-iokit
486 %defattr(-, root, root)
487 %{_bindir}/iokit-config
488 %{_bindir}/iokit-gather-stats
489 %{_bindir}/iokit-libecho
490 %{_bindir}/iokit-lstats
491 %{_bindir}/iokit-parse-ior
492 %{_bindir}/iokit-plot-obdfilter
493 %{_bindir}/iokit-plot-ost
494 %{_bindir}/iokit-plot-sgpdd
495 %{_bindir}/ior-survey
496 %{_bindir}/mds-survey
497 %{_bindir}/obdfilter-survey
498 %{_bindir}/ost-survey
499 %{_bindir}/sgpdd-survey
500 %doc lustre-iokit/ior-survey/README.ior-survey
501 %doc lustre-iokit/mds-survey/README.mds-survey
502 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
503 %doc lustre-iokit/ost-survey/README.ost-survey
504 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
505 %doc lustre-iokit/stats-collect/README.iokit-lstats
508 %if %{defined rpm_post_base}
510 if [ -x %{rpm_post_base}.sh ]; then
511 %{rpm_post_base}.sh %{cross_path} create
515 if [ -x %{rpm_post_base}.sh ]; then
516 %{rpm_post_base}.sh %{cross_path} remove
520 %if %{with lustre_modules}
522 %if %{defined rpm_post_base}
523 if [ -x %{rpm_post_base}-modules.sh ]; then
524 %{rpm_post_base}-modules.sh %{cross_path} create
527 if [ -f /boot/System.map-%{kversion} ]; then
528 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
530 depmod -ae %{kversion} || exit 0
533 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
534 # "weak modules" support
536 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
537 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
538 /usr/lib/module-init-tools/weak-modules --add-modules
541 if [ -x /sbin/weak-modules ]; then
542 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
543 /sbin/weak-modules --add-modules
546 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
547 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
548 # print a warning so that users are aware of this issue.
549 if sysctl kernel.unsupported >/dev/null 2>&1 &&
550 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
551 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
553 warning: the Lustre modules are not supported by Novell. To use Lustre
554 on this system, you should put
556 allow_unsupported_modules 1
558 into /etc/modprobe.d/unsupported_modules"
564 %if %{defined rpm_post_base}
565 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
566 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
569 if [ -f /boot/System.map-%{kversion} ]; then
570 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
572 depmod -ae %{kversion} || exit 0
575 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
576 # "weak modules" support
578 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
579 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
580 /usr/lib/module-init-tools/weak-modules --add-modules
583 if [ -x /sbin/weak-modules ]; then
584 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
585 /sbin/weak-modules --add-modules
588 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
589 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
590 # print a warning so that users are aware of this issue.
591 if sysctl kernel.unsupported >/dev/null 2>&1 &&
592 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
593 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
595 warning: the Lustre modules are not supported by Novell. To use Lustre
596 on this system, you should put
598 allow_unsupported_modules 1
600 into /etc/modprobe.d/unsupported_modules"
607 %if %{defined rpm_post_base}
608 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
609 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
612 if [ -f /boot/System.map-%{kversion} ]; then
613 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
615 depmod -ae %{kversion} || exit 0
618 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
619 # "weak modules" support
621 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
622 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
623 /usr/lib/module-init-tools/weak-modules --add-modules
626 if [ -x /sbin/weak-modules ]; then
627 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
628 /sbin/weak-modules --add-modules
631 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
632 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
633 # print a warning so that users are aware of this issue.
634 if sysctl kernel.unsupported >/dev/null 2>&1 &&
635 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
636 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
638 warning: the Lustre modules are not supported by Novell. To use Lustre
639 on this system, you should put
641 allow_unsupported_modules 1
643 into /etc/modprobe.d/unsupported_modules"
649 %if %{defined rpm_post_base}
650 if [ -x %{rpm_post_base}-modules.sh ]; then
651 %{rpm_post_base}-modules.sh %{cross_path} remove
654 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
655 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
660 %if %{defined rpm_post_base}
661 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
662 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
665 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
666 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
672 %if %{defined rpm_post_base}
673 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
674 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
677 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
678 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
682 %if %{undefined cross_path}
684 if [ -f /boot/System.map-%{kversion} ]; then
685 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
687 depmod -ae %{kversion} || exit 0
690 # "weak modules" support
692 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
693 cat /var/run/%{name}-modules |
694 /usr/lib/module-init-tools/weak-modules --remove-modules
697 if [ -x /sbin/weak-modules ]; then
698 cat /var/run/%{name}-modules |
699 /sbin/weak-modules --remove-modules
701 rm /var/run/%{name}-modules
705 if [ -f /boot/System.map-%{kversion} ]; then
706 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
708 depmod -ae %{kversion} || exit 0
711 # "weak modules" support
713 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
714 cat /var/run/%{name}-osd-ldiskfs |
715 /usr/lib/module-init-tools/weak-modules --remove-modules
718 if [ -x /sbin/weak-modules ]; then
719 cat /var/run/%{name}-osd-ldiskfs |
720 /sbin/weak-modules --remove-modules
722 rm /var/run/%{name}-osd-ldiskfs
727 if [ -f /boot/System.map-%{kversion} ]; then
728 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
730 depmod -ae %{kversion} || exit 0
733 # "weak modules" support
735 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
736 cat /var/run/%{name}-osd-zfs |
737 /usr/lib/module-init-tools/weak-modules --remove-modules
740 if [ -x /sbin/weak-modules ]; then
741 cat /var/run/%{name}-osd-zfs |
742 /sbin/weak-modules --remove-modules
744 rm /var/run/%{name}-osd-zfs
747 %endif # with lustre_modules
749 %if %{with lustre_tests}
750 %if %{defined rpm_post_base}
752 if [ -x %{rpm_post_base}-tests.sh ]; then
753 %{rpm_post_base}-tests.sh %{cross_path} create
757 if [ -x %{rpm_post_base}-tests.sh ]; then
758 %{rpm_post_base}-tests.sh %{cross_path} remove
761 %if %{with lustre_modules}
763 if [ -f /boot/System.map-%{kversion} ]; then
764 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
766 depmod -ae %{kversion} || exit 0
770 if [ -f /boot/System.map-%{kversion} ]; then
771 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
773 depmod -ae %{kversion} || exit 0
780 rm -rf $RPM_BUILD_ROOT