aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristina Nevolnikova <knevolnikova@frinx.io>2017-06-21 14:20:42 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-07-12 22:06:39 +0000
commit8ae1873a3f3368a942a1b02e7d4b60b005364a90 (patch)
tree984ecdfdd6acf1ba570e68a927947ad18ee40252
parent10ae76627b19f26d857bdeffae9e2c2fac6e38a8 (diff)
Decrease steps necessary to upgrading RPM packages fixed
in %postun part and not call sysctl when VPP package is upgrading provide by condition for sysctl --system in %post part. Change-Id: I549803864699e4a81cf589befe296d585e1c6d2b Signed-off-by: Kristina Nevolnikova <knevolnikova@frinx.io>
-rw-r--r--extras/rpm/vpp.spec38
1 files changed, 22 insertions, 16 deletions
diff --git a/extras/rpm/vpp.spec b/extras/rpm/vpp.spec
index 1633e0ff76a..fad25d2212e 100644
--- a/extras/rpm/vpp.spec
+++ b/extras/rpm/vpp.spec
@@ -230,7 +230,9 @@ done
%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
%post
-sysctl --system
+if [ $1 -eq 1 ] ; then
+ sysctl --system
+fi
%systemd_post vpp.service
%preun
@@ -238,23 +240,27 @@ sysctl --system
%postun
%systemd_postun
-
-# Unbind user-mode PCI drivers
-removed=
-pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
-for d in $pci_dirs; do
- for f in ${d}/*; do
- [ -e "${f}/config" ] || continue
- echo ${f##*/} > ${d}/unbind
- basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
- removed=y
+if [ $1 -eq 0 ] ; then
+ echo "Uninstalling, unbind user-mode PCI drivers"
+ # Unbind user-mode PCI drivers
+ removed=
+ pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
+ for d in $pci_dirs; do
+ for f in ${d}/*; do
+ [ -e "${f}/config" ] || continue
+ echo ${f##*/} > ${d}/unbind
+ basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
+ removed=y
+ done
done
-done
-if [ -n "${removed}" ]; then
- echo "There are changes in PCI drivers, rescaning"
- echo 1 > /sys/bus/pci/rescan
+ if [ -n "${removed}" ]; then
+ echo "There are changes in PCI drivers, rescaning"
+ echo 1 > /sys/bus/pci/rescan
+ else
+ echo "There weren't PCI devices binded"
+ fi
else
- echo "There weren't PCI devices binded"
+ echo "Upgrading package, dont' unbind interfaces"
fi
%files