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
12 %bcond_without manpages
14 %if %{without servers}
15 # --without servers overrides --with {ldiskfs|zfs}
16 # so undefine the internal variables set by bcond_*
17 %undefine with_ldiskfs
21 %{!?version: %global version @VERSION@}
22 %{!?kver: %global kver %(uname -r)}
23 %{!?kdir: %global kdir /lib/modules/%{kver}/source}
24 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{kver}/source" ]; then echo "/lib/modules/%{kver}/build"; else echo "%{kdir}"; fi)}
26 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
27 %{!?kversion: %global kversion %(files="include/generated/utsrelease.h include/linux/utsrelease.h include/linux/version.h"; for f in $files; do if test -r %{kobjdir}/$f && grep UTS_RELEASE %{kobjdir}/$f >/dev/null; then sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' %{kobjdir}/$f; break; fi; done)}
29 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
31 %if 0%{?build_src_rpm}
32 %{!?myrelease: %global myrelease 1}
34 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
35 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
38 # always append the buildid, even when the caller defines %release
39 %define fullrelease %{myrelease}%{buildid}
41 # in order to get kernel symset and/or kernel module dependencies into
42 # the RPM, in order to support weak-modules, the internal dependency gen-
43 # erator needs to be disabled
44 # this is done with (reduce the double % down to a single %):
46 # %%global _use_internal_dependency_generator 0
48 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
49 # defining it here (until Suse changes their mind)
51 # on RHEL5, however, we do need to explicitly disable the internal dep-
52 # endency generator and allow the external one be used
53 # but since RedHat's kABI is only a subset of the total kernel ABI, it
54 # doesn't include all of the symbols we (or OFED for that matter) need
55 # until RedHat includes all of the symbols we need in their symsets we
56 # cannot support weak-modules
57 # we did e-mail the maintainer of all of this stuff @redhat but got no
59 #%%global _use_internal_dependency_generator 0
61 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
63 %define krequires %(echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/-default$//')
65 # Set the package name prefix
66 %if %{undefined lustre_name}
68 %global lustre_name lustre
70 %global lustre_name lustre-client
74 %if %{undefined kmoddir}
75 %if %{defined kernel_module_package_moddir}
76 %global kmoddir %{kernel_module_package_moddir}
78 %if %{defined suse_kernel_module_package}
79 %global kmoddir updates
86 %if %{defined cross_path} && %{defined post_script}
87 %define rpm_post_base %(dirname %{cross_path})/%{lustre_name}
90 # SUSE don't support .debug_info section from cross compiler:
91 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
92 %if %{defined cross_path} && 0%{?suse_version}
93 %global __debug_install_post %{nil}
94 %global __debug_package %{nil}
95 %global debug_package %{nil}
98 Summary: Lustre File System
101 Release: %{fullrelease}
103 Group: Utilities/System
104 Source: lustre-%{version}.tar.gz
105 URL: https://wiki.hpdd.intel.com/
106 BuildRoot: %{_tmppath}/lustre-%{version}-root
107 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
108 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
109 Requires: %{name}-modules = %{version}
110 BuildRequires: libtool
112 BuildRequires: python-docutils
116 Requires: lustre-osd-mount
118 %if %{defined cross_requires}
119 Requires: %{cross_requires}
122 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
123 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
124 #suse don't support selinux
125 BuildRequires: libselinux-devel
131 Userspace tools and files for the Lustre file system.
133 %if %{with lustre_modules}
135 Summary: Kernel Lustre modules for Linux %{kversion}
136 %if %{defined cross_requires}
137 Requires: %{cross_requires}
140 # for SLES11, we need nothing here
141 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
142 # for RHEL we need to require the specific kernel still since weak-modules
143 # support on RH is, well, weak, to be punny about it
144 Requires: kernel = %{krequires}
147 BuildRequires: libyaml-devel
151 Group: Development/Kernel
154 Lustre file system, server and network drivers for Linux %{kversion}.
158 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
159 Requires: lustre-modules = %{version}
160 Requires: module-init-tools >= 3.9
161 Requires: ldiskfsprogs >= 1.42.7.wc1
162 Requires: lustre-osd-ldiskfs-mount
164 Obsoletes: lustre-ldiskfs
165 Group: Development/Kernel
167 %description osd-ldiskfs
168 The Lustre Object Storage Device (OSD) API is the interface to access and
169 modify data that is supposed to be stored persistently. This API is the interface
170 to code that bridges individual file systems. This specific package provides an
171 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
172 backing store of a Lustre server.
174 %if %{with lustre_utils}
175 %package osd-ldiskfs-mount
176 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
177 Provides: lustre-osd-mount
178 Group: Development/Kernel
180 %description osd-ldiskfs-mount
181 LDISKFS hooks for mount/mkfs into a dynamic library.
188 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
189 Requires: lustre-modules = %{version}, zfs-kmod
190 Requires: lustre-osd-zfs-mount
192 Group: Development/Kernel
195 The Lustre Object Storage Device (OSD) API is the interface to access and
196 modify data that is supposed to be stored persistently. This API is the interface
197 to code that bridges individual file systems. This specific package provides an
198 implementation of the OSD API for using the ZFS filesystem as the underlying
199 backing store of a Lustre server.
201 %if %{with lustre_utils}
202 %package osd-zfs-mount
203 Summary: osd-zfs-mount contains mount's zfs specific dso.
204 Provides: lustre-osd-mount
205 Group: Development/Kernel
207 %description osd-zfs-mount
208 ZFS hooks for mount/mkfs into a dynamic library.
212 %endif # with lustre_modules
215 Summary: Object-Based Disk storage driver source
216 Group: Development/Kernel
219 Lustre sources for further development
221 # Since the RPMs we ship are to be used on both SLES and RHEL, we
222 # can't include any dependency information (since the package names
223 # are different on the two platforms).
225 # Instead, we can build these empty meta-packages that only include
226 # dependency information. These let people get the correct
227 # dependencies for their platform and lets them use tools like yum and
228 # red carpet to install the correct files.
230 # Unfortunately I have not seen this come up on the lists much, so I
231 # have disabled them (by commenting out their empty files section
232 # below) until it's clear that they resolve more confusion than they
236 Summary: Lustre dependencies meta-package for SLES
237 Group: Utilities/System
238 Provides: lustre-deps = %{version}
239 Requires: %{name} = %{version}, sles-release
240 Conflicts: %{name}-deps-rhel
242 %description deps-sles
243 This package has RPM dependencies appropriate for SLES systems.
246 Summary: Lustre dependencies meta-package for RHEL
247 Group: Utilities/System
248 Provides: lustre-deps = %{version}
249 Requires: %{name} = %{version}, redhat-release
250 Conflicts: %{name}-deps-sles
252 %description deps-rhel
253 This package has RPM dependencies appropriate for RHEL, RHL, and FC
257 Summary: Lustre testing framework
258 Group: Development/Kernel
259 Provides: %{name}-tests = %{version}
260 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
261 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
264 This package contains a set of test binaries and scripts that are intended
265 to be used by the Lustre testing framework.
267 %if %{with lustre_iokit}
268 %package -n lustre-iokit
269 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
270 Group: Applications/System
271 Requires: python > 2.2, sg3_utils
273 %description -n lustre-iokit
274 This package includes five tools:
276 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
279 This survey can be run in 3 modes to test disk I/O including the filesystem,
280 network I/O, and disk I/O via the network. The script does sequential I/O
281 with varying numbers of threads and objects (files) by using lctl::test_brw
282 to drive the echo_client connected to local or remote obdfilter instances,
283 or remote obdecho instances.
286 This survey tests the client-to-disk performance of individual OSTs, and
287 ranks then for comparison.
290 This script will collect IO stats on a defined set of nodes.
293 A script to run the IOR benchmark. The latest version can be downloaded from
294 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
297 This survey tests the local metadata performance using the echo_client to drive
298 the MDD layer to perform operations. It is run with multiple threads (to
299 simulate MDT service threads) locally on the MDS node, and does not need Lustre
300 clients in order to run
303 %if 0%{?suse_version}
307 %setup -qn lustre-%{version}
308 ln lustre/ChangeLog ChangeLog-lustre
309 ln lnet/ChangeLog ChangeLog-lnet
313 # Set an explicit path to our Linux tree, if we can.
314 cd $RPM_BUILD_DIR/lustre-%{version}
315 # override %optflags so that the vendor's overzealous flags don't create
317 %define optflags -g -O2 -Werror
319 CONFIGURE_ARGS="%{?configure_args}"
320 if [ -n "$CONFIGURE_ARGS" ]; then
321 # make sure %%kdir and %%kobjdir are not in the configure arguments
322 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
323 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
324 # remove --with-kmp-moddir from configure arguments,
325 # it will be set --with-kmp-moddir=%%kmoddir
326 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
329 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
330 # string in it which we don't want word splitted by the shell
331 # also remove (build|host|target) options because they will be specified
332 # inside $CONFIGURE_ARGS
333 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
335 %eval_configure $CONFIGURE_ARGS \
336 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
337 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
338 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
339 %{!?with_lustre_iokit:--disable-iokit} \
340 %{!?with_ldiskfs:--disable-ldiskfs} \
341 %{!?with_servers:--disable-server} \
342 %{!?with_zfs:--without-zfs} \
343 %{!?with_lnet_dlc:--disable-dlc} \
344 %{!?with_manpages:--disable-manpages} \
345 --with-release=%{release} \
346 --with-linux=%{kdir} \
347 --with-linux-obj=%{kobjdir} \
348 --with-kmp-moddir=%{kmoddir}
350 make %{?_smp_mflags} -s %{?make_args}
353 make install DESTDIR=$RPM_BUILD_ROOT
357 %if %{with servers} && %{with lustre_utils}
358 # The .ha_v2 extension identifies the heartbeat resource agent as using
359 # legacy syntax. Install a compatibility symlink to avoid conflicts when
360 # newer-style agents are added.
361 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
362 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
363 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
366 %if %{_vendor}=="redhat"
367 # The following scripts are Red Hat specific
369 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
370 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
372 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
375 # Create the pristine source directory.
376 cd $RPM_BUILD_DIR/lustre-%{version}
377 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
379 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
380 make distdir distdir=lustre-source/lustre-%{version}
381 chmod -R go-w lustre-source/lustre-%{version}
382 # fc18 needs 'x' permission for library files
383 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
386 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
387 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
391 echo '%{_libdir}/libiam.a' >>lustre.files
394 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
395 echo '%{_libdir}/lustre/snmp' >>lustre.files
396 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
399 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
400 -name \*.la -type f -exec rm -f {} \;
402 %if %{with lustre_tests}
403 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
404 echo '%{_bindir}/mcreate' >>lustre-tests.files
405 echo '%{_bindir}/munlink' >>lustre-tests.files
406 echo '%{_bindir}/req_layout' >>lustre-tests.files
407 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
408 echo '%{_sbindir}/wiretest' >>lustre-tests.files
409 %if %{with lustre_modules}
410 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
414 %if %{defined cross_path}
415 %if %{defined rpm_post_base}
416 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
417 if [ -f $POST_SCRIPT ]; then
418 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
419 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
420 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
422 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
423 %if %{with lustre_utils}
424 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
428 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
429 %if %{with lustre_utils}
430 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
433 %if %{with lustre_tests}
434 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
435 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
440 %if %{with lustre_modules}
441 # mark modules executable for find-debuginfo.sh
442 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
443 -name \*.ko -type f -exec chmod u+x {} \;
447 %files -f lustre.files
448 %defattr(-,root,root)
450 %exclude %{_sbindir}/wirecheck
451 %exclude %{_sbindir}/wiretest
453 %exclude %{_sbindir}/zfsobj2fid
455 %if %{with lustre_utils}
457 %{_libexecdir}/lustre/lc_common
458 %{_libexecdir}/lustre/haconfig
459 %{_bindir}/lustre_req_history
464 %{_bindir}/plot-llstat
467 %{_bindir}/lfs_migrate
468 %{?rootdir}/sbin/mount.lustre
469 %{_libdir}/libptlctl.a
470 %{_libdir}/libcfsutil.a
471 %{_libdir}/liblustreapi.a
472 %{_libdir}/liblustreapi.so
476 %{_includedir}/lustre
477 %{_includedir}/libcfs
480 %{_sysconfdir}/udev/rules.d/99-lustre.rules
481 %config(noreplace) %{_sysconfdir}/ldev.conf
483 %if %{with lustre_modules}
485 %defattr(-,root,root)
486 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
487 %if %{with lustre_tests}
488 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
491 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
492 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
495 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
497 %if %{defined rpm_post_base}
498 %attr(0555, root, root) %{rpm_post_base}-modules.sh
501 %doc ChangeLog-lustre
506 %defattr(-,root,root)
507 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
508 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
509 %if %{defined rpm_post_base}
510 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
512 %if %{with lustre_utils}
513 %files osd-ldiskfs-mount
514 %defattr(-,root,root)
515 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
516 %if %{defined rpm_post_base}
517 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
524 %defattr(-,root,root)
525 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
526 %{_sbindir}/zfsobj2fid
527 %if %{defined rpm_post_base}
528 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
530 %if %{with lustre_utils}
532 %defattr(-,root,root)
533 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
534 %if %{defined rpm_post_base}
535 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
539 %endif # with lustre_modules
542 %defattr(-,root,root)
543 %{_prefix}/src/lustre-%{version}
545 # uncomment these lines to enable deps packages
549 %if %{with lustre_tests}
550 %files tests -f lustre-tests.files
551 %defattr(-,root,root)
554 %if %{with lustre_iokit}
555 %files -n lustre-iokit
556 %defattr(-, root, root)
557 %{_bindir}/iokit-config
558 %{_bindir}/iokit-gather-stats
559 %{_bindir}/iokit-libecho
560 %{_bindir}/iokit-lstats
561 %{_bindir}/iokit-parse-ior
562 %{_bindir}/iokit-plot-obdfilter
563 %{_bindir}/iokit-plot-ost
564 %{_bindir}/iokit-plot-sgpdd
565 %{_bindir}/ior-survey
566 %{_bindir}/mds-survey
567 %{_bindir}/obdfilter-survey
568 %{_bindir}/ost-survey
569 %{_bindir}/sgpdd-survey
570 %doc lustre-iokit/ior-survey/README.ior-survey
571 %doc lustre-iokit/mds-survey/README.mds-survey
572 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
573 %doc lustre-iokit/ost-survey/README.ost-survey
574 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
575 %doc lustre-iokit/stats-collect/README.iokit-lstats
578 %if %{defined rpm_post_base}
580 if [ -x %{rpm_post_base}.sh ]; then
581 %{rpm_post_base}.sh %{cross_path} create
585 if [ -x %{rpm_post_base}.sh ]; then
586 %{rpm_post_base}.sh %{cross_path} remove
590 %if %{with lustre_modules}
592 %if %{defined rpm_post_base}
593 if [ -x %{rpm_post_base}-modules.sh ]; then
594 %{rpm_post_base}-modules.sh %{cross_path} create
597 if [ -f /boot/System.map-%{kversion} ]; then
598 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
600 depmod -ae %{kversion} || exit 0
603 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
604 # "weak modules" support
606 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
607 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
608 /usr/lib/module-init-tools/weak-modules --add-modules
611 if [ -x /sbin/weak-modules ]; then
612 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
613 /sbin/weak-modules --add-modules
616 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
617 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
618 # print a warning so that users are aware of this issue.
619 if sysctl kernel.unsupported >/dev/null 2>&1 &&
620 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
621 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
623 warning: the Lustre modules are not supported by Novell. To use Lustre
624 on this system, you should put
626 allow_unsupported_modules 1
628 into /etc/modprobe.d/unsupported_modules"
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} create
639 if [ -f /boot/System.map-%{kversion} ]; then
640 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
642 depmod -ae %{kversion} || exit 0
645 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
646 # "weak modules" support
648 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
649 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
650 /usr/lib/module-init-tools/weak-modules --add-modules
653 if [ -x /sbin/weak-modules ]; then
654 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
655 /sbin/weak-modules --add-modules
658 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
659 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
660 # print a warning so that users are aware of this issue.
661 if sysctl kernel.unsupported >/dev/null 2>&1 &&
662 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
663 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
665 warning: the Lustre modules are not supported by Novell. To use Lustre
666 on this system, you should put
668 allow_unsupported_modules 1
670 into /etc/modprobe.d/unsupported_modules"
673 %if %{with lustre_utils} && %{defined rpm_post_base}
674 %post osd-ldiskfs-mount
675 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
676 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
683 %if %{defined rpm_post_base}
684 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
685 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
688 if [ -f /boot/System.map-%{kversion} ]; then
689 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
691 depmod -ae %{kversion} || exit 0
694 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
695 # "weak modules" support
697 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
698 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
699 /usr/lib/module-init-tools/weak-modules --add-modules
702 if [ -x /sbin/weak-modules ]; then
703 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
704 /sbin/weak-modules --add-modules
707 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
708 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
709 # print a warning so that users are aware of this issue.
710 if sysctl kernel.unsupported >/dev/null 2>&1 &&
711 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
712 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
714 warning: the Lustre modules are not supported by Novell. To use Lustre
715 on this system, you should put
717 allow_unsupported_modules 1
719 into /etc/modprobe.d/unsupported_modules"
722 %if %{with lustre_utils} && %{defined rpm_post_base}
724 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
725 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
731 %if %{defined rpm_post_base}
732 if [ -x %{rpm_post_base}-modules.sh ]; then
733 %{rpm_post_base}-modules.sh %{cross_path} remove
736 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
737 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
742 %if %{defined rpm_post_base}
743 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
744 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
747 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
748 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
750 %if %{with lustre_utils} && %{defined rpm_post_base}
751 %preun osd-ldiskfs-mount
752 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
753 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
760 %if %{defined rpm_post_base}
761 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
762 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
765 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
766 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
768 %if %{with lustre_utils} && %{defined rpm_post_base}
770 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
771 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
776 %if %{undefined cross_path}
778 if [ -f /boot/System.map-%{kversion} ]; then
779 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
781 depmod -ae %{kversion} || exit 0
784 # "weak modules" support
786 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
787 cat /var/run/%{name}-modules |
788 /usr/lib/module-init-tools/weak-modules --remove-modules
791 if [ -x /sbin/weak-modules ]; then
792 cat /var/run/%{name}-modules |
793 /sbin/weak-modules --remove-modules
795 rm /var/run/%{name}-modules
799 if [ -f /boot/System.map-%{kversion} ]; then
800 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
802 depmod -ae %{kversion} || exit 0
805 # "weak modules" support
807 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
808 cat /var/run/%{name}-osd-ldiskfs |
809 /usr/lib/module-init-tools/weak-modules --remove-modules
812 if [ -x /sbin/weak-modules ]; then
813 cat /var/run/%{name}-osd-ldiskfs |
814 /sbin/weak-modules --remove-modules
816 rm /var/run/%{name}-osd-ldiskfs
821 if [ -f /boot/System.map-%{kversion} ]; then
822 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
824 depmod -ae %{kversion} || exit 0
827 # "weak modules" support
829 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
830 cat /var/run/%{name}-osd-zfs |
831 /usr/lib/module-init-tools/weak-modules --remove-modules
834 if [ -x /sbin/weak-modules ]; then
835 cat /var/run/%{name}-osd-zfs |
836 /sbin/weak-modules --remove-modules
838 rm /var/run/%{name}-osd-zfs
841 %endif # with lustre_modules
843 %if %{with lustre_tests}
844 %if %{defined rpm_post_base}
846 if [ -x %{rpm_post_base}-tests.sh ]; then
847 %{rpm_post_base}-tests.sh %{cross_path} create
851 if [ -x %{rpm_post_base}-tests.sh ]; then
852 %{rpm_post_base}-tests.sh %{cross_path} remove
855 %if %{with lustre_modules}
857 if [ -f /boot/System.map-%{kversion} ]; then
858 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
860 depmod -ae %{kversion} || exit 0
864 if [ -f /boot/System.map-%{kversion} ]; then
865 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
867 depmod -ae %{kversion} || exit 0
874 rm -rf $RPM_BUILD_ROOT