From: Edwin Chiu <ec...@vmware.com> The latest XenServer 6.5 uses a new way for kernel version naming. Therein, the kernel flavor could not be found anymore. Also, the directory name in 'lib/modules/' becomes a shortened version of kernel version. e.g.:
[root@localhost ~]# ls /lib/modules/ 3.10.0+2 As a workaround, this commit modifies the spec file to make %{kernel_flavor} optional and %{xen_version} definable by users. In the long run, I'd like to spend time refining the spec file. Signed-off-by: Alex Wang <al...@nicira.com> --- AUTHORS | 2 +- INSTALL.XenServer.md | 22 ++++++++++++++++++++++ xenserver/openvswitch-xen.spec.in | 26 +++++++++++++++++++------- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6e8b4da..fd3749a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -229,7 +229,7 @@ David Palma pa...@onesource.pt Derek Cormier derek.corm...@lab.ntt.co.jp Dhaval Badiani dbadi...@vmware.com DK Moon dkm...@nicira.com -Edwin Chiu ec...@nicira.com +Edwin Chiu ec...@vmware.com Eivind Bulie Haanaes Eric Lopez elo...@nicira.com Frido Roose fr.ro...@gmail.com diff --git a/INSTALL.XenServer.md b/INSTALL.XenServer.md index 62c76b9..072a9f2 100644 --- a/INSTALL.XenServer.md +++ b/INSTALL.XenServer.md @@ -80,6 +80,28 @@ where: The "xen" flavor is the main running kernel flavor and the "kdump" flavor is the crashdump kernel flavor. Commonly, one would specify "xen" here. +For XenServer 6.5 or above, the kernel version naming no longer contains +KERNEL_FLAVOR. Correspondingly, the the final "rpmbuild" step changes to: + + ``` + VERSION=<Open vSwitch version> + KERNEL_NAME=<Xen Kernel name> + KERNEL_VERSION=<Xen Kernel version> + XEN_VERSION=<Xen Kernel flavor(suffix) > + rpmbuild \ + -D "openvswitch_version $VERSION" \ + -D "kernel_name $KERNEL_NAME" \ + -D "kernel_version $KERNEL_VERSION" \ + -D "xen_version $XEN_VERSION" \ + -bb xenserver/openvswitch-xen.spec + ``` + +where: + + `<Xen Version>` is the output of `uname -r`. Since XenServer 6.5, the + directory name in 'lib/modules/' becomes a shortened expression of the + KERNEL_VERSION. + Installing Open vSwitch for XenServer ------------------------------------- diff --git a/xenserver/openvswitch-xen.spec.in b/xenserver/openvswitch-xen.spec.in index 31ff1bf..3bae86a 100644 --- a/xenserver/openvswitch-xen.spec.in +++ b/xenserver/openvswitch-xen.spec.in @@ -7,9 +7,9 @@ # notice and this notice are preserved. This file is offered as-is, # without warranty of any kind. -# When building, the rpmbuild command line should define -# openvswitch_version, kernel_name, kernel_version, and kernel_flavor -# using -D arguments. +# For XenServer version < 6.5, when building, the rpmbuild command line +# should define openvswitch_version, kernel_name, kernel_version and +# kernel_flavor using -D arguments. # for example: # # rpmbuild -D "openvswitch_version 1.1.0+build123" @@ -18,6 +18,16 @@ # -D "kernel_flavor xen" # -bb /usr/src/redhat/SPECS/openvswitch-xen.spec # +# For XenServer version >= 6.5, replace kernel_flavor with xen_version which +# should be the `uname -r` output. +# for example: +# +# rpmbuild -D "openvswitch_version 2.3.0+build123" +# -D "kernel_name NAME-xen" +# -D "kernel_version 3.10.41-323.380416" +# -D "xen_version 3.10.0+2" +# -bb /usr/src/redhat/SPECS/openvswitch-xen.spec +# # If tests have to be skipped while building, specify the '--without check' # option. For example: # rpmbuild -bb --without check xenserver/openvswitch-xen.spec @@ -33,13 +43,15 @@ %define kernel_flavor xen %endif +%if %{?xen_version:0}%{!?xen_version:1} %define xen_version %{kernel_version}%{kernel_flavor} +%endif # bump this when breaking compatibility with userspace %define module_abi_version 0 # build-supplemental-pack.sh requires this naming for kernel module packages -%define module_package modules-%{kernel_flavor}-%{kernel_version} +%define module_package modules%{?kernel_flavor:-%{kernel_flavor}}-%{kernel_version} %bcond_without check @@ -65,12 +77,12 @@ traffic. Summary: Open vSwitch kernel module Group: System Environment/Kernel License: GPLv2 -Provides: %{name}-modules-%{kernel_flavor} = %{kernel_version}, openvswitch.ko.%{module_abi_version} -Requires: kernel-%{kernel_name} = %{kernel_version} +Provides: %{name}-modules%{?kernel_flavor:-%{kernel_flavor}} = %{kernel_version}, openvswitch.ko.%{module_abi_version} +Requires: kernel%{?kernel_flavor:-%{kernel_flavor}} = %{kernel_version} %description %{module_package} Open vSwitch Linux kernel module compiled against kernel version -%{xen_version}. +%{kernel_version}%{?kernel_flavor:%{kernel_flavor}}. %prep %setup -q -n openvswitch-%{openvswitch_version} -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev