summaryrefslogtreecommitdiff
path: root/xenserver
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-14 10:36:56 -0700
committerBen Pfaff <blp@nicira.com>2011-06-15 12:30:21 -0700
commita4f531d87c02423a065bd667eda97cca65ac7bcd (patch)
tree9ac5b784382475a1171ff51bb9587ab8344f8e3f /xenserver
parentc15f1d11fa95a036eaa2504527bbd5decf082db6 (diff)
downloadopenvswitch-a4f531d87c02423a065bd667eda97cca65ac7bcd.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>
Diffstat (limited to 'xenserver')
-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 a5c1409b8..2c247094d 100644
--- a/xenserver/openvswitch-xen.spec
+++ b/xenserver/openvswitch-xen.spec
@@ -247,8 +247,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