X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=xenserver%2Fopenvswitch-xen.spec;h=4b3019d56c7f64db5aa647d7e6a25dacb91c4018;hb=3476e0baaaddb7a25237297d1811a28ba11c21e6;hp=97bf99ca037dc4275fb1b1124f1f468e08830aaf;hpb=49b2c2d00e1c78427d669cd32520f7fac657611b;p=sliver-openvswitch.git diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec index 97bf99ca0..4b3019d56 100644 --- a/xenserver/openvswitch-xen.spec +++ b/xenserver/openvswitch-xen.spec @@ -8,22 +8,24 @@ # without warranty of any kind. # When building, the rpmbuild command line should define -# openvswitch_version, xen_version, and build_number using -D arguments. +# openvswitch_version, kernel_name, kernel_version, kernel_flavor, +# and build_number using -D arguments. # for example: # -# rpmbuild -D "openvswitch_version 0.8.9~1+build123" -D "xen_version 2.6.18-128.1.1.el5.xs5.1.0.483.1000xen" -D "build_number --with-build-number=123" -bb /usr/src/redhat/SPECS/openvswitch-xen.spec +# rpmbuild -D "openvswitch_version 1.1.0+build123" +# -D "kernel_name NAME-xen" +# -D "kernel_version 2.6.32.12-0.7.1.xs5.6.100.323.170596" +# -D "kernel_flavor xen" +# -D "build_number --with-build-number=123" +# -bb /usr/src/redhat/SPECS/openvswitch-xen.spec -%define version %{openvswitch_version}-%{xen_version} +%define xen_version %{kernel_version}%{kernel_flavor} # bump this when breaking compatibility with userspace %define module_abi_version 0 -# extract kernel type (xen or kdump) -%define binsuffix -%(echo '%{xen_version}' | sed -r 's/^.*[0-9]+//') -# kernel version string w/o kernel type -%define kernel_version %(echo '%{xen_version}' | sed -r 's/[a-z]+$//') # build-supplemental-pack.sh requires this naming for kernel module packages -%define module_package modules%{binsuffix}-%{kernel_version} +%define module_package modules-%{kernel_flavor}-%{kernel_version} Name: openvswitch Summary: Open vSwitch daemon/database/utilities @@ -47,8 +49,8 @@ traffic. Summary: Open vSwitch kernel module Group: System Environment/Kernel License: GPLv2 -Provides: %{name}-modules = %{kernel_version}, openvswitch_mod.ko.%{module_abi_version} -Requires: kernel%{binsuffix} = %{kernel_version} +Provides: %{name}-modules-%{kernel_flavor} = %{kernel_version}, openvswitch_mod.ko.%{module_abi_version} +Requires: kernel-%{kernel_name} = %{kernel_version} %description %{module_package} Open vSwitch Linux kernel module compiled against kernel version @@ -224,15 +226,10 @@ for s in openvswitch openvswitch-xapi-update; do chkconfig $s on || printf "Could not enable $s init script." done -if [ "$1" = "1" ]; then # $1 = 2 for upgrade +if [ "$1" = "1" ]; then # $1 = 1 for install # Configure system to use Open vSwitch - echo vswitch > /etc/xensource/network.conf - - printf "\nYou MUST reboot the server NOW to complete the change to\n" - printf "Open vSwitch. Attempts to modify networking on the server\n" - printf "or any hosted VM will fail until after the reboot and could\n" - printf "leave the server in a state requiring manual recovery.\n\n" -else + /opt/xensource/bin/xe-switch-network-backend vswitch +else # $1 = 2 for upgrade mode=$(cat /etc/xensource/network.conf) if [ "$mode" != "vswitch" ] && [ "$mode" != "openvswitch" ]; then @@ -252,9 +249,16 @@ fi depmod %{xen_version} %preun -if [ "$1" = "0" ]; then # $1 = 1 for upgrade +if [ "$1" = "0" ]; then # $1 = 0 for uninstall + # Configure system to use bridge + /opt/xensource/bin/xe-switch-network-backend bridge + + # The "openvswitch" service should have been removed from + # "xe-switch-network-backend bridge". for s in openvswitch openvswitch-xapi-update; do - chkconfig --del $s || printf "Could not remove $s init script." + if chkconfig --list $s >/dev/null 2>&1; then + chkconfig --del $s || printf "Could not remove $s init script." + fi done fi @@ -290,7 +294,7 @@ do fi done -if [ "$1" = "0" ]; then # $1 = 1 for upgrade +if [ "$1" = "0" ]; then # $1 = 0 for uninstall rm -f /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyc \ /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyo @@ -308,16 +312,10 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade # Remove saved XenServer scripts directory, but only if it's empty rmdir -p /usr/lib/openvswitch/xs-saved 2>/dev/null - - # Configure system to use bridge - echo bridge > /etc/xensource/network.conf - - 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" - printf "could leave the server in a state requiring manual recovery.\n\n" fi +exit 0 + %files %defattr(-,root,root) /etc/init.d/openvswitch