From: Ben Pfaff Date: Tue, 14 Jun 2011 17:36:56 +0000 (-0700) Subject: xenserver: Run "depmod" after old modules are removed by "rpm -U". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4f531d87c02423a065bd667eda97cca65ac7bcd;p=openvswitch 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 Reported-by: Henrik Amren Signed-off-by: Ben Pfaff --- diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec index a5c1409b..2c247094 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