Skip to content

Commit

Permalink
Remove symlink to vrouter.ko only during uninstallation
Browse files Browse the repository at this point in the history
RPM Scriplets execution order during upgrade, installs the new package first
followed by new packages's postinst and then preun script of old package
Because of this, symlink gets removed during contrail upgrade

Closes-Bug: 1623413
Change-Id: I122129608e8fd4749968b610987131162c62e46e
  • Loading branch information
npchandran committed Sep 26, 2016
1 parent 0ceb8a5 commit 319eba8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rpm/contrail/contrail.spec
Expand Up @@ -160,8 +160,14 @@ The OpenContrail vRouter is conceptually similar to existing commercial and open
The package opencontrail-vrouter-dkms provides the OpenContrail Linux kernel module.

%preun vrouter
if [ -L /lib/modules/$(uname -r)/extra/net/vrouter/vrouter.ko ]; then
rm -f /lib/modules/$(uname -r)/extra/net/vrouter/vrouter.ko
# Execute only during uninstall, skip during upgrade
if [ $1 == 0 ]; then
if [ -L /lib/modules/$(uname -r)/extra/net/vrouter/vrouter.ko ]; then
echo "Removing symbolic link /lib/modules/$(uname -r)/extra/net/vrouter/vrouter.ko"
rm -f /lib/modules/$(uname -r)/extra/net/vrouter/vrouter.ko
fi
else
echo "Skip removing /lib/modules/$(uname -r)/extra/net/vrouter/vrouter.ko for upgrade"
fi
exit 0

Expand Down

0 comments on commit 319eba8

Please sign in to comment.