-# for update from < v1.4.6
-
-for f in /etc/modules.conf /etc/modprobe.conf /etc/modprobe.conf.local ;
-do
- if [ -f $f ]; then
- if grep 'lustre llite' $f >/dev/null 2>/dev/null ; then
- [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
- TMPFILE=`mktemp $f.XXXXXX` && \
- rm -f $TMPFILE && touch $TMPFILE && \
- grep -v 'lustre llite' $f >> $TMPFILE && \
- mv $TMPFILE $f
- fi
- if egrep "^[^#]*(add below|install) ptlrpc" $f ; then
- [ ! -f $f.rpmsave ] && cp $f $f.rpmsave
- TMPFILE=`mktemp $f.XXXXXX` && \
- rm -f $TMPFILE && touch $TMPFILE && \
- sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f >> $TMPFILE && \
- mv $TMPFILE $f
- fi
- fi
-done
+# If the kernel was built to reject unsupported modules (e.g. not a Lustre
+# kernel), and this hasn't been overridden in /etc/modprobe.d yet, then
+# print a warning so that users are aware of this issue.
+if sysctl kernel.unsupported >/dev/null 2>&1 &&
+ [ "$(sysctl -n kernel.unsupported 2>/dev/null)" = "0" ] &&
+ ! modprobe -c | grep -q "^allow_unsupported_modules[ \t]1" ; then
+ echo "
+ warning: the Lustre modules are not supported by Novell. To use Lustre
+ on this system, you should put
+
+ allow_unsupported_modules 1
+
+ into /etc/modprobe.d/unsupported_modules"
+fi
+%endif
+
+%if %{build_lustre_osd_zfs}
+%post osd-zfs
+if [ -f /boot/System.map-%{kversion} ]; then
+ depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
+else
+ depmod -ae %{kversion} || exit 0
+fi
+
+OSD_ZFS_RPM_NAME=$(rpm -q %{name}-osd-zfs | grep "%{version}-%{release}")
+# "weak modules" support
+# Suse
+if [ -x /usr/lib/module-init-tools/weak-modules ]; then
+ rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
+ /usr/lib/module-init-tools/weak-modules --add-modules
+fi
+# RedHat
+if [ -x /sbin/weak-modules ]; then
+ rpm -ql $OSD_ZFS_RPM_NAME | grep '\.ko$' |
+ /sbin/weak-modules --add-modules
+fi