--- /usr/lib/rpm/rpm-suse-kernel-module-subpackage
+++ /usr/src/packages/SOURCES/subpkg
@@ -20,8 +20,8 @@
' $spec
)
Provides: %{-n*} = %(echo %{-v*}-%3 | tr - _)
-Requires: kernel-%1
-AutoReqProv: on
+Requires: kernel-%1 = %( echo %2 | sed "s,-%1,," )
+AutoReqProv: off
%{-p:%{expand:%(cd %_sourcedir; cat %{-p*})}}
%description -n %{-n*}-%1
%(
@@ -77,6 +77,21 @@
done
fi
fi
+if [ -f /etc/vmware-tools/locations ] ; then
+ for kmodule in ${modules[@]}; do
+ echo "file $kmodule $( stat -c %Y $kmodule )"
+ >> /etc/vmware-tools/locations
+ echo "file $( echo $kmodule |
+ sed -e "s,.ko,.o," -e "s,updates,misc," )"
+ >> /etc/vmware-tools/locations
+ echo "answer $( echo ${kmodule##*/} | sed -e "s,.ko,," |
+ tr '[:lower:]' '[:upper:]' )_CONFED yes"
+ >> /etc/vmware-tools/locations
+ done
+
+ [ -f /etc/vmware-tools/not_configured ] &&
+ rm -f /etc/vmware-tools/not_configured
+fi
%{-i:%{expand:%(cd %_sourcedir; cat %{-i*})}}
%preun -n %{-n*}-%1
version=%(echo %{-v*}-%3 | tr - _)
@@ -116,8 +131,29 @@
done
fi
fi
+if [ -f /etc/vmware-tools/locations ] ; then
+ for kmodule in ${modules[@]}; do
+ MOD="$( echo ${kmodule##*/} | sed -e "s,.ko,," |
+ tr '[:lower:]' '[:upper:]' )_CONFED yes"
+ [ -n "$( grep "$MOD" /etc/vmware-tools/locations )" ] &&
+ sed -i "/$MOD/d" /etc/vmware-tools/locations
+
+ [ -n "$( grep "file $kmodule" /etc/vmware-tools/locations )" ] &&
+ sed -i "/file ${kmodule////\/}.*/d" /etc/vmware-tools/locations
+
+ MOD="$( echo $kmodule | sed -e "s,.ko,.o," -e "s,updates,misc," )"
+ [ -n "$( grep "file $MOD" /etc/vmware-tools/locations )" ] &&
+ sed -i "/file $( echo $MOD | sed -e "s,/,\/,g" )/d"
+ /etc/vmware-tools/locations
+ done
+
+ [ ! -f /etc/vmware-tools/not_configured ] &&
+ touch /etc/vmware-tools/not_configured
+fi
%{-u:%{expand:%(cd %_sourcedir; cat %{-u*})}}
%files -n %{-n*}-%1
%{-f:%{expand:%(cd %_sourcedir; cat %{-f*})}}
%{!-f:%defattr (-,root,root)}
%{!-f:/lib/modules/%2}
+
+# vim: set syntax=on ft=sh :