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)
451 %exclude %{_sbindir}/zfsobj2fid
453 %if %{with lustre_utils}
455 %{_libexecdir}/lustre/lc_common
456 %{_libexecdir}/lustre/haconfig
457 %{_bindir}/lustre_req_history
462 %{_bindir}/plot-llstat
465 %{_bindir}/lfs_migrate
466 %{?rootdir}/sbin/mount.lustre
467 %{_libdir}/libptlctl.a
468 %{_libdir}/libcfsutil.a
469 %{_libdir}/liblustreapi.a
470 %{_libdir}/liblustreapi.so
474 %{_includedir}/lustre
475 %{_includedir}/libcfs
478 %{_sysconfdir}/udev/rules.d/99-lustre.rules
479 %config(noreplace) %{_sysconfdir}/ldev.conf
481 %if %{with lustre_modules}
483 %defattr(-,root,root)
484 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
485 %if %{with lustre_tests}
486 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
489 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
490 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
493 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
495 %if %{defined rpm_post_base}
496 %attr(0555, root, root) %{rpm_post_base}-modules.sh
499 %doc ChangeLog-lustre
504 %defattr(-,root,root)
505 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
506 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
507 %if %{defined rpm_post_base}
508 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
510 %if %{with lustre_utils}
511 %files osd-ldiskfs-mount
512 %defattr(-,root,root)
513 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
514 %if %{defined rpm_post_base}
515 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
522 %defattr(-,root,root)
523 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
524 %{_sbindir}/zfsobj2fid
525 %if %{defined rpm_post_base}
526 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
528 %if %{with lustre_utils}
530 %defattr(-,root,root)
531 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
532 %if %{defined rpm_post_base}
533 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
537 %endif # with lustre_modules
540 %defattr(-,root,root)
541 %{_prefix}/src/lustre-%{version}
543 # uncomment these lines to enable deps packages
547 %if %{with lustre_tests}
548 %files tests -f lustre-tests.files
549 %defattr(-,root,root)
552 %if %{with lustre_iokit}
553 %files -n lustre-iokit
554 %defattr(-, root, root)
555 %{_bindir}/iokit-config
556 %{_bindir}/iokit-gather-stats
557 %{_bindir}/iokit-libecho
558 %{_bindir}/iokit-lstats
559 %{_bindir}/iokit-parse-ior
560 %{_bindir}/iokit-plot-obdfilter
561 %{_bindir}/iokit-plot-ost
562 %{_bindir}/iokit-plot-sgpdd
563 %{_bindir}/ior-survey
564 %{_bindir}/mds-survey
565 %{_bindir}/obdfilter-survey
566 %{_bindir}/ost-survey
567 %{_bindir}/sgpdd-survey
568 %doc lustre-iokit/ior-survey/README.ior-survey
569 %doc lustre-iokit/mds-survey/README.mds-survey
570 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
571 %doc lustre-iokit/ost-survey/README.ost-survey
572 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
573 %doc lustre-iokit/stats-collect/README.iokit-lstats
576 %if %{defined rpm_post_base}
578 if [ -x %{rpm_post_base}.sh ]; then
579 %{rpm_post_base}.sh %{cross_path} create
583 if [ -x %{rpm_post_base}.sh ]; then
584 %{rpm_post_base}.sh %{cross_path} remove
588 %if %{with lustre_modules}
590 %if %{defined rpm_post_base}
591 if [ -x %{rpm_post_base}-modules.sh ]; then
592 %{rpm_post_base}-modules.sh %{cross_path} create
595 if [ -f /boot/System.map-%{kversion} ]; then
596 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
598 depmod -ae %{kversion} || exit 0
601 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
602 # "weak modules" support
604 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
605 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
606 /usr/lib/module-init-tools/weak-modules --add-modules
609 if [ -x /sbin/weak-modules ]; then
610 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
611 /sbin/weak-modules --add-modules
614 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
615 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
616 # print a warning so that users are aware of this issue.
617 if sysctl kernel.unsupported >/dev/null 2>&1 &&
618 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
619 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
621 warning: the Lustre modules are not supported by Novell. To use Lustre
622 on this system, you should put
624 allow_unsupported_modules 1
626 into /etc/modprobe.d/unsupported_modules"
632 %if %{defined rpm_post_base}
633 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
634 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
637 if [ -f /boot/System.map-%{kversion} ]; then
638 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
640 depmod -ae %{kversion} || exit 0
643 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
644 # "weak modules" support
646 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
647 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
648 /usr/lib/module-init-tools/weak-modules --add-modules
651 if [ -x /sbin/weak-modules ]; then
652 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
653 /sbin/weak-modules --add-modules
656 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
657 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
658 # print a warning so that users are aware of this issue.
659 if sysctl kernel.unsupported >/dev/null 2>&1 &&
660 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
661 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
663 warning: the Lustre modules are not supported by Novell. To use Lustre
664 on this system, you should put
666 allow_unsupported_modules 1
668 into /etc/modprobe.d/unsupported_modules"
671 %if %{with lustre_utils} && %{defined rpm_post_base}
672 %post osd-ldiskfs-mount
673 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
674 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
681 %if %{defined rpm_post_base}
682 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
683 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
686 if [ -f /boot/System.map-%{kversion} ]; then
687 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
689 depmod -ae %{kversion} || exit 0
692 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
693 # "weak modules" support
695 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
696 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
697 /usr/lib/module-init-tools/weak-modules --add-modules
700 if [ -x /sbin/weak-modules ]; then
701 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
702 /sbin/weak-modules --add-modules
705 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
706 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
707 # print a warning so that users are aware of this issue.
708 if sysctl kernel.unsupported >/dev/null 2>&1 &&
709 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
710 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
712 warning: the Lustre modules are not supported by Novell. To use Lustre
713 on this system, you should put
715 allow_unsupported_modules 1
717 into /etc/modprobe.d/unsupported_modules"
720 %if %{with lustre_utils} && %{defined rpm_post_base}
722 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
723 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
729 %if %{defined rpm_post_base}
730 if [ -x %{rpm_post_base}-modules.sh ]; then
731 %{rpm_post_base}-modules.sh %{cross_path} remove
734 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
735 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
740 %if %{defined rpm_post_base}
741 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
742 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
745 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
746 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
748 %if %{with lustre_utils} && %{defined rpm_post_base}
749 %preun osd-ldiskfs-mount
750 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
751 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
758 %if %{defined rpm_post_base}
759 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
760 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
763 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
764 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
766 %if %{with lustre_utils} && %{defined rpm_post_base}
768 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
769 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
774 %if %{undefined cross_path}
776 if [ -f /boot/System.map-%{kversion} ]; then
777 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
779 depmod -ae %{kversion} || exit 0
782 # "weak modules" support
784 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
785 cat /var/run/%{name}-modules |
786 /usr/lib/module-init-tools/weak-modules --remove-modules
789 if [ -x /sbin/weak-modules ]; then
790 cat /var/run/%{name}-modules |
791 /sbin/weak-modules --remove-modules
793 rm /var/run/%{name}-modules
797 if [ -f /boot/System.map-%{kversion} ]; then
798 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
800 depmod -ae %{kversion} || exit 0
803 # "weak modules" support
805 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
806 cat /var/run/%{name}-osd-ldiskfs |
807 /usr/lib/module-init-tools/weak-modules --remove-modules
810 if [ -x /sbin/weak-modules ]; then
811 cat /var/run/%{name}-osd-ldiskfs |
812 /sbin/weak-modules --remove-modules
814 rm /var/run/%{name}-osd-ldiskfs
819 if [ -f /boot/System.map-%{kversion} ]; then
820 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
822 depmod -ae %{kversion} || exit 0
825 # "weak modules" support
827 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
828 cat /var/run/%{name}-osd-zfs |
829 /usr/lib/module-init-tools/weak-modules --remove-modules
832 if [ -x /sbin/weak-modules ]; then
833 cat /var/run/%{name}-osd-zfs |
834 /sbin/weak-modules --remove-modules
836 rm /var/run/%{name}-osd-zfs
839 %endif # with lustre_modules
841 %if %{with lustre_tests}
842 %if %{defined rpm_post_base}
844 if [ -x %{rpm_post_base}-tests.sh ]; then
845 %{rpm_post_base}-tests.sh %{cross_path} create
849 if [ -x %{rpm_post_base}-tests.sh ]; then
850 %{rpm_post_base}-tests.sh %{cross_path} remove
853 %if %{with lustre_modules}
855 if [ -f /boot/System.map-%{kversion} ]; then
856 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
858 depmod -ae %{kversion} || exit 0
862 if [ -f /boot/System.map-%{kversion} ]; then
863 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
865 depmod -ae %{kversion} || exit 0
872 rm -rf $RPM_BUILD_ROOT