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 '-' '_')}
36 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
38 %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/\.aarch64$//' -e 's/-default$//')
41 # always append the buildid, even when the caller defines %release
42 %define fullrelease %{myrelease}%{buildid}
44 # in order to get kernel symset and/or kernel module dependencies into
45 # the RPM, in order to support weak-modules, the internal dependency gen-
46 # erator needs to be disabled
47 # this is done with (reduce the double % down to a single %):
49 # %%global _use_internal_dependency_generator 0
51 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
52 # defining it here (until Suse changes their mind)
54 # on RHEL5, however, we do need to explicitly disable the internal dep-
55 # endency generator and allow the external one be used
56 # but since RedHat's kABI is only a subset of the total kernel ABI, it
57 # doesn't include all of the symbols we (or OFED for that matter) need
58 # until RedHat includes all of the symbols we need in their symsets we
59 # cannot support weak-modules
60 # we did e-mail the maintainer of all of this stuff @redhat but got no
62 #%%global _use_internal_dependency_generator 0
64 # Set the package name prefix
65 %if %{undefined lustre_name}
67 %global lustre_name lustre
69 %global lustre_name lustre-client
73 %if %{undefined kmoddir}
74 %if %{defined kernel_module_package_moddir}
75 %global kmoddir %{kernel_module_package_moddir}
77 %if %{defined suse_kernel_module_package}
78 %global kmoddir updates
85 %if %{defined cross_path} && %{defined post_script}
86 %define rpm_post_base %(dirname %{cross_path})/%{lustre_name}
89 # SUSE don't support .debug_info section from cross compiler:
90 # /usr/lib/rpm/debugedit: Unhandled relocation 10 in .debug_info section
91 %if %{defined cross_path} && 0%{?suse_version}
92 %global __debug_install_post %{nil}
93 %global __debug_package %{nil}
94 %global debug_package %{nil}
97 Summary: Lustre File System
100 Release: %{fullrelease}
102 Group: Utilities/System
103 Source: lustre-%{version}.tar.gz
104 URL: https://wiki.hpdd.intel.com/
105 BuildRoot: %{_tmppath}/lustre-%{version}-root
106 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
107 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
108 Requires: %{name}-modules = %{version}
109 BuildRequires: libtool
111 BuildRequires: python-docutils
115 Requires: lustre-osd-mount
116 Provides: lustre-client = %{version}-%{fullrelease}
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 %if %{defined krequires}
143 # for RHEL we need to require the specific kernel still since weak-modules
144 # support on RH is, well, weak, to be punny about it
145 Requires: kernel = %{krequires}
149 BuildRequires: libyaml-devel
153 Group: Development/Kernel
156 Lustre file system, server and network drivers for Linux %{kversion}.
160 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
161 Requires: lustre-modules = %{version}
162 Requires: module-init-tools >= 3.9
163 Requires: ldiskfsprogs >= 1.42.7.wc1
164 Requires: lustre-osd-ldiskfs-mount = %{version}
166 Obsoletes: lustre-ldiskfs
167 Group: Development/Kernel
169 %description osd-ldiskfs
170 The Lustre Object Storage Device (OSD) API is the interface to access and
171 modify data that is supposed to be stored persistently. This API is the interface
172 to code that bridges individual file systems. This specific package provides an
173 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
174 backing store of a Lustre server.
176 %if %{with lustre_utils}
177 %package osd-ldiskfs-mount
178 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
179 Provides: lustre-osd-mount
180 Group: Development/Kernel
182 %description osd-ldiskfs-mount
183 LDISKFS hooks for mount/mkfs into a dynamic library.
190 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
191 Requires: lustre-modules = %{version}, zfs-kmod
192 Requires: lustre-osd-zfs-mount = %{version}
194 Group: Development/Kernel
197 The Lustre Object Storage Device (OSD) API is the interface to access and
198 modify data that is supposed to be stored persistently. This API is the interface
199 to code that bridges individual file systems. This specific package provides an
200 implementation of the OSD API for using the ZFS filesystem as the underlying
201 backing store of a Lustre server.
203 %if %{with lustre_utils}
204 %package osd-zfs-mount
205 Summary: osd-zfs-mount contains mount's zfs specific dso.
206 Provides: lustre-osd-mount
207 Group: Development/Kernel
209 %description osd-zfs-mount
210 ZFS hooks for mount/mkfs into a dynamic library.
214 %endif # with lustre_modules
217 Summary: Object-Based Disk storage driver source
218 Group: Development/Kernel
221 Lustre sources for further development
223 # Since the RPMs we ship are to be used on both SLES and RHEL, we
224 # can't include any dependency information (since the package names
225 # are different on the two platforms).
227 # Instead, we can build these empty meta-packages that only include
228 # dependency information. These let people get the correct
229 # dependencies for their platform and lets them use tools like yum and
230 # red carpet to install the correct files.
232 # Unfortunately I have not seen this come up on the lists much, so I
233 # have disabled them (by commenting out their empty files section
234 # below) until it's clear that they resolve more confusion than they
238 Summary: Lustre dependencies meta-package for SLES
239 Group: Utilities/System
240 Provides: lustre-deps = %{version}
241 Requires: %{name} = %{version}, sles-release
242 Conflicts: %{name}-deps-rhel
244 %description deps-sles
245 This package has RPM dependencies appropriate for SLES systems.
248 Summary: Lustre dependencies meta-package for RHEL
249 Group: Utilities/System
250 Provides: lustre-deps = %{version}
251 Requires: %{name} = %{version}, redhat-release
252 Conflicts: %{name}-deps-sles
254 %description deps-rhel
255 This package has RPM dependencies appropriate for RHEL, RHL, and FC
259 Summary: Lustre testing framework
260 Group: Development/Kernel
261 Provides: %{name}-tests = %{version}
262 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
263 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
266 This package contains a set of test binaries and scripts that are intended
267 to be used by the Lustre testing framework.
269 %if %{with lustre_iokit}
270 %package -n lustre-iokit
271 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
272 Group: Applications/System
273 Requires: python > 2.2, sg3_utils
275 %description -n lustre-iokit
276 This package includes five tools:
278 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
281 This survey can be run in 3 modes to test disk I/O including the filesystem,
282 network I/O, and disk I/O via the network. The script does sequential I/O
283 with varying numbers of threads and objects (files) by using lctl::test_brw
284 to drive the echo_client connected to local or remote obdfilter instances,
285 or remote obdecho instances.
288 This survey tests the client-to-disk performance of individual OSTs, and
289 ranks then for comparison.
292 This script will collect IO stats on a defined set of nodes.
295 A script to run the IOR benchmark. The latest version can be downloaded from
296 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
299 This survey tests the local metadata performance using the echo_client to drive
300 the MDD layer to perform operations. It is run with multiple threads (to
301 simulate MDT service threads) locally on the MDS node, and does not need Lustre
302 clients in order to run
305 %if 0%{?suse_version}
309 %setup -qn lustre-%{version}
310 ln lustre/ChangeLog ChangeLog-lustre
311 ln lnet/ChangeLog ChangeLog-lnet
315 # Set an explicit path to our Linux tree, if we can.
316 cd $RPM_BUILD_DIR/lustre-%{version}
317 # override %optflags so that the vendor's overzealous flags don't create
319 %define optflags -g -O2 -Werror
321 CONFIGURE_ARGS="%{?configure_args}"
322 if [ -n "$CONFIGURE_ARGS" ]; then
323 # make sure %%kdir and %%kobjdir are not in the configure arguments
324 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
325 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
326 # remove --with-kmp-moddir from configure arguments,
327 # it will be set --with-kmp-moddir=%%kmoddir
328 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
331 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
332 # string in it which we don't want word splitted by the shell
333 # also remove (build|host|target) options because they will be specified
334 # inside $CONFIGURE_ARGS
335 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
337 %eval_configure $CONFIGURE_ARGS \
338 %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
339 %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
340 %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
341 %{!?with_lustre_iokit:--disable-iokit} \
342 %{!?with_ldiskfs:--disable-ldiskfs} \
343 %{!?with_servers:--disable-server} \
344 %{!?with_zfs:--without-zfs} \
345 %{!?with_lnet_dlc:--disable-dlc} \
346 %{!?with_manpages:--disable-manpages} \
347 --with-release=%{release} \
348 --with-linux=%{kdir} \
349 --with-linux-obj=%{kobjdir} \
350 --with-kmp-moddir=%{kmoddir}
352 make %{?_smp_mflags} -s %{?make_args}
355 make install DESTDIR=$RPM_BUILD_ROOT
359 %if %{with servers} && %{with lustre_utils}
360 # The .ha_v2 extension identifies the heartbeat resource agent as using
361 # legacy syntax. Install a compatibility symlink to avoid conflicts when
362 # newer-style agents are added.
363 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
364 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
365 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
368 %if %{_vendor}=="redhat"
369 # The following scripts are Red Hat specific
371 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
372 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
374 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
377 # Create the pristine source directory.
378 cd $RPM_BUILD_DIR/lustre-%{version}
379 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
381 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
382 make distdir distdir=lustre-source/lustre-%{version}
383 chmod -R go-w lustre-source/lustre-%{version}
384 # fc18 needs 'x' permission for library files
385 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
388 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
389 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
393 echo '%{_libdir}/libiam.a' >>lustre.files
396 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
397 echo '%{_libdir}/lustre/snmp' >>lustre.files
398 echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
401 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
402 -name \*.la -type f -exec rm -f {} \;
404 %if %{with lustre_tests}
405 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
406 echo '%{_bindir}/mcreate' >>lustre-tests.files
407 echo '%{_bindir}/munlink' >>lustre-tests.files
408 echo '%{_bindir}/req_layout' >>lustre-tests.files
409 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
410 echo '%{_sbindir}/wiretest' >>lustre-tests.files
411 %if %{with lustre_modules}
412 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
416 %if %{defined cross_path}
417 %if %{defined rpm_post_base}
418 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
419 if [ -f $POST_SCRIPT ]; then
420 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
421 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
422 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
424 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
425 %if %{with lustre_utils}
426 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
430 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
431 %if %{with lustre_utils}
432 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
435 %if %{with lustre_tests}
436 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
437 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
442 %if %{with lustre_modules}
443 # mark modules executable for find-debuginfo.sh
444 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
445 -name \*.ko -type f -exec chmod u+x {} \;
449 %files -f lustre.files
450 %defattr(-,root,root)
452 %exclude %{_sbindir}/wirecheck
453 %exclude %{_sbindir}/wiretest
455 %exclude %{_sbindir}/zfsobj2fid
457 %if %{with lustre_utils}
459 %{_libexecdir}/lustre/lc_common
460 %{_libexecdir}/lustre/haconfig
461 %{_bindir}/lustre_req_history
466 %{_bindir}/plot-llstat
469 %{_bindir}/lfs_migrate
470 %{?rootdir}/sbin/mount.lustre
471 %{_libdir}/libptlctl.a
472 %{_libdir}/libcfsutil.a
473 %{_libdir}/liblustreapi.a
474 %{_libdir}/liblustreapi.so
478 %{_includedir}/lustre
479 %{_includedir}/libcfs
482 %{_sysconfdir}/udev/rules.d/99-lustre.rules
483 %config(noreplace) %{_sysconfdir}/ldev.conf
484 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
486 %if %{with lustre_modules}
488 %defattr(-,root,root)
489 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
490 %if %{with lustre_tests}
491 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
494 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
495 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
498 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
500 %if %{defined rpm_post_base}
501 %attr(0555, root, root) %{rpm_post_base}-modules.sh
504 %doc ChangeLog-lustre
509 %defattr(-,root,root)
510 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
511 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
512 %if %{defined rpm_post_base}
513 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
515 %if %{with lustre_utils}
516 %files osd-ldiskfs-mount
517 %defattr(-,root,root)
518 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
519 %if %{defined rpm_post_base}
520 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
527 %defattr(-,root,root)
528 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
529 %{_sbindir}/zfsobj2fid
530 %if %{defined rpm_post_base}
531 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
533 %if %{with lustre_utils}
535 %defattr(-,root,root)
536 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
537 %if %{defined rpm_post_base}
538 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
542 %endif # with lustre_modules
545 %defattr(-,root,root)
546 %{_prefix}/src/lustre-%{version}
548 # uncomment these lines to enable deps packages
552 %if %{with lustre_tests}
553 %files tests -f lustre-tests.files
554 %defattr(-,root,root)
557 %if %{with lustre_iokit}
558 %files -n lustre-iokit
559 %defattr(-, root, root)
560 %{_bindir}/iokit-config
561 %{_bindir}/iokit-gather-stats
562 %{_bindir}/iokit-libecho
563 %{_bindir}/iokit-lstats
564 %{_bindir}/iokit-parse-ior
565 %{_bindir}/iokit-plot-obdfilter
566 %{_bindir}/iokit-plot-ost
567 %{_bindir}/iokit-plot-sgpdd
568 %{_bindir}/ior-survey
569 %{_bindir}/mds-survey
570 %{_bindir}/obdfilter-survey
571 %{_bindir}/ost-survey
572 %{_bindir}/sgpdd-survey
573 %doc lustre-iokit/ior-survey/README.ior-survey
574 %doc lustre-iokit/mds-survey/README.mds-survey
575 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
576 %doc lustre-iokit/ost-survey/README.ost-survey
577 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
578 %doc lustre-iokit/stats-collect/README.iokit-lstats
581 %if %{defined rpm_post_base}
583 if [ -x %{rpm_post_base}.sh ]; then
584 %{rpm_post_base}.sh %{cross_path} create
588 if [ -x %{rpm_post_base}.sh ]; then
589 %{rpm_post_base}.sh %{cross_path} remove
593 %if %{with lustre_modules}
595 %if %{defined rpm_post_base}
596 if [ -x %{rpm_post_base}-modules.sh ]; then
597 %{rpm_post_base}-modules.sh %{cross_path} create
600 if [ -f /boot/System.map-%{kversion} ]; then
601 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
603 depmod -ae %{kversion} || exit 0
606 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
607 # "weak modules" support
609 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
610 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
611 /usr/lib/module-init-tools/weak-modules --add-modules
614 if [ -x /sbin/weak-modules ]; then
615 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
616 /sbin/weak-modules --add-modules
619 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
620 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
621 # print a warning so that users are aware of this issue.
622 if sysctl kernel.unsupported >/dev/null 2>&1 &&
623 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
624 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
626 warning: the Lustre modules are not supported by Novell. To use Lustre
627 on this system, you should put
629 allow_unsupported_modules 1
631 into /etc/modprobe.d/unsupported_modules"
637 %if %{defined rpm_post_base}
638 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
639 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
642 if [ -f /boot/System.map-%{kversion} ]; then
643 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
645 depmod -ae %{kversion} || exit 0
648 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
649 # "weak modules" support
651 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
652 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
653 /usr/lib/module-init-tools/weak-modules --add-modules
656 if [ -x /sbin/weak-modules ]; then
657 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
658 /sbin/weak-modules --add-modules
661 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
662 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
663 # print a warning so that users are aware of this issue.
664 if sysctl kernel.unsupported >/dev/null 2>&1 &&
665 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
666 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
668 warning: the Lustre modules are not supported by Novell. To use Lustre
669 on this system, you should put
671 allow_unsupported_modules 1
673 into /etc/modprobe.d/unsupported_modules"
676 %if %{with lustre_utils} && %{defined rpm_post_base}
677 %post osd-ldiskfs-mount
678 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
679 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
686 %if %{defined rpm_post_base}
687 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
688 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
691 if [ -f /boot/System.map-%{kversion} ]; then
692 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
694 depmod -ae %{kversion} || exit 0
697 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
698 # "weak modules" support
700 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
701 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
702 /usr/lib/module-init-tools/weak-modules --add-modules
705 if [ -x /sbin/weak-modules ]; then
706 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
707 /sbin/weak-modules --add-modules
710 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
711 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
712 # print a warning so that users are aware of this issue.
713 if sysctl kernel.unsupported >/dev/null 2>&1 &&
714 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
715 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
717 warning: the Lustre modules are not supported by Novell. To use Lustre
718 on this system, you should put
720 allow_unsupported_modules 1
722 into /etc/modprobe.d/unsupported_modules"
725 %if %{with lustre_utils} && %{defined rpm_post_base}
727 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
728 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
734 %if %{defined rpm_post_base}
735 if [ -x %{rpm_post_base}-modules.sh ]; then
736 %{rpm_post_base}-modules.sh %{cross_path} remove
739 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
740 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
745 %if %{defined rpm_post_base}
746 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
747 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
750 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
751 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
753 %if %{with lustre_utils} && %{defined rpm_post_base}
754 %preun osd-ldiskfs-mount
755 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
756 %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
763 %if %{defined rpm_post_base}
764 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
765 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
768 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
769 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
771 %if %{with lustre_utils} && %{defined rpm_post_base}
773 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
774 %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
779 %if %{undefined cross_path}
781 if [ -f /boot/System.map-%{kversion} ]; then
782 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
784 depmod -ae %{kversion} || exit 0
787 # "weak modules" support
789 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
790 cat /var/run/%{name}-modules |
791 /usr/lib/module-init-tools/weak-modules --remove-modules
794 if [ -x /sbin/weak-modules ]; then
795 cat /var/run/%{name}-modules |
796 /sbin/weak-modules --remove-modules
798 rm /var/run/%{name}-modules
802 if [ -f /boot/System.map-%{kversion} ]; then
803 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
805 depmod -ae %{kversion} || exit 0
808 # "weak modules" support
810 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
811 cat /var/run/%{name}-osd-ldiskfs |
812 /usr/lib/module-init-tools/weak-modules --remove-modules
815 if [ -x /sbin/weak-modules ]; then
816 cat /var/run/%{name}-osd-ldiskfs |
817 /sbin/weak-modules --remove-modules
819 rm /var/run/%{name}-osd-ldiskfs
824 if [ -f /boot/System.map-%{kversion} ]; then
825 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
827 depmod -ae %{kversion} || exit 0
830 # "weak modules" support
832 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
833 cat /var/run/%{name}-osd-zfs |
834 /usr/lib/module-init-tools/weak-modules --remove-modules
837 if [ -x /sbin/weak-modules ]; then
838 cat /var/run/%{name}-osd-zfs |
839 /sbin/weak-modules --remove-modules
841 rm /var/run/%{name}-osd-zfs
844 %endif # with lustre_modules
846 %if %{with lustre_tests}
847 %if %{defined rpm_post_base}
849 if [ -x %{rpm_post_base}-tests.sh ]; then
850 %{rpm_post_base}-tests.sh %{cross_path} create
854 if [ -x %{rpm_post_base}-tests.sh ]; then
855 %{rpm_post_base}-tests.sh %{cross_path} remove
858 %if %{with lustre_modules}
860 if [ -f /boot/System.map-%{kversion} ]; then
861 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
863 depmod -ae %{kversion} || exit 0
867 if [ -f /boot/System.map-%{kversion} ]; then
868 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
870 depmod -ae %{kversion} || exit 0
877 rm -rf $RPM_BUILD_ROOT