2 %{!?version: %global version @VERSION@}
3 %{!?kver: %global kver ""}
4 %{!?kdir: %global kdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; echo "/lib/modules/$kversion/source"; fi)}
6 %{!?kobjdir: %global kobjdir %(dir=$(echo "%configure_args" | sed -ne 's/.*--with-linux-obj=\\([^ ][^ ]*\\).*$/\\1/p'); if [ -n "$dir" ]; then echo "$dir"; else if [ -n "%kver" ]; then kversion="%kver"; else kversion="$(uname -r)"; fi; if [ "%kdir" = "/lib/modules/$kversion/source" ]; then echo "/lib/modules/$kversion/build"; else echo "%kdir"; fi; fi)}
8 # as an alternative to this implementation we could simply "make -C $kdir kernelversion"
9 %{!?kversion: %global kversion %(if test -s %kobjdir/include/generated/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/generated/utsrelease.h ; elif test -s %kobjdir/include/linux/utsrelease.h ; then LINUXRELEASEHEADER=%kobjdir/include/linux/utsrelease.h ; else LINUXRELEASEHEADER=%kobjdir/include/linux/version.h; fi; sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' $LINUXRELEASEHEADER)}
11 %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"}
13 %define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi)
15 %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')}
17 # always append the buildid, even when the caller defines %release
18 %define fullrelease %{myrelease}%{buildid}
20 %{!?lustre_name: %global lustre_name lustre}
21 %{!?build_lustre_tests: %global build_lustre_tests 1}
23 %{!?build_lustre_osd_ldiskfs: %global build_lustre_osd_ldiskfs 0}
24 %{!?build_lustre_osd_zfs: %global build_lustre_osd_zfs 0}
26 # in order to get kernel symset and/or kernel module dependencies into
27 # the RPM, in order to support weak-modules, the internal dependency gen-
28 # erator needs to be disabled
29 # this is done with (reduce the double % down to a single %):
31 # %%global _use_internal_dependency_generator 0
33 # on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also
34 # defining it here (until Suse changes their mind)
36 # on RHEL5, however, we do need to explicitly disable the internal dep-
37 # endency generator and allow the external one be used
38 # but since RedHat's kABI is only a subset of the total kernel ABI, it
39 # doesn't include all of the symbols we (or OFED for that matter) need
40 # until RedHat includes all of the symbols we need in their symsets we
41 # cannot support weak-modules
42 # we did e-mail the maintainer of all of this stuff @redhat but got no
44 #%%global _use_internal_dependency_generator 0
46 %define is_client %(bash -c "if [[ %{lustre_name} = *-client* ]]; then echo -n '1'; else echo -n '0'; fi")
47 # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
49 %define krequires %(bash -c "echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/-ppc64$//' -e 's/-default$//'")
51 %define sles10 %(bash -c "if [ "%sles_version" = "10" ]; then echo -n '1'; else echo -n '0'; fi")
54 %define flavor %(bash -c "echo %{kversion} | sed -e 's/^.*-//'")
58 %define build_lustre_osd_ldiskfs 0
59 %define build_lustre_osd_zfs 0
62 %if %{defined cross_path} && %{defined post_script}
63 %define rpm_post_base %(echo $(dirname %{cross_path})/%{lustre_name})
66 Summary: Lustre File System
69 Release: %{fullrelease}
71 Group: Utilities/System
72 Source: lustre-%{version}.tar.gz
73 URL: http://wiki.whamcloud.com/
74 BuildRoot: %{_tmppath}/lustre-%{version}-root
75 Obsoletes: lustre-lite, lustre-lite-utils, lustre-ldap nfs-utils-lustre
76 Provides: lustre-lite = %{version}, lustre-lite-utils = %{version}
77 Requires: %{name}-modules = %{version}
81 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
84 Userspace tools and files for the Lustre file system.
87 Summary: Kernel Lustre modules for Linux %{kversion}
88 %if %{defined cross_requires}
89 Requires: %{cross_requires}
91 # for SLES11, we need nothing here
92 # for SLES10, we need (where %{flavor} is, i.e. smp):
94 Requires: kernel-%{flavor}
96 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
97 # for RHEL we need to require the specific kernel still since weak-modules
98 # support on RH is, well, weak, to be punny about it
99 Requires: kernel = %{krequires}
103 Group: Development/Kernel
106 Lustre file system, server and network drivers for Linux %{kversion}.
108 %if %{build_lustre_osd_ldiskfs}
110 Summary: osd-ldiskfs is the mandatory glue for LDISKFS support in Lustre.
111 Requires: lustre-modules = %{version}, lustre-ldiskfs >= 4.1.0
113 Group: Development/Kernel
115 %description osd-ldiskfs
116 The Lustre Object Storage Device (OSD) API is the interface to access and
117 modify data that is supposed to be stored persistently. This API is the interface
118 to code that bridges individual file systems. This specific package provides an
119 implementation of the OSD API for using the Ldiskfs filesystem as the underlying
120 backing store of a Lustre server.
123 %if %{build_lustre_osd_zfs}
125 Summary: osd-zfs is the mandatory glue for ZFS support in Lustre.
126 Requires: lustre-modules = %{version}, zfs-kmod
128 Group: Development/Kernel
131 The Lustre Object Storage Device (OSD) API is the interface to access and
132 modify data that is supposed to be stored persistently. This API is the interface
133 to code that bridges individual file systems. This specific package provides an
134 implementation of the OSD API for using the ZFS filesystem as the underlying
135 backing store of a Lustre server.
139 Summary: Object-Based Disk storage driver source
140 Group: Development/Kernel
143 Lustre sources for further development
145 # Since the RPMs we ship are to be used on both SLES and RHEL, we
146 # can't include any dependency information (since the package names
147 # are different on the two platforms).
149 # Instead, we can build these empty meta-packages that only include
150 # dependency information. These let people get the correct
151 # dependencies for their platform and lets them use tools like yum and
152 # red carpet to install the correct files.
154 # Unfortunately I have not seen this come up on the lists much, so I
155 # have disabled them (by commenting out their empty files section
156 # below) until it's clear that they resolve more confusion than they
160 Summary: Lustre dependencies meta-package for SLES
161 Group: Utilities/System
162 Provides: lustre-deps = %{version}
163 Requires: %{name} = %{version}, sles-release
164 Conflicts: %{name}-deps-rhel
166 %description deps-sles
167 This package has RPM dependencies appropriate for SLES systems.
170 Summary: Lustre dependencies meta-package for RHEL
171 Group: Utilities/System
172 Provides: lustre-deps = %{version}
173 Requires: %{name} = %{version}, redhat-release
174 Conflicts: %{name}-deps-sles
176 %description deps-rhel
177 This package has RPM dependencies appropriate for RHEL, RHL, and FC
181 Summary: Lustre testing framework
182 Group: Development/Kernel
183 Provides: %{name}-tests = %{version}
184 Requires: %{name} = %{version}, %{name}-modules = %{version}
187 This package contains a set of test binaries and scripts that are intended
188 to be used by the Lustre testing framework.
190 %if 0%{?suse_version}
194 %setup -qn lustre-%{version}
195 ln lustre/ChangeLog ChangeLog-lustre
196 ln lnet/ChangeLog ChangeLog-lnet
199 # if RPM_BUILD_NCPUS unset, set it
200 if [ -z "$RPM_BUILD_NCPUS" ] ; then
201 RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
202 if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
205 if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
210 rm -rf $RPM_BUILD_ROOT
212 # Set an explicit path to our Linux tree, if we can.
213 cd $RPM_BUILD_DIR/lustre-%{version}
214 # override %optflags so that the vendor's overzealous flags don't create
216 %define optflags -g -O2 -Werror
217 CONFIGURE_ARGS="%{?configure_args} --with-release=%release"
218 %if %{build_lustre_tests}
219 CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-tests --enable-liblustre-tests"
221 CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-tests --disable-liblustre-tests"
224 # if %%kdir was given, make sure it's not in the configure arguments
225 if [ -n "%kdir" ]; then
226 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux=[^ ][^ ]* \?//')
228 # ditto for %%kobjdir
229 if [ -n "%kobjdir" ]; then
230 CONFIGURE_ARGS=$(echo $CONFIGURE_ARGS | sed -e 's/"\?--with-linux-obj=[^ ][^ ]* \?//')
233 # we need to eval "configure" because $CONFIGURE_ARGS could have a quoted
234 # string in it which we don't want word splitted by the shell
235 # also remove (build|host|target) options because they will be specified
236 # inside $CONFIGURE_ARGS
237 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
240 %{?kdir: --with-linux=%kdir} %{?kobjdir: --with-linux-obj=%kobjdir} \
242 make -j $RPM_BUILD_NCPUS -s %{?make_args}
245 make install DESTDIR=$RPM_BUILD_ROOT
246 # hack to avoid changing the libsysio code for "make install"
247 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
248 # Remove ldiskfs module(s) - they are packaged by the ldiskfs .spec.
249 rm -rf $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre-ldiskfs
251 # hack to include the llog_test module in lustre-tests
252 llog_base=$RPM_BUILD_DIR/lustre-%{version}/lustre/obdclass/llog_test
253 if [ -e ${llog_base}.ko ]; then
254 cp ${llog_base}.ko $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
255 elif [ -e ${llog_base}.o ]; then
256 cp ${llog_base}.o $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre
259 # The .ha_v2 extension identifies the heartbeat resource agent as using
260 # legacy syntax. Install a compatibility symlink to avoid conflicts when
261 # newer-style agents are added.
262 ln -s Lustre.ha_v2 $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/Lustre
264 # Create the pristine source directory.
265 cd $RPM_BUILD_DIR/lustre-%{version}
266 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src
268 ln -s $RPM_BUILD_ROOT%{_prefix}/src lustre-source
269 make distdir distdir=lustre-source/lustre-%{version}
270 chmod -R go-w lustre-source/lustre-%{version}
271 # fc18 needs 'x' permission for library files
272 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
274 cat >lustre.files <<EOF
275 %attr(-, root, root) %{?rootdir}/sbin/mount.lustre
276 %attr(-, root, root) %{_sbindir}/*
277 %attr(-, root, root) %{_bindir}/*
278 %attr(-, root, root) %{_libdir}/libptlctl.a
279 %attr(-, root, root) %{_libdir}/liblustreapi.a
280 %attr(-, root, root) %{_libdir}/liblustreapi.so
281 %attr(-, root, root) %{_mandir}/man?/*
282 %attr(-, root, root) %{_datadir}/lustre
283 %attr(-, root, root) %{_includedir}/lustre
284 %attr(-, root, root) %{_includedir}/libcfs
285 %attr(-, root, root) %{_libexecdir}/lustre/lc_common
286 %attr(-, root, root) %{_sysconfdir}/udev/rules.d/99-lustre.rules
287 %attr(-, root, root) %{_sysconfdir}/init.d/lnet
288 %attr(-, root, root) %{_sysconfdir}/init.d/lustre
289 %attr(-, root, root) %config(noreplace) %{_sysconfdir}/ldev.conf
290 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
291 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
292 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
293 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
296 if [ -f $RPM_BUILD_ROOT%{_libdir}/libcfsutil.a ] ; then
297 echo '%attr(-, root, root) %{_libdir}/libcfsutil.a' >>lustre.files
300 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
301 echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
302 echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
305 if [ -f $RPM_BUILD_ROOT%{_libdir}/libiam.a ] ; then
306 echo '%attr(-, root, root) %{_libdir}/libiam.a' >>lustre.files
309 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
310 echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
311 echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
314 # Have universal lustre headers
315 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/lustre/lustre_idl.h ] ; then
316 echo '%attr(-, root, root) %{_includedir}/linux/lustre_user.h' >>lustre.files
318 echo '%attr(-, root, root) %{_includedir}/linux/lustre_idl.h' >>lustre.files
321 if [ -f $RPM_BUILD_DIR/lustre-%{version}/lustre/include/linux/lustre_types.h ] ; then
322 echo '%attr(-, root, root) %{_includedir}/linux/lustre_types.h' >>lustre.files
325 %if %{build_lustre_tests}
326 echo '%attr(-, root, root) %{_libdir}/lustre/tests/*' >lustre-tests.files
327 echo '%attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.*' >>lustre-tests.files
328 if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/liblustre/tests ] ; then
329 echo '%attr(-, root, root) %{_libdir}/lustre/liblustre/tests/*' >>lustre-tests.files
333 %if %{defined cross_path}
334 %if %{defined rpm_post_base}
335 POST_SCRIPT=$RPM_BUILD_DIR/lustre-%{version}/%{post_script}
336 if [ -f $POST_SCRIPT ]; then
337 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}.sh
338 echo '%attr(0555, root, root) %{rpm_post_base}.sh' >>lustre.files
339 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-modules.sh
340 %if %{build_lustre_osd_ldiskfs}
341 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-ldiskfs.sh
343 %if %{build_lustre_osd_zfs}
344 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-osd-zfs.sh
346 %if %{build_lustre_tests}
347 cp -f $POST_SCRIPT $RPM_BUILD_ROOT/%{rpm_post_base}-tests.sh
348 echo '%attr(0555, root, root) %{rpm_post_base}-tests.sh' >>lustre-tests.files
353 # mark modules executable for find-debuginfo.sh
354 find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/updates -name "*.ko" -type f | \
355 xargs --no-run-if-empty chmod u+x
358 %files -f lustre.files
361 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/*
362 %if %{build_lustre_tests}
363 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/llog_test.ko
365 %if %{build_lustre_osd_ldiskfs}
366 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
367 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
369 %if %{build_lustre_osd_zfs}
370 %exclude %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
372 %if %{defined rpm_post_base}
373 %attr(0555, root, root) %{rpm_post_base}-modules.sh
375 %attr(-, root, root) %doc COPYING
376 %attr(-, root, root) %doc ChangeLog-lustre
377 %attr(-, root, root) %doc ChangeLog-lnet
379 %if %{build_lustre_osd_ldiskfs}
381 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/fsfilt_ldiskfs.ko
382 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_ldiskfs.ko
383 %if %{defined rpm_post_base}
384 %attr(0555, root, root) %{rpm_post_base}-osd-ldiskfs.sh
388 %if %{build_lustre_osd_zfs}
390 %attr(-, root, root) %{?rootdir}/lib/modules/%{kversion}/updates/kernel/fs/lustre/osd_zfs.ko
391 %if %{defined rpm_post_base}
392 %attr(0555, root, root) %{rpm_post_base}-osd-zfs.sh
397 %attr(-, root, root) %{_prefix}/src/lustre-%{version}
399 # uncomment these lines to enable deps packages
403 %if %{build_lustre_tests}
404 %files tests -f lustre-tests.files
407 %if %{defined rpm_post_base}
409 if [ -x %{rpm_post_base}.sh ]; then
410 %{rpm_post_base}.sh %{cross_path} create
414 if [ -x %{rpm_post_base}.sh ]; then
415 %{rpm_post_base}.sh %{cross_path} remove
420 %if %{defined rpm_post_base}
421 if [ -x %{rpm_post_base}-modules.sh ]; then
422 %{rpm_post_base}-modules.sh %{cross_path} create
425 if [ -f /boot/System.map-%{kversion} ]; then
426 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
428 depmod -ae %{kversion} || exit 0
431 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
432 # "weak modules" support
434 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
435 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
436 /usr/lib/module-init-tools/weak-modules --add-modules
439 if [ -x /sbin/weak-modules ]; then
440 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' |
441 /sbin/weak-modules --add-modules
444 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
445 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
446 # print a warning so that users are aware of this issue.
447 if sysctl kernel.unsupported >/dev/null 2>&1 &&
448 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
449 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
451 warning: the Lustre modules are not supported by Novell. To use Lustre
452 on this system, you should put
454 allow_unsupported_modules 1
456 into /etc/modprobe.d/unsupported_modules"
460 %if %{build_lustre_osd_ldiskfs}
462 %if %{defined rpm_post_base}
463 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
464 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} create
467 if [ -f /boot/System.map-%{kversion} ]; then
468 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
470 depmod -ae %{kversion} || exit 0
473 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
474 # "weak modules" support
476 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
477 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
478 /usr/lib/module-init-tools/weak-modules --add-modules
481 if [ -x /sbin/weak-modules ]; then
482 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' |
483 /sbin/weak-modules --add-modules
486 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
487 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
488 # print a warning so that users are aware of this issue.
489 if sysctl kernel.unsupported >/dev/null 2>&1 &&
490 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
491 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
493 warning: the Lustre modules are not supported by Novell. To use Lustre
494 on this system, you should put
496 allow_unsupported_modules 1
498 into /etc/modprobe.d/unsupported_modules"
503 %if %{build_lustre_osd_zfs}
505 %if %{defined rpm_post_base}
506 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
507 %{rpm_post_base}-osd-zfs.sh %{cross_path} create
510 if [ -f /boot/System.map-%{kversion} ]; then
511 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
513 depmod -ae %{kversion} || exit 0
516 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
517 # "weak modules" support
519 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
520 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
521 /usr/lib/module-init-tools/weak-modules --add-modules
524 if [ -x /sbin/weak-modules ]; then
525 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
526 /sbin/weak-modules --add-modules
529 # If the kernel was built to reject unsupported modules (e.g. not a Lustre
530 # kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
531 # print a warning so that users are aware of this issue.
532 if sysctl kernel.unsupported >/dev/null 2>&1 &&
533 [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
534 ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
536 warning: the Lustre modules are not supported by Novell. To use Lustre
537 on this system, you should put
539 allow_unsupported_modules 1
541 into /etc/modprobe.d/unsupported_modules"
547 %if %{defined rpm_post_base}
548 if [ -x %{rpm_post_base}-modules.sh ]; then
549 %{rpm_post_base}-modules.sh %{cross_path} remove
552 MODULES_RPM_NAME=$(rpm -q %{name}-modules | grep "%{version}-%{release}")
553 rpm -ql $MODULES_RPM_NAME | grep '\.ko$' > /var/run/%{name}-modules || true
556 %if %{build_lustre_osd_ldiskfs}
558 %if %{defined rpm_post_base}
559 if [ -x %{rpm_post_base}-osd-ldiskfs.sh ]; then
560 %{rpm_post_base}-osd-ldiskfs.sh %{cross_path} remove
563 OSD_LDISKFS_RPM_NAME=$(rpm -q %{name}-osd-ldiskfs | grep "%{version}-%{release}")
564 rpm -ql $OSD_LDISKFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-ldiskfs || true
568 %if %{build_lustre_osd_zfs}
570 %if %{defined rpm_post_base}
571 if [ -x %{rpm_post_base}-osd-zfs.sh ]; then
572 %{rpm_post_base}-osd-zfs.sh %{cross_path} remove
575 OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
576 rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' > /var/run/%{name}-osd-zfs || true
580 %if %{undefined cross_path}
582 if [ -f /boot/System.map-%{kversion} ]; then
583 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
585 depmod -ae %{kversion} || exit 0
588 # "weak modules" support
590 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
591 cat /var/run/%{name}-modules |
592 /usr/lib/module-init-tools/weak-modules --remove-modules
595 if [ -x /sbin/weak-modules ]; then
596 cat /var/run/%{name}-modules |
597 /sbin/weak-modules --remove-modules
599 rm /var/run/%{name}-modules
601 %if %{build_lustre_osd_ldiskfs}
603 if [ -f /boot/System.map-%{kversion} ]; then
604 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
606 depmod -ae %{kversion} || exit 0
609 # "weak modules" support
611 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
612 cat /var/run/%{name}-osd-ldiskfs |
613 /usr/lib/module-init-tools/weak-modules --remove-modules
616 if [ -x /sbin/weak-modules ]; then
617 cat /var/run/%{name}-osd-ldiskfs |
618 /sbin/weak-modules --remove-modules
620 rm /var/run/%{name}-osd-ldiskfs
623 %if %{build_lustre_osd_zfs}
625 if [ -f /boot/System.map-%{kversion} ]; then
626 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
628 depmod -ae %{kversion} || exit 0
631 # "weak modules" support
633 if [ -x /usr/lib/module-init-tools/weak-modules ]; then
634 cat /var/run/%{name}-osd-zfs |
635 /usr/lib/module-init-tools/weak-modules --remove-modules
638 if [ -x /sbin/weak-modules ]; then
639 cat /var/run/%{name}-osd-zfs |
640 /sbin/weak-modules --remove-modules
642 rm /var/run/%{name}-osd-zfs
646 %if %{build_lustre_tests}
648 %if %{defined rpm_post_base}
649 if [ -x %{rpm_post_base}-tests.sh ]; then
650 %{rpm_post_base}-tests.sh %{cross_path} create
654 if [ -x %{rpm_post_base}-tests.sh ]; then
655 %{rpm_post_base}-tests.sh %{cross_path} remove
658 if [ -f /boot/System.map-%{kversion} ]; then
659 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
661 depmod -ae %{kversion} || exit 0
665 if [ -f /boot/System.map-%{kversion} ]; then
666 depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
668 depmod -ae %{kversion} || exit 0
674 rm -rf $RPM_BUILD_ROOT