3 # Declare rpmbuild --with/--without parameters
7 %bcond_without lustre_tests
8 %bcond_without lustre_iokit
10 %if %{without servers}
11 # --without servers overrides --with {ldiskfs|zfs}
12 # so undefine the internal variables set by bcond_*
13 %undefine with_ldiskfs
17 %{!?version: %global version @VERSION@}
18 %{!?kver: %global kver ""}
19 %{!?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)}
21 %{!?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)}
23 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
24 %{!?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)}
26 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
28 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
30 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
32 # always append the buildid, even when the caller defines %release
33 %define fullrelease %{myrelease}%{buildid}
35 # in order to get kernel symset and/or kernel module dependencies into
36 # the RPM, in order to support weak-modules, the internal dependency gen-
37 # erator needs to be disabled
38 # this is done with (reduce the double % down to a single %):
40 # %%global _use_internal_dependency_generator 0
42 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
43 # defining it here (until Suse changes their mind)
45 # on RHEL5, however, we do need to explicitly disable the internal dep-
46 # endency generator and allow the external one be used
47 # but since RedHat's kABI is only a subset of the total kernel ABI, it
48 # doesn't include all of the symbols we (or OFED for that matter) need
49 # until RedHat includes all of the symbols we need in their symsets we
50 # cannot support weak-modules
51 # we did e-mail the maintainer of all of this stuff @redhat but got no
53 #%%global _use_internal_dependency_generator 0
55 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
57 %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$//'")
59 # Set the package name prefix
60 %if %{undefined lustre_name}
62 %global lustre_name lustre
64 %global lustre_name lustre-client
68 %if %{defined cross_path} && %{defined post_script}
69 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
72 Summary: Lustre File System
75 Release: %{fullrelease}
77 Group: Utilities/System
78 Source: lustre-%{version}.tar.gz
79 URL: http://wiki.whamcloud.com/
80 BuildRoot: %{_tmppath}/lustre-%{version}-root
81 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
82 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
83 Requires: %{name}-modules = %{version}
87 %if %{defined cross_requires}
88 Requires: %{cross_requires}
91 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
92 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
93 #suse don't support selinux
94 BuildRequires: libselinux-devel
100 Userspace tools and files for the Lustre file system.
103 Summary: Kernel Lustre modules for Linux %{kversion}
104 %if %{defined cross_requires}
105 Requires: %{cross_requires}
108 # for SLES11, we need nothing here
109 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
110 # for RHEL we need to require the specific kernel still since weak-modules
111 # support on RH is, well, weak, to be punny about it
112 Requires: kernel = %{krequires}
115 Group: Development/Kernel
118 Lustre file system, server and network drivers for Linux %{kversion}.
122 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
123 Requires: lustre-modules = %{version}
124 Requires: modutils >= 2.4.10
125 Requires: ldiskfsprogs >= 1.42.7.wc1
127 Obsoletes: lustre-ldiskfs
128 Group: Development/Kernel
130 %description osd-ldiskfs
131 The Lustre Object Storage Device (OSD) API is the interface to access and
132 modify data that is supposed to be stored persistently. This API is the interface
133 to code that bridges individual file systems. This specific package provides an
134 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
135 backing store of a Lustre server.
140 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
141 Requires: lustre-modules = %{version}, zfs-kmod
143 Group: Development/Kernel
146 The Lustre Object Storage Device (OSD) API is the interface to access and
147 modify data that is supposed to be stored persistently. This API is the interface
148 to code that bridges individual file systems. This specific package provides an
149 implementation of the OSD API for using the ZFS filesystem as the underlying
150 backing store of a Lustre server.
154 Summary: Object-Based Disk storage driver source
155 Group: Development/Kernel
158 Lustre sources for further development
160 # Since the RPMs we ship are to be used on both SLES and RHEL, we
161 # can't include any dependency information (since the package names
162 # are different on the two platforms).
164 # Instead, we can build these empty meta-packages that only include
165 # dependency information. These let people get the correct
166 # dependencies for their platform and lets them use tools like yum and
167 # red carpet to install the correct files.
169 # Unfortunately I have not seen this come up on the lists much, so I
170 # have disabled them (by commenting out their empty files section
171 # below) until it's clear that they resolve more confusion than they
175 Summary: Lustre dependencies meta-package for SLES
176 Group: Utilities/System
177 Provides: lustre-deps = %{version}
178 Requires: %{name} = %{version}, sles-release
179 Conflicts: %{name}-deps-rhel
181 %description deps-sles
182 This package has RPM dependencies appropriate for SLES systems.
185 Summary: Lustre dependencies meta-package for RHEL
186 Group: Utilities/System
187 Provides: lustre-deps = %{version}
188 Requires: %{name} = %{version}, redhat-release
189 Conflicts: %{name}-deps-sles
191 %description deps-rhel
192 This package has RPM dependencies appropriate for RHEL, RHL, and FC
196 Summary: Lustre testing framework
197 Group: Development/Kernel
198 Provides: %{name}-tests = %{version}
199 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
202 This package contains a set of test binaries and scripts that are intended
203 to be used by the Lustre testing framework.
205 %if %{with lustre_iokit}
206 %package -n lustre-iokit
207 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
208 Group: Applications/System
209 Requires: python > 2.2, sg3_utils
211 %description -n lustre-iokit
212 This package includes five tools:
214 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
217 This survey can be run in 3 modes to test disk I/O including the filesystem,
218 network I/O, and disk I/O via the network. The script does sequential I/O
219 with varying numbers of threads and objects (files) by using lctl::test_brw
220 to drive the echo_client connected to local or remote obdfilter instances,
221 or remote obdecho instances.
224 This survey tests the client-to-disk performance of individual OSTs, and
225 ranks then for comparison.
228 This script will collect IO stats on a defined set of nodes.
231 A script to run the IOR benchmark. The latest version can be downloaded from
232 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
235 This survey tests the local metadata performance using the echo_client to drive
236 the MDD layer to perform operations. It is run with multiple threads (to
237 simulate MDT service threads) locally on the MDS node, and does not need Lustre
238 clients in order to run
241 %if 0%{?suse_version}
245 %setup -qn lustre-%{version}
246 ln lustre/ChangeLog ChangeLog-lustre
247 ln lnet/ChangeLog ChangeLog-lnet
250 # if RPM_BUILD_NCPUS unset, set it
251 if [ -z "$RPM_BUILD_NCPUS" ] ; then
252 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
253 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
256 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
261 rm -rf $RPM_BUILD_ROOT
263 # Set an explicit path to our Linux tree, if we can.
264 cd $RPM_BUILD_DIR/lustre-%{version}
265 # override %optflags so that the vendor's overzealous flags don't create
267 %define optflags -g -O2 -Werror
268 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
269 %if %{with lustre_tests}
270 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
272 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
274 %if %{without lustre_iokit}
275 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
278 # if %%kdir was given, make sure it's not in the configure arguments
279 if [ -n "%kdir" ]; then
280 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
282 # ditto for %%kobjdir
283 if [ -n "%kobjdir" ]; then
284 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
287 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
288 # string in it which we don't want word splitted by the shell
289 # also remove (build|host|target) options because they will be specified
290 # inside $CONFIGURE_ARGS
291 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
294 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
296 make -j $RPM_BUILD_NCPUS -s %{?make_args}
299 make install DESTDIR=$RPM_BUILD_ROOT
300 # hack to avoid changing the libsysio code for "make install"
301 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
303 # The .ha_v2 extension identifies the heartbeat resource agent as using
304 # legacy syntax. Install a compatibility symlink to avoid conflicts when
305 # newer-style agents are added.
306 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
308 # Create the pristine source directory.
309 cd $RPM_BUILD_DIR/lustre-%{version}
310 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
312 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
313 make distdir distdir=lustre-source/lustre-%{version}
314 chmod -R go-w lustre-source/lustre-%{version}
315 # fc18 needs 'x' permission for library files
316 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
318 cat >lustre.files <<EOF
319 %attr(-, root, root) %{?rootdir}/sbin/mount.lustre
320 %attr(-, root, root) %{_sbindir}/*
321 %attr(-, root, root) %{_bindir}/lfs
322 %attr(-, root, root) %{_bindir}/lfs_migrate
323 %attr(-, root, root) %{_bindir}/llbackup
324 %attr(-, root, root) %{_bindir}/llobdstat
325 %attr(-, root, root) %{_bindir}/llstat
326 %attr(-, root, root) %{_bindir}/lustre_req_history
327 %attr(-, root, root) %{_bindir}/plot-llstat
328 %attr(-, root, root) %{_bindir}/req_layout
329 %attr(-, root, root) %{_libdir}/libptlctl.a
330 %attr(-, root, root) %{_libdir}/liblustreapi.a
331 %attr(-, root, root) %{_libdir}/liblustreapi.so
332 %attr(-, root, root) %{_mandir}/man?/*
333 %attr(-, root, root) %{_datadir}/lustre
334 %attr(-, root, root) %{_includedir}/lustre
335 %attr(-, root, root) %{_includedir}/libcfs
336 %attr(-, root, root) %{_libexecdir}/lustre/lc_common
337 %attr(-, root, root) %{_sysconfdir}/udev/rules.d/99-lustre.rules
338 %attr(-, root, root) %{_sysconfdir}/init.d/lnet
339 %attr(-, root, root) %{_sysconfdir}/init.d/lustre
340 %attr(-, root, root) %config(noreplace) %{_sysconfdir}/ldev.conf
341 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
342 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
343 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
344 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
347 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
348 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
351 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
352 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
353 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
356 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
357 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
360 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
361 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
362 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
365 # Have universal lustre headers
366 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
367 echo '%attr(-, root, root) %{_includedir}/linux/lustre_user.h' >>lustre.files
369 echo '%attr(-, root, root) %{_includedir}/linux/lustre_idl.h' >>lustre.files
372 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
373 echo '%attr(-, root, root) %{_includedir}/linux/lustre_types.h' >>lustre.files
376 %if %{with lustre_tests}
377 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
378 echo '%attr(-, root, root) %{_bindir}/mcreate' >>lustre-tests.files
379 echo '%attr(-, root, root) %{_bindir}/munlink' >>lustre-tests.files
380 echo '%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
381 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
382 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
386 %if %{defined cross_path}
387 %if %{defined rpm_post_base}
388 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
389 if [ -f $POST_SCRIPT ]; then
390 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
391 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
392 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
394 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
397 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
399 %if %{with lustre_tests}
400 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
401 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
406 # mark modules executable for find-debuginfo.sh
407 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -type f | \
408 xargs --no-run-if-empty chmod u+x
411 %files -f lustre.files
414 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/*
415 %if %{with lustre_tests}
416 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.ko
419 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
420 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
423 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
425 %if %{defined rpm_post_base}
426 %attr(0555, root, root) %{rpm_post_base}-modules.sh
428 %attr(-, root, root) %doc COPYING
429 %attr(-, root, root) %doc ChangeLog-lustre
430 %attr(-, root, root) %doc ChangeLog-lnet
434 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/ldiskfs.ko
435 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
436 %if %{defined rpm_post_base}
437 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
443 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
444 %if %{defined rpm_post_base}
445 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
450 %attr(-, root, root) %{_prefix}/src/lustre-%{version}
452 # uncomment these lines to enable deps packages
456 %if %{with lustre_tests}
457 %files tests -f lustre-tests.files
460 %if %{with lustre_iokit}
461 %files -n lustre-iokit
462 %attr(-, root, root) %{_bindir}/ior-survey
463 %attr(-, root, root) %{_bindir}/parse-ior
464 %attr(-, root, root) %{_bindir}/libecho
465 %attr(-, root, root) %{_bindir}/obdfilter-survey
466 %attr(-, root, root) %{_bindir}/plot-obdfilter
467 %attr(-, root, root) %{_bindir}/plot-ost
468 %attr(-, root, root) %{_bindir}/ost-survey
469 %attr(-, root, root) %{_bindir}/sgpdd-survey
470 %attr(-, root, root) %{_bindir}/plot-sgpdd
471 %attr(-, root, root) %{_bindir}/lstats.sh
472 %attr(-, root, root) %{_bindir}/gather_stats_everywhere.sh
473 %attr(-, root, root) %{_bindir}/config.sh
474 %attr(-, root, root) %{_bindir}/mds-survey
475 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
476 %doc lustre-iokit/ior-survey/README.ior-survey
477 %doc lustre-iokit/ost-survey/README.ost-survey
478 %doc lustre-iokit/mds-survey/README.mds-survey
479 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
480 %doc lustre-iokit/stats-collect/README.lstats.sh
483 %if %{defined rpm_post_base}
485 if [ -x %{rpm_post_base}.sh ]; then
486 %{rpm_post_base}.sh %{cross_path} create
490 if [ -x %{rpm_post_base}.sh ]; then
491 %{rpm_post_base}.sh %{cross_path} remove
496 %if %{defined rpm_post_base}
497 if [ -x %{rpm_post_base}-modules.sh ]; then
498 %{rpm_post_base}-modules.sh %{cross_path} create
501 if [ -f /boot/System.map-%{kversion} ]; then
502 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
504 depmod -ae %{kversion} || exit 0
507 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
508 # "weak modules" support
510 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
511 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
512 /usr/lib/module-init-tools/weak-modules --add-modules
515 if [ -x /sbin/weak-modules ]; then
516 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
517 /sbin/weak-modules --add-modules
520 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
521 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
522 # print a warning so that users are aware of this issue.
523 if sysctl kernel.unsupported >/dev/null 2>&1 &&
524 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
525 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
527 warning: the Lustre modules are not supported by Novell. To use Lustre
528 on this system, you should put
530 allow_unsupported_modules 1
532 into /etc/modprobe.d/unsupported_modules"
538 %if %{defined rpm_post_base}
539 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
540 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
543 if [ -f /boot/System.map-%{kversion} ]; then
544 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
546 depmod -ae %{kversion} || exit 0
549 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
550 # "weak modules" support
552 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
553 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
554 /usr/lib/module-init-tools/weak-modules --add-modules
557 if [ -x /sbin/weak-modules ]; then
558 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
559 /sbin/weak-modules --add-modules
562 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
563 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
564 # print a warning so that users are aware of this issue.
565 if sysctl kernel.unsupported >/dev/null 2>&1 &&
566 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
567 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
569 warning: the Lustre modules are not supported by Novell. To use Lustre
570 on this system, you should put
572 allow_unsupported_modules 1
574 into /etc/modprobe.d/unsupported_modules"
581 %if %{defined rpm_post_base}
582 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
583 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
586 if [ -f /boot/System.map-%{kversion} ]; then
587 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
589 depmod -ae %{kversion} || exit 0
592 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
593 # "weak modules" support
595 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
596 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
597 /usr/lib/module-init-tools/weak-modules --add-modules
600 if [ -x /sbin/weak-modules ]; then
601 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
602 /sbin/weak-modules --add-modules
605 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
606 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
607 # print a warning so that users are aware of this issue.
608 if sysctl kernel.unsupported >/dev/null 2>&1 &&
609 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
610 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
612 warning: the Lustre modules are not supported by Novell. To use Lustre
613 on this system, you should put
615 allow_unsupported_modules 1
617 into /etc/modprobe.d/unsupported_modules"
623 %if %{defined rpm_post_base}
624 if [ -x %{rpm_post_base}-modules.sh ]; then
625 %{rpm_post_base}-modules.sh %{cross_path} remove
628 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
629 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
634 %if %{defined rpm_post_base}
635 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
636 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
639 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
640 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
646 %if %{defined rpm_post_base}
647 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
648 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
651 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
652 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
656 %if %{undefined cross_path}
658 if [ -f /boot/System.map-%{kversion} ]; then
659 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
661 depmod -ae %{kversion} || exit 0
664 # "weak modules" support
666 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
667 cat /var/run/%{name}-modules |
668 /usr/lib/module-init-tools/weak-modules --remove-modules
671 if [ -x /sbin/weak-modules ]; then
672 cat /var/run/%{name}-modules |
673 /sbin/weak-modules --remove-modules
675 rm /var/run/%{name}-modules
679 if [ -f /boot/System.map-%{kversion} ]; then
680 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
682 depmod -ae %{kversion} || exit 0
685 # "weak modules" support
687 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
688 cat /var/run/%{name}-osd-ldiskfs |
689 /usr/lib/module-init-tools/weak-modules --remove-modules
692 if [ -x /sbin/weak-modules ]; then
693 cat /var/run/%{name}-osd-ldiskfs |
694 /sbin/weak-modules --remove-modules
696 rm /var/run/%{name}-osd-ldiskfs
701 if [ -f /boot/System.map-%{kversion} ]; then
702 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
704 depmod -ae %{kversion} || exit 0
707 # "weak modules" support
709 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
710 cat /var/run/%{name}-osd-zfs |
711 /usr/lib/module-init-tools/weak-modules --remove-modules
714 if [ -x /sbin/weak-modules ]; then
715 cat /var/run/%{name}-osd-zfs |
716 /sbin/weak-modules --remove-modules
718 rm /var/run/%{name}-osd-zfs
722 %if %{with lustre_tests}
724 %if %{defined rpm_post_base}
725 if [ -x %{rpm_post_base}-tests.sh ]; then
726 %{rpm_post_base}-tests.sh %{cross_path} create
730 if [ -x %{rpm_post_base}-tests.sh ]; then
731 %{rpm_post_base}-tests.sh %{cross_path} remove
734 if [ -f /boot/System.map-%{kversion} ]; then
735 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
737 depmod -ae %{kversion} || exit 0
741 if [ -f /boot/System.map-%{kversion} ]; then
742 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
744 depmod -ae %{kversion} || exit 0
750 rm -rf $RPM_BUILD_ROOT