Merge citrix into master.
[sliver-openvswitch.git] / xenserver / vswitch-xen.spec
index cf74138..94bd916 100644 (file)
@@ -21,7 +21,9 @@ Summary: Virtual switch
 Group: System Environment/Daemons
 URL: http://www.openvswitch.org/
 Version: %{vswitch_version}
-License: GPL3
+
+# The entire source code is ASL 2.0 except datapath/ which is GPLv2
+License: ASL 2.0 and GPLv2
 Release: 1
 Source: openvswitch-%{vswitch_version}.tar.gz
 Buildroot: /tmp/vswitch-xen-rpm
@@ -67,6 +69,8 @@ install -m 755 xenserver/etc_xensource_scripts_vif \
              $RPM_BUILD_ROOT%{_prefix}/scripts/vif
 install -m 755 xenserver/root_vswitch_scripts_dump-vif-details \
                $RPM_BUILD_ROOT%{_prefix}/scripts/dump-vif-details
+install -m 755 xenserver/usr_sbin_xen-bugtool \
+             $RPM_BUILD_ROOT%{_prefix}/scripts/xen-bugtool
 install -m 644 \
         xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
                $RPM_BUILD_ROOT%{_prefix}/scripts/XSFeatureVSwitch.py
@@ -106,6 +110,7 @@ if [ "$1" = "1" ]; then
     if ! md5sum -c --status <<EOF
 b8e9835862ef1a9cec2a3f477d26c989  /etc/xensource/scripts/vif
 51970ad613a3996d5997e18e44db47da  /opt/xensource/libexec/interface-reconfigure
+5654c8c36699fcc8744ca9cd5b855414  /usr/sbin/xen-bugtool
 EOF
     then
         printf "\nThe original XenServer scripts replaced by this package\n"
@@ -166,8 +171,6 @@ EOF
 fi
 
 %post
-source /etc/xensource-inventory
-
 if grep -F net.ipv4.conf.all.arp_filter /etc/sysctl.conf >/dev/null 2>&1; then :; else
     cat >>/etc/sysctl.conf <<EOF
 # This works around an issue in xhad, which binds to a particular
@@ -183,10 +186,6 @@ net.ipv4.conf.all.arp_filter = 1
 EOF
 fi
 
-xe host-param-set \
-    "other-config:vSwitchVersion=%{version}" uuid="$INSTALLATION_UUID" ||
-    echo "Could not set vSwitchVersion config parameter"
-
 # Ensure ovs-vswitchd.conf exists
 touch /etc/ovs-vswitchd.conf
 
@@ -195,7 +194,8 @@ mkdir -p %{_prefix}/xs-original \
     || printf "Could not create script backup directory.\n"
 for f in \
     /opt/xensource/libexec/interface-reconfigure \
-    /etc/xensource/scripts/vif
+    /etc/xensource/scripts/vif \
+    /usr/sbin/xen-bugtool
 do
     s=$(basename "$f")
     t=$(readlink "$f")
@@ -252,7 +252,8 @@ if [ "$1" = "0" ]; then     # $1 = 1 for upgrade
     # Restore original XenServer scripts
     for f in \
         /opt/xensource/libexec/interface-reconfigure \
-        /etc/xensource/scripts/vif
+        /etc/xensource/scripts/vif \
+        /usr/sbin/xen-bugtool
     do
         s=$(basename "$f")
         if [ ! -f "%{_prefix}/xs-original/$s" ]; then
@@ -274,18 +275,6 @@ if [ "$1" = "0" ]; then     # $1 = 1 for upgrade
     rm -f /var/log/vswitch*
     rm -f /etc/ovs-vswitchd.cacert
 
-    if [ ! -f /etc/xensource-inventory ]; then
-        printf "XenSource inventory not present in /etc/xensource-inventory\n"
-        printf "Could not remove vSwitchVersion from XAPI database.\n"
-        exit 1
-    else
-        source /etc/xensource-inventory
-        xe host-param-remove \
-            param-name=other-config param-key=vSwitchVersion \
-            uuid="$INSTALLATION_UUID" ||
-            echo "Could not clear vSwitchVersion config parameter."
-    fi
-
     printf "\nYou MUST reboot the server now to complete the change to\n"
     printf "standard Xen networking.  Attempts to modify networking on the\n"
     printf "server or any hosted VM will fail until after the reboot and\n"
@@ -306,6 +295,7 @@ fi
 /root/vswitch/scripts/dump-vif-details
 /root/vswitch/scripts/interface-reconfigure
 /root/vswitch/scripts/vif
+/root/vswitch/scripts/xen-bugtool
 /root/vswitch/scripts/XSFeatureVSwitch.py
 # Following two files are generated automatically by rpm.  We don't
 # really need them and they won't be used on the XenServer, but there