summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-14 10:36:56 -0700
committerBen Pfaff <blp@nicira.com>2011-07-28 11:21:57 -0700
commitf6f9437ba35e58203a614a9bf765e87d37f4da29 (patch)
tree2c63f811f873f98c4c8d07c249de88d46b99b594
parent44f2560c67fca0d5712a3bec309e4e93e9e63a7b (diff)
downloadopenvswitch-f6f9437ba35e58203a614a9bf765e87d37f4da29.tar.gz
xenserver: Run "depmod" after old modules are removed by "rpm -U".
http://fedoraproject.org/wiki/Packaging/ScriptletSnippets says that package upgrade does the following steps: 1. %pretrans of new package 2. %pre of new package 3. (package install) 4. %post of new package 5. %triggerin of other packages (set off by installing new package) 6. %triggerin of new package (if any are true) 7. %triggerun of old package (if it's set off by uninstalling the old package) 8. %triggerun of other packages (set off by uninstalling old package) 9. %preun of old package 10. (removal of old package) 11. %postun of old package 12. %triggerpostun of old package (if it's set off by uninstalling the old package) 13. %triggerpostun of other packages (if they're setu off by uninstalling the old package) 14. %posttrans of new package We're getting in trouble because the %post runs in step 4 before the old files are removed in step 10, so depmod is finding the old modules. This commit switches to running depmod in step 14 instead, after the old files are removed. Bug #5916. Reported-by: Jesse Gross <jesse@nicira.com> Reported-by: Henrik Amren <henrik@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--xenserver/openvswitch-xen.spec8
1 files changed, 7 insertions, 1 deletions
diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec
index 492e0dc3a..227c072f1 100644
--- a/xenserver/openvswitch-xen.spec
+++ b/xenserver/openvswitch-xen.spec
@@ -244,8 +244,14 @@ else # $1 = 2 for upgrade
printf "\n\n"
fi
-%post %{module_package}
+%posttrans %{module_package}
# Ensure that modprobe will find our modules.
+#
+# This has to be in %posttrans instead of %post because older versions
+# installed modules into a different directory and "rpm -U" runs the
+# new version's %post before removing the old version's files, so if
+# we use %post then depmod may find the old versions that are about to
+# be removed.
depmod %{xen_version}
%preun