Whamcloud - gitweb
LU-6030 osd-ldiskfs: improve mount option handling
[fs/lustre-release.git] / lustre.spec.in
1 # lustre.spec
2
3 # Declare rpmbuild --with/--without parameters
4 %bcond_without servers
5 %bcond_without ldiskfs
6 %bcond_with zfs
7 %bcond_without lustre_tests
8 %bcond_without lustre_utils
9 %bcond_without lustre_iokit
10 %bcond_without lustre_modules
11 %bcond_with lnet_dlc
12
13 %if %{without servers}
14     # --without servers overrides --with {ldiskfs|zfs}
15     # so undefine the internal variables set by bcond_*
16     %undefine with_ldiskfs
17     %undefine with_zfs
18 %endif
19
20 %{!?version: %global version @VERSION@}
21 %{!?kver:    %global kver    %(uname -r)}
22 %{!?kdir:    %global kdir    /lib/modules/%{kver}/source}
23 %{!?kobjdir: %global kobjdir %(if [ "%{kdir}" = "/lib/modules/%{kver}/source" ]; then echo "/lib/modules/%{kver}/build"; else echo "%{kdir}"; fi)}
24
25 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
26 %{!?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)}
27
28 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
29
30 %if 0%{?build_src_rpm}
31     %{!?myrelease: %global myrelease 1}
32 %else
33     %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
34     %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
35 %endif
36
37 # always append the buildid, even when the caller defines %release
38 %define fullrelease %{myrelease}%{buildid}
39
40 # in order to get kernel symset and/or kernel module dependencies into
41 # the RPM, in order to support weak-modules, the internal dependency gen-
42 # erator needs to be disabled
43 # this is done with (reduce the double % down to a single %):
44 #
45 # %%global _use_internal_dependency_generator 0
46 #
47 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
48 # defining it here (until Suse changes their mind)
49 #
50 # on RHEL5, however, we do need to explicitly disable the internal dep-
51 # endency generator and allow the external one be used
52 # but since RedHat's kABI is only a subset of the total kernel ABI, it
53 # doesn't include all of the symbols we (or OFED for that matter) need
54 # until RedHat includes all of the symbols we need in their symsets we
55 # cannot support weak-modules
56 # we did e-mail the maintainer of all of this stuff @redhat but got no
57 # response from them
58 #%%global _use_internal_dependency_generator 0
59
60 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
61 # of %kversion
62 %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$//')
63
64 # Set the package name prefix
65 %if %{undefined lustre_name}
66     %if %{with servers}
67         %global lustre_name lustre
68     %else
69         %global lustre_name lustre-client
70     %endif
71 %endif
72
73 %if %{undefined kmoddir}
74     %if %{defined kernel_module_package_moddir}
75         %global kmoddir %{kernel_module_package_moddir}
76     %else
77         %if %{defined suse_kernel_module_package}
78             %global kmoddir updates
79         %else
80             %global kmoddir extra
81         %endif
82     %endif
83 %endif
84
85 %if %{defined cross_path} && %{defined post_script}
86 %define rpm_post_base %(dirname %{cross_path})/%{lustre_name}
87 %endif
88
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}
95 %endif
96
97 Summary: Lustre File System
98 Name: %{lustre_name}
99 Version: %{version}
100 Release: %{fullrelease}
101 License: GPL
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
110 %if %{with servers}
111 Requires: lustre-osd
112 Requires: lustre-osd-mount
113 %endif
114 %if %{defined cross_requires}
115 Requires: %{cross_requires}
116 AutoReqProv: no
117 %else
118 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
119 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
120 #suse don't support selinux
121 BuildRequires: libselinux-devel
122 Requires: libselinux
123 %endif
124 %endif
125
126 %description
127 Userspace tools and files for the Lustre file system.
128
129 %if %{with lustre_modules}
130 %package modules
131 Summary: Kernel Lustre modules for Linux %{kversion}
132 %if %{defined cross_requires}
133 Requires: %{cross_requires}
134 AutoReqProv: no
135 %else
136 # for SLES11, we need nothing here
137 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
138 # for RHEL we need to require the specific kernel still since weak-modules
139 # support on RH is, well, weak, to be punny about it
140 Requires: kernel = %{krequires}
141 %if %{with lnet_dlc}
142 Requires: libyaml
143 BuildRequires: libyaml-devel
144 %endif
145 %endif
146 %endif
147 Group: Development/Kernel
148
149 %description modules
150 Lustre file system, server and network drivers for Linux %{kversion}.
151
152 %if %{with ldiskfs}
153 %package osd-ldiskfs
154 Summary: osd-ldiskfs contains both ldiskfs and its osd interface in Lustre.
155 Requires: lustre-modules = %{version}
156 Requires: module-init-tools >= 3.9
157 Requires: ldiskfsprogs >= 1.42.7.wc1
158 Requires: lustre-osd-ldiskfs-mount
159 Provides: lustre-osd
160 Obsoletes: lustre-ldiskfs
161 Group: Development/Kernel
162
163 %description osd-ldiskfs
164 The Lustre Object Storage Device (OSD) API is the interface to access and
165 modify data that is supposed to be stored persistently. This API is the interface
166 to code that bridges individual file systems. This specific package provides an
167 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
168 backing store of a Lustre server.
169
170 %if %{with lustre_utils}
171 %package osd-ldiskfs-mount
172 Summary: osd-ldiskfs-mount contains mount's ldiskfs specific dso.
173 Provides: lustre-osd-mount
174 Group: Development/Kernel
175
176 %description osd-ldiskfs-mount
177 LDISKFS hooks for mount/mkfs into a dynamic library.
178
179 %endif
180 %endif
181
182 %if %{with zfs}
183 %package osd-zfs
184 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
185 Requires: lustre-modules = %{version}, zfs-kmod
186 Requires: lustre-osd-zfs-mount
187 Provides: lustre-osd
188 Group: Development/Kernel
189
190 %description osd-zfs
191 The Lustre Object Storage Device (OSD) API is the interface to access and
192 modify data that is supposed to be stored persistently. This API is the interface
193 to code that bridges individual file systems. This specific package provides an
194 implementation of the OSD API for using the ZFS filesystem as the underlying
195 backing store of a Lustre server.
196
197 %if %{with lustre_utils}
198 %package osd-zfs-mount
199 Summary: osd-zfs-mount contains mount's ldiskfs specific dso.
200 Provides: lustre-osd-mount
201 Group: Development/Kernel
202
203 %description osd-zfs-mount
204 ZFS hooks for mount/mkfs into a dynamic library.
205
206 %endif
207 %endif
208 %endif # with lustre_modules
209
210 %package source
211 Summary: Object-Based Disk storage driver source
212 Group: Development/Kernel
213
214 %description source
215 Lustre sources for further development
216
217 # Since the RPMs we ship are to be used on both SLES and RHEL, we
218 # can't include any dependency information (since the package names
219 # are different on the two platforms).
220 #
221 # Instead, we can build these empty meta-packages that only include
222 # dependency information.  These let people get the correct
223 # dependencies for their platform and lets them use tools like yum and
224 # red carpet to install the correct files.
225 #
226 # Unfortunately I have not seen this come up on the lists much, so I
227 # have disabled them (by commenting out their empty files section
228 # below) until it's clear that they resolve more confusion than they
229 # add.
230
231 %package deps-sles
232 Summary: Lustre dependencies meta-package for SLES
233 Group: Utilities/System
234 Provides: lustre-deps = %{version}
235 Requires: %{name} = %{version}, sles-release
236 Conflicts: %{name}-deps-rhel
237
238 %description deps-sles
239 This package has RPM dependencies appropriate for SLES systems.
240
241 %package deps-rhel
242 Summary: Lustre dependencies meta-package for RHEL
243 Group: Utilities/System
244 Provides: lustre-deps = %{version}
245 Requires: %{name} = %{version}, redhat-release
246 Conflicts: %{name}-deps-sles
247
248 %description deps-rhel
249 This package has RPM dependencies appropriate for RHEL, RHL, and FC
250 systems.
251
252 %package tests
253 Summary: Lustre testing framework
254 Group: Development/Kernel
255 Provides: %{name}-tests = %{version}
256 Requires: %{name} = %{version}, %{name}-modules = %{version}, lustre-iokit
257 Requires: attr, rsync, perl, lsof, /usr/bin/getconf
258
259 %description tests
260 This package contains a set of test binaries and scripts that are intended
261 to be used by the Lustre testing framework.
262
263 %if %{with lustre_iokit}
264 %package -n lustre-iokit
265 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
266 Group: Applications/System
267 Requires: python > 2.2, sg3_utils
268
269 %description -n lustre-iokit
270 This package includes five tools:
271 sgpdd-survey:
272 A test of the 'bare metal' performance, bypassing as much of the kernel as we can. Uses the sgp_dd utility.
273
274 obdfilter-survey
275 This survey can be run in 3 modes to test disk I/O including the filesystem,
276 network I/O, and disk I/O via the network.  The script does sequential I/O
277 with varying numbers of threads and objects (files) by using lctl::test_brw
278 to drive the echo_client connected to local or remote obdfilter instances,
279 or remote obdecho instances.
280
281 ost-survey
282 This survey tests the client-to-disk performance of individual OSTs, and
283 ranks then for comparison.
284
285 stats-collect
286 This script will collect IO stats on a defined set of nodes.
287
288 ior-survey:
289 A script to run the IOR benchmark. The latest version can be downloaded from
290 http://www.llnl.gov/asci/purple/benchmarks/limited/ior/
291
292 mds-survey:
293 This survey tests the local metadata performance using the echo_client to drive
294 the MDD layer to perform operations. It is run with multiple threads (to
295 simulate MDT service threads) locally on the MDS node, and does not need Lustre
296 clients in order to run
297 %endif
298
299 %if 0%{?suse_version}
300 %debug_package
301 %endif
302 %prep
303 %setup -qn lustre-%{version}
304 ln lustre/ChangeLog ChangeLog-lustre
305 ln lnet/ChangeLog ChangeLog-lnet
306
307 %build
308
309 # Set an explicit path to our Linux tree, if we can.
310 cd $RPM_BUILD_DIR/lustre-%{version}
311 # override %optflags so that the vendor's overzealous flags don't create
312 # build failures
313 %define optflags -g -O2 -Werror
314
315 CONFIGURE_ARGS="%{?configure_args}"
316 if [ -n "$CONFIGURE_ARGS" ]; then
317         # make sure %%kdir and %%kobjdir are not in the configure arguments
318         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
319         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
320         # remove --with-kmp-moddir from configure arguments,
321         # it will be set --with-kmp-moddir=%%kmoddir
322         CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-kmp-moddir=[^ ][^ ]* \?//')
323 fi
324
325 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
326 # string in it which we don't want word splitted by the shell
327 # also remove (build|host|target) options because they will be specified
328 # inside $CONFIGURE_ARGS
329 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
330
331 %eval_configure $CONFIGURE_ARGS \
332         %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \
333         %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \
334         %{?with_lustre_modules:--enable-modules}%{!?with_lustre_modules:--disable-modules} \
335         %{!?with_lustre_iokit:--disable-iokit} \
336         %{!?with_ldiskfs:--disable-ldiskfs} \
337         %{!?with_servers:--disable-server} \
338         %{!?with_zfs:--without-zfs} \
339         %{!?with_lnet_dlc:--disable-dlc} \
340         --with-release=%{release} \
341         --with-linux=%{kdir} \
342         --with-linux-obj=%{kobjdir} \
343         --with-kmp-moddir=%{kmoddir}
344
345 make %{?_smp_mflags} -s %{?make_args}
346
347 %install
348 make install DESTDIR=$RPM_BUILD_ROOT
349
350 :> lustre.files
351
352 %if %{with servers} && %{with lustre_utils}
353 # The .ha_v2 extension identifies the heartbeat resource agent as using
354 # legacy syntax. Install a compatibility symlink to avoid conflicts when
355 # newer-style agents are added.
356 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
357 echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
358 echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
359 %endif
360
361 %if %{_vendor}=="redhat"
362 # The following scripts are Red Hat specific
363 %if %{with servers}
364 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
365 echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
366 %endif
367 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
368 %endif
369
370 # Create the pristine source directory.
371 cd $RPM_BUILD_DIR/lustre-%{version}
372 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
373 rm -f lustre-source
374 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
375 make distdir distdir=lustre-source/lustre-%{version}
376 chmod -R go-w lustre-source/lustre-%{version}
377 # fc18 needs 'x' permission for library files
378 find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \;
379
380 %if %{with lnet_dlc}
381 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files
382 echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files
383 %endif
384
385 %if %{with ldiskfs}
386 echo '%{_libdir}/libiam.a' >>lustre.files
387 %endif
388
389 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
390         echo '%{_libdir}/lustre/snmp' >>lustre.files
391         echo '%{_datadir}/lustre/snmp/mibs' >>lustre.files
392 fi
393
394 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ \
395     -name \*.la -type f -exec rm -f {} \;
396
397 %if %{with lustre_tests}
398 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
399 echo '%{_bindir}/mcreate' >>lustre-tests.files
400 echo '%{_bindir}/munlink' >>lustre-tests.files
401 echo '%{_bindir}/req_layout' >>lustre-tests.files
402 echo '%{_sbindir}/wirecheck' >>lustre-tests.files
403 echo '%{_sbindir}/wiretest' >>lustre-tests.files
404 %if %{with lustre_modules}
405 echo '%{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko' >>lustre-tests.files
406 %endif
407 %endif
408
409 %if %{defined cross_path}
410 %if %{defined rpm_post_base}
411 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
412 if [ -f $POST_SCRIPT ]; then
413         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
414         echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
415         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
416 %if %{with ldiskfs}
417         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
418 %if %{with lustre_utils}
419         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-ldiskfs.sh
420 %endif
421 %endif
422 %if %{with zfs}
423         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
424 %if %{with lustre_utils}
425         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-mount-osd-zfs.sh
426 %endif
427 %endif
428 %if %{with lustre_tests}
429         cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
430         echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
431 %endif
432 fi
433 %endif
434 %else
435 %if %{with lustre_modules}
436 # mark modules executable for find-debuginfo.sh
437 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} \
438     -name \*.ko -type f -exec chmod u+x {} \;
439 %endif
440 %endif
441
442 %files -f lustre.files
443 %defattr(-,root,root)
444 %{_sbindir}/*
445 %if %{with lustre_utils}
446 %if %{with servers}
447 %{_libexecdir}/lustre/lc_common
448 %{_libexecdir}/lustre/haconfig
449 %{_bindir}/lustre_req_history
450 %endif
451
452 %{_bindir}/llobdstat
453 %{_bindir}/llstat
454 %{_bindir}/plot-llstat
455
456 %{_bindir}/lfs
457 %{_bindir}/lfs_migrate
458 %{?rootdir}/sbin/mount.lustre
459 %{_libdir}/libptlctl.a
460 %{_libdir}/libcfsutil.a
461 %{_libdir}/liblustreapi.a
462 %{_libdir}/liblustreapi.so
463 %{_mandir}/man?/*
464 %{_includedir}/lustre
465 %{_includedir}/libcfs
466 %endif
467 %{_datadir}/lustre
468 %{_sysconfdir}/udev/rules.d/99-lustre.rules
469 %config(noreplace) %{_sysconfdir}/ldev.conf
470
471 %if %{with lustre_modules}
472 %files modules
473 %defattr(-,root,root)
474 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/*
475 %if %{with lustre_tests}
476 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/llog_test.ko
477 %endif
478 %if %{with ldiskfs}
479 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
480 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
481 %endif
482 %if %{with zfs}
483 %exclude %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
484 %endif
485 %if %{defined rpm_post_base}
486 %attr(0555, root, root) %{rpm_post_base}-modules.sh
487 %endif
488 %doc COPYING
489 %doc ChangeLog-lustre
490 %doc ChangeLog-lnet
491
492 %if %{with ldiskfs}
493 %files osd-ldiskfs
494 %defattr(-,root,root)
495 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/ldiskfs.ko
496 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_ldiskfs.ko
497 %if %{defined rpm_post_base}
498 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
499 %endif
500 %if %{with lustre_utils}
501 %files osd-ldiskfs-mount
502 %defattr(-,root,root)
503 %{_libdir}/@PACKAGE@/mount_osd_ldiskfs.so
504 %if %{defined rpm_post_base}
505 %attr(0555, root, root) %{rpm_post_base}-mount-osd-ldiskfs.sh
506 %endif
507 %endif
508 %endif
509
510 %if %{with zfs}
511 %files osd-zfs
512 %defattr(-,root,root)
513 %{?rootdir}/lib/modules/%{kversion}/%{kmoddir}/kernel/fs/@PACKAGE@/osd_zfs.ko
514 %if %{defined rpm_post_base}
515 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
516 %endif
517 %if %{with lustre_utils}
518 %files osd-zfs-mount
519 %defattr(-,root,root)
520 %{_libdir}/@PACKAGE@/mount_osd_zfs.so
521 %if %{defined rpm_post_base}
522 %attr(0555, root, root) %{rpm_post_base}-mount-osd-zfs.sh
523 %endif
524 %endif
525 %endif
526 %endif # with lustre_modules
527
528 %files source
529 %defattr(-,root,root)
530 %{_prefix}/src/lustre-%{version}
531
532 # uncomment these lines to enable deps packages
533 # %files deps-sles
534 # %files deps-rhel
535
536 %if %{with lustre_tests}
537 %files tests -f lustre-tests.files
538 %defattr(-,root,root)
539 %endif
540
541 %if %{with lustre_iokit}
542 %files -n lustre-iokit
543 %defattr(-, root, root)
544 %{_bindir}/iokit-config
545 %{_bindir}/iokit-gather-stats
546 %{_bindir}/iokit-libecho
547 %{_bindir}/iokit-lstats
548 %{_bindir}/iokit-parse-ior
549 %{_bindir}/iokit-plot-obdfilter
550 %{_bindir}/iokit-plot-ost
551 %{_bindir}/iokit-plot-sgpdd
552 %{_bindir}/ior-survey
553 %{_bindir}/mds-survey
554 %{_bindir}/obdfilter-survey
555 %{_bindir}/ost-survey
556 %{_bindir}/sgpdd-survey
557 %doc lustre-iokit/ior-survey/README.ior-survey
558 %doc lustre-iokit/mds-survey/README.mds-survey
559 %doc lustre-iokit/obdfilter-survey/README.obdfilter-survey
560 %doc lustre-iokit/ost-survey/README.ost-survey
561 %doc lustre-iokit/sgpdd-survey/README.sgpdd-survey
562 %doc lustre-iokit/stats-collect/README.iokit-lstats
563 %endif
564
565 %if %{defined rpm_post_base}
566 %post
567 if [ -x %{rpm_post_base}.sh ]; then
568         %{rpm_post_base}.sh %{cross_path} create
569 fi
570
571 %preun
572 if [ -x %{rpm_post_base}.sh ]; then
573         %{rpm_post_base}.sh %{cross_path} remove
574 fi
575 %endif
576
577 %if %{with lustre_modules}
578 %post modules
579 %if %{defined rpm_post_base}
580 if [ -x %{rpm_post_base}-modules.sh ]; then
581         %{rpm_post_base}-modules.sh %{cross_path} create
582 fi
583 %else
584 if [ -f /boot/System.map-%{kversion} ]; then
585         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
586 else
587         depmod -ae %{kversion} || exit 0
588 fi
589
590 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
591 # "weak modules" support
592 # Suse
593 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
594     rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
595         /usr/lib/module-init-tools/weak-modules --add-modules
596 fi
597 # RedHat
598 if [ -x /sbin/weak-modules ]; then
599     rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
600         /sbin/weak-modules --add-modules
601 fi
602
603 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
604 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
605 # print a warning so that users are aware of this issue.
606 if sysctl kernel.unsupported >/dev/null 2>&1 &&
607    [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
608     ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
609      echo "
610      warning: the Lustre modules are not supported by Novell. To use Lustre
611               on this system, you should put
612
613      allow_unsupported_modules 1
614
615      into /etc/modprobe.d/unsupported_modules"
616 fi
617 %endif
618
619 %if %{with ldiskfs}
620 %post osd-ldiskfs
621 %if %{defined rpm_post_base}
622 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
623         %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
624 fi
625 %else
626 if [ -f /boot/System.map-%{kversion} ]; then
627        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
628 else
629        depmod -ae %{kversion} || exit 0
630 fi
631
632 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
633 # "weak modules" support
634 # Suse
635 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
636     rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
637         /usr/lib/module-init-tools/weak-modules --add-modules
638 fi
639 # RedHat
640 if [ -x /sbin/weak-modules ]; then
641     rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
642         /sbin/weak-modules --add-modules
643 fi
644
645 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
646 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
647 # print a warning so that users are aware of this issue.
648 if sysctl kernel.unsupported >/dev/null 2>&1 &&
649    [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
650     ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
651      echo "
652      warning: the Lustre modules are not supported by Novell. To use Lustre
653               on this system, you should put
654
655      allow_unsupported_modules 1
656
657      into /etc/modprobe.d/unsupported_modules"
658 fi
659 %endif
660 %if %{with lustre_utils} && %{defined rpm_post_base}
661 %post osd-ldiskfs-mount
662 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
663         %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} create
664 fi
665 %endif
666 %endif
667
668 %if %{with zfs}
669 %post osd-zfs
670 %if %{defined rpm_post_base}
671 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
672         %{rpm_post_base}-osd-zfs.sh %{cross_path} create
673 fi
674 %else
675 if [ -f /boot/System.map-%{kversion} ]; then
676        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
677 else
678        depmod -ae %{kversion} || exit 0
679 fi
680
681 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
682 # "weak modules" support
683 # Suse
684 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
685     rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
686         /usr/lib/module-init-tools/weak-modules --add-modules
687 fi
688 # RedHat
689 if [ -x /sbin/weak-modules ]; then
690     rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
691         /sbin/weak-modules --add-modules
692 fi
693
694 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
695 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
696 # print a warning so that users are aware of this issue.
697 if sysctl kernel.unsupported >/dev/null 2>&1 &&
698    [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
699     ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
700      echo "
701      warning: the Lustre modules are not supported by Novell. To use Lustre
702               on this system, you should put
703
704      allow_unsupported_modules 1
705
706      into /etc/modprobe.d/unsupported_modules"
707 fi
708 %endif
709 %if %{with lustre_utils} && %{defined rpm_post_base}
710 %post osd-zfs-mount
711 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
712         %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} create
713 fi
714 %endif
715 %endif
716
717 %preun modules
718 %if %{defined rpm_post_base}
719 if [ -x %{rpm_post_base}-modules.sh ]; then
720         %{rpm_post_base}-modules.sh %{cross_path} remove
721 fi
722 %else
723 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
724 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
725 %endif
726
727 %if %{with ldiskfs}
728 %preun osd-ldiskfs
729 %if %{defined rpm_post_base}
730 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
731         %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
732 fi
733 %else
734 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
735 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
736 %endif
737 %if %{with lustre_utils} && %{defined rpm_post_base}
738 %preun osd-ldiskfs-mount
739 if [ -x %{rpm_post_base}-mount-osd-ldiskfs.sh ]; then
740         %{rpm_post_base}-mount-osd-ldiskfs.sh %{cross_path} remove
741 fi
742 %endif
743 %endif
744
745 %if %{with zfs}
746 %preun osd-zfs
747 %if %{defined rpm_post_base}
748 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
749         %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
750 fi
751 %else
752 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
753 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
754 %endif
755 %if %{with lustre_utils} && %{defined rpm_post_base}
756 %preun osd-zfs-mount
757 if [ -x %{rpm_post_base}-mount-osd-zfs.sh ]; then
758         %{rpm_post_base}-mount-osd-zfs.sh %{cross_path} remove
759 fi
760 %endif
761 %endif
762
763 %if %{undefined cross_path}
764 %postun modules
765 if [ -f /boot/System.map-%{kversion} ]; then
766         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
767 else
768         depmod -ae %{kversion} || exit 0
769 fi
770
771 # "weak modules" support
772 # Suse
773 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
774     cat /var/run/%{name}-modules |
775         /usr/lib/module-init-tools/weak-modules --remove-modules
776 fi
777 # RedHat
778 if [ -x /sbin/weak-modules ]; then
779     cat /var/run/%{name}-modules |
780         /sbin/weak-modules --remove-modules
781 fi
782 rm /var/run/%{name}-modules
783
784 %if %{with ldiskfs}
785 %postun osd-ldiskfs
786 if [ -f /boot/System.map-%{kversion} ]; then
787        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
788 else
789        depmod -ae %{kversion} || exit 0
790 fi
791
792 # "weak modules" support
793 # Suse
794 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
795     cat /var/run/%{name}-osd-ldiskfs |
796         /usr/lib/module-init-tools/weak-modules --remove-modules
797 fi
798 # RedHat
799 if [ -x /sbin/weak-modules ]; then
800     cat /var/run/%{name}-osd-ldiskfs |
801         /sbin/weak-modules --remove-modules
802 fi
803 rm /var/run/%{name}-osd-ldiskfs
804 %endif
805
806 %if %{with zfs}
807 %postun osd-zfs
808 if [ -f /boot/System.map-%{kversion} ]; then
809        depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
810 else
811        depmod -ae %{kversion} || exit 0
812 fi
813
814 # "weak modules" support
815 # Suse
816 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
817     cat /var/run/%{name}-osd-zfs |
818         /usr/lib/module-init-tools/weak-modules --remove-modules
819 fi
820 # RedHat
821 if [ -x /sbin/weak-modules ]; then
822     cat /var/run/%{name}-osd-zfs |
823         /sbin/weak-modules --remove-modules
824 fi
825 rm /var/run/%{name}-osd-zfs
826 %endif
827 %endif
828 %endif # with lustre_modules
829
830 %if %{with lustre_tests}
831 %if %{defined rpm_post_base}
832 %post tests
833 if [ -x %{rpm_post_base}-tests.sh ]; then
834         %{rpm_post_base}-tests.sh %{cross_path} create
835 fi
836
837 %preun tests
838 if [ -x %{rpm_post_base}-tests.sh ]; then
839         %{rpm_post_base}-tests.sh %{cross_path} remove
840 fi
841 %else
842 %if %{with lustre_modules}
843 %post tests
844 if [ -f /boot/System.map-%{kversion} ]; then
845         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
846 else
847         depmod -ae %{kversion} || exit 0
848 fi
849
850 %postun tests
851 if [ -f /boot/System.map-%{kversion} ]; then
852         depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
853 else
854         depmod -ae %{kversion} || exit 0
855 fi
856 %endif
857 %endif
858 %endif
859
860 %clean
861 rm -rf $RPM_BUILD_ROOT