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
226 This package contains a set of test binaries and scripts that are intended
227 to be used by the Lustre testing framework.
229 %if %{with lustre_iokit}
230 %package -n lustre-iokit
231 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
232 Group: Applications/System
233 Requires: python > 2.2, sg3_utils
235 %description -n lustre-iokit
236 This package includes five tools:
238 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
241 This survey can be run in 3 modes to test disk I/O including the filesystem,
242 network I/O, and disk I/O via the network. The script does sequential I/O
243 with varying numbers of threads and objects (files) by using lctl::test_brw
244 to drive the echo_client connected to local or remote obdfilter instances,
245 or remote obdecho instances.
248 This survey tests the client-to-disk performance of individual OSTs, and
249 ranks then for comparison.
252 This script will collect IO stats on a defined set of nodes.
255 A script to run the IOR benchmark. The latest version can be downloaded from
256 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
259 This survey tests the local metadata performance using the echo_client to drive
260 the MDD layer to perform operations. It is run with multiple threads (to
261 simulate MDT service threads) locally on the MDS node, and does not need Lustre
262 clients in order to run
265 %if 0%{?suse_version}
269 %setup -qn lustre-%{version}
270 ln lustre/ChangeLog ChangeLog-lustre
271 ln lnet/ChangeLog ChangeLog-lnet
275 # Set an explicit path to our Linux tree, if we can.
276 cd $RPM_BUILD_DIR/lustre-%{version}
277 # override %optflags so that the vendor's overzealous flags don't create
279 %define optflags -g -O2 -Werror
280 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
281 %if %{with lustre_tests}
282 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests"
284 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests"
286 %if %{without lustre_iokit}
287 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-iokit"
290 %if %{with lustre_modules}
291 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-modules"
293 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-modules"
297 CONFIGURE_ARGS="$CONFIGURE_ARGS --without-zfs"
300 # if %%kdir was given, make sure it's not in the configure arguments
301 if [ -n "%kdir" ]; then
302 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
304 # ditto for %%kobjdir
305 if [ -n "%kobjdir" ]; then
306 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
308 # remove --with-kmp-moddir from configure arguments,
309 # it will be set --with-kmp-moddir=%%kmoddir
310 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
312 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
313 # string in it which we don't want word splitted by the shell
314 # also remove (build|host|target) options because they will be specified
315 # inside $CONFIGURE_ARGS
316 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
319 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
320 $CONFIGURE_ARGS --with-kmp-moddir=%{kmoddir}
321 make %{?_smp_mflags} -s %{?make_args}
324 make install DESTDIR=$RPM_BUILD_ROOT
329 # The .ha_v2 extension identifies the heartbeat resource agent as using
330 # legacy syntax. Install a compatibility symlink to avoid conflicts when
331 # newer-style agents are added.
332 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
333 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
334 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
336 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then
337 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
338 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
342 if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then
343 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
346 # Create the pristine source directory.
347 cd $RPM_BUILD_DIR/lustre-%{version}
348 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
350 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
351 make distdir distdir=lustre-source/lustre-%{version}
352 chmod -R go-w lustre-source/lustre-%{version}
353 # fc18 needs 'x' permission for library files
354 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
356 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
357 echo '%{_libdir}/libiam.a' >>lustre.files
360 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
361 echo '%{_libdir}/lustre/snmp' >>lustre.files
362 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
365 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@/ -name \*.la -delete
367 %if %{with lustre_tests}
368 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
369 echo '%{_bindir}/mcreate' >>lustre-tests.files
370 echo '%{_bindir}/munlink' >>lustre-tests.files
371 %if %{with lustre_modules}
372 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
376 %if %{defined cross_path}
377 %if %{defined rpm_post_base}
378 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
379 if [ -f $POST_SCRIPT ]; then
380 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
381 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
382 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
384 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
387 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
389 %if %{with lustre_tests}
390 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
391 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
396 # mark modules executable for find-debuginfo.sh
397 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} -name "*.ko" -type f | \
398 xargs --no-run-if-empty chmod u+x
401 %files -f lustre.files
402 %defattr(-,root,root)
403 %{?rootdir}/sbin/mount.lustre
406 %{_bindir}/lfs_migrate
410 %{_bindir}/lustre_req_history
411 %{_bindir}/plot-llstat
412 %{_bindir}/req_layout
413 %{_libdir}/libptlctl.a
414 %{_libdir}/libcfsutil.a
415 %{_libdir}/liblustreapi.a
416 %{_libdir}/liblustreapi.so
419 %{_includedir}/lustre
420 %{_includedir}/libcfs
421 %{_includedir}/linux/lustre_user.h
422 %{_libexecdir}/lustre/lc_common
423 %{_libexecdir}/lustre/haconfig
424 %{_sysconfdir}/udev/rules.d/99-lustre.rules
425 %config(noreplace) %{_sysconfdir}/ldev.conf
427 %if %{with lustre_modules}
429 %defattr(-,root,root)
430 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
431 %if %{with lustre_tests}
432 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
435 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
436 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
439 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
441 %if %{defined rpm_post_base}
442 %attr(0555, root, root) %{rpm_post_base}-modules.sh
445 %doc ChangeLog-lustre
450 %defattr(-,root,root)
451 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
452 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
453 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
454 %if %{defined rpm_post_base}
455 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
461 %defattr(-,root,root)
462 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
463 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
464 %if %{defined rpm_post_base}
465 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
468 %endif # with lustre_modules
471 %defattr(-,root,root)
472 %{_prefix}/src/lustre-%{version}
474 # uncomment these lines to enable deps packages
478 %if %{with lustre_tests}
479 %files tests -f lustre-tests.files
480 %defattr(-,root,root)
483 %if %{with lustre_iokit}
484 %files -n lustre-iokit
485 %defattr(-, root, root)
486 %{_bindir}/iokit-config
487 %{_bindir}/iokit-gather-stats
488 %{_bindir}/iokit-libecho
489 %{_bindir}/iokit-lstats
490 %{_bindir}/iokit-parse-ior
491 %{_bindir}/iokit-plot-obdfilter
492 %{_bindir}/iokit-plot-ost
493 %{_bindir}/iokit-plot-sgpdd
494 %{_bindir}/ior-survey
495 %{_bindir}/mds-survey
496 %{_bindir}/obdfilter-survey
497 %{_bindir}/ost-survey
498 %{_bindir}/sgpdd-survey
499 %doc lustre-iokit/ior-survey/README.ior-survey
500 %doc lustre-iokit/mds-survey/README.mds-survey
501 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
502 %doc lustre-iokit/ost-survey/README.ost-survey
503 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
504 %doc lustre-iokit/stats-collect/README.iokit-lstats
507 %if %{defined rpm_post_base}
509 if [ -x %{rpm_post_base}.sh ]; then
510 %{rpm_post_base}.sh %{cross_path} create
514 if [ -x %{rpm_post_base}.sh ]; then
515 %{rpm_post_base}.sh %{cross_path} remove
519 %if %{with lustre_modules}
521 %if %{defined rpm_post_base}
522 if [ -x %{rpm_post_base}-modules.sh ]; then
523 %{rpm_post_base}-modules.sh %{cross_path} create
526 if [ -f /boot/System.map-%{kversion} ]; then
527 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
529 depmod -ae %{kversion} || exit 0
532 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
533 # "weak modules" support
535 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
536 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
537 /usr/lib/module-init-tools/weak-modules --add-modules
540 if [ -x /sbin/weak-modules ]; then
541 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
542 /sbin/weak-modules --add-modules
545 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
546 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
547 # print a warning so that users are aware of this issue.
548 if sysctl kernel.unsupported >/dev/null 2>&1 &&
549 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
550 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
552 warning: the Lustre modules are not supported by Novell. To use Lustre
553 on this system, you should put
555 allow_unsupported_modules 1
557 into /etc/modprobe.d/unsupported_modules"
563 %if %{defined rpm_post_base}
564 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
565 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
568 if [ -f /boot/System.map-%{kversion} ]; then
569 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
571 depmod -ae %{kversion} || exit 0
574 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
575 # "weak modules" support
577 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
578 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
579 /usr/lib/module-init-tools/weak-modules --add-modules
582 if [ -x /sbin/weak-modules ]; then
583 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
584 /sbin/weak-modules --add-modules
587 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
588 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
589 # print a warning so that users are aware of this issue.
590 if sysctl kernel.unsupported >/dev/null 2>&1 &&
591 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
592 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
594 warning: the Lustre modules are not supported by Novell. To use Lustre
595 on this system, you should put
597 allow_unsupported_modules 1
599 into /etc/modprobe.d/unsupported_modules"
606 %if %{defined rpm_post_base}
607 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
608 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
611 if [ -f /boot/System.map-%{kversion} ]; then
612 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
614 depmod -ae %{kversion} || exit 0
617 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
618 # "weak modules" support
620 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
621 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
622 /usr/lib/module-init-tools/weak-modules --add-modules
625 if [ -x /sbin/weak-modules ]; then
626 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
627 /sbin/weak-modules --add-modules
630 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
631 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
632 # print a warning so that users are aware of this issue.
633 if sysctl kernel.unsupported >/dev/null 2>&1 &&
634 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
635 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
637 warning: the Lustre modules are not supported by Novell. To use Lustre
638 on this system, you should put
640 allow_unsupported_modules 1
642 into /etc/modprobe.d/unsupported_modules"
648 %if %{defined rpm_post_base}
649 if [ -x %{rpm_post_base}-modules.sh ]; then
650 %{rpm_post_base}-modules.sh %{cross_path} remove
653 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
654 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
659 %if %{defined rpm_post_base}
660 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
661 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
664 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
665 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
671 %if %{defined rpm_post_base}
672 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
673 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
676 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
677 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
681 %if %{undefined cross_path}
683 if [ -f /boot/System.map-%{kversion} ]; then
684 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
686 depmod -ae %{kversion} || exit 0
689 # "weak modules" support
691 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
692 cat /var/run/%{name}-modules |
693 /usr/lib/module-init-tools/weak-modules --remove-modules
696 if [ -x /sbin/weak-modules ]; then
697 cat /var/run/%{name}-modules |
698 /sbin/weak-modules --remove-modules
700 rm /var/run/%{name}-modules
704 if [ -f /boot/System.map-%{kversion} ]; then
705 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
707 depmod -ae %{kversion} || exit 0
710 # "weak modules" support
712 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
713 cat /var/run/%{name}-osd-ldiskfs |
714 /usr/lib/module-init-tools/weak-modules --remove-modules
717 if [ -x /sbin/weak-modules ]; then
718 cat /var/run/%{name}-osd-ldiskfs |
719 /sbin/weak-modules --remove-modules
721 rm /var/run/%{name}-osd-ldiskfs
726 if [ -f /boot/System.map-%{kversion} ]; then
727 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
729 depmod -ae %{kversion} || exit 0
732 # "weak modules" support
734 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
735 cat /var/run/%{name}-osd-zfs |
736 /usr/lib/module-init-tools/weak-modules --remove-modules
739 if [ -x /sbin/weak-modules ]; then
740 cat /var/run/%{name}-osd-zfs |
741 /sbin/weak-modules --remove-modules
743 rm /var/run/%{name}-osd-zfs
746 %endif # with lustre_modules
748 %if %{with lustre_tests}
749 %if %{defined rpm_post_base}
751 if [ -x %{rpm_post_base}-tests.sh ]; then
752 %{rpm_post_base}-tests.sh %{cross_path} create
756 if [ -x %{rpm_post_base}-tests.sh ]; then
757 %{rpm_post_base}-tests.sh %{cross_path} remove
760 %if %{with lustre_modules}
762 if [ -f /boot/System.map-%{kversion} ]; then
763 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
765 depmod -ae %{kversion} || exit 0
769 if [ -f /boot/System.map-%{kversion} ]; then
770 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
772 depmod -ae %{kversion} || exit 0
779 rm -rf $RPM_BUILD_ROOT