[ovs-dev] [PATCH] xenserver: modify module spec file

Sajjad Lateef slateef at nicira.com
Mon May 16 21:11:58 UTC 2011

Based on feedback from Citrix for the Oxford + Oxford CSP kernel,
the spec file has been modified to take three arguments on the
command line: kernel_name, kernel_version and kernel_flavor.

The kernel_flavor is either xen or kdump. The kernel_name is the
Name value embedded in the kernel rpm and the kernel_version
is Version-Release values embedded in the kernel rpm. The
xen_version is calculated.

The INSTALL document has been updated to reflect these changes.

Signed-off-by: Sajjad Lateef <slateef at nicira.com>
 INSTALL.XenServer              |   37 ++++++++++++++++++++-----------------
 xenserver/openvswitch-xen.spec |   17 +++++++++--------
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/INSTALL.XenServer b/INSTALL.XenServer
index 1b5cb52..4945087 100644
--- a/INSTALL.XenServer
+++ b/INSTALL.XenServer
@@ -23,16 +23,16 @@ Once you have a distribution tarball, copy it into
 /usr/src/redhat/SOURCES inside the VM.  Then execute the following:
    VERSION=<Open vSwitch version>
-   XENKERNEL=<Xen kernel version>
-   KERNEL_VERSION=<Xen Kernel Devel version>
-   KERNEL_SUFFIX=<Xen Kernel Devel suffix>
+   KERNEL_NAME=<Xen Kernel name>
+   KERNEL_VERSION=<Xen Kernel version>
+   KERNEL_FLAVOR=<Xen Kernel flavor(suffix) >
    cd /tmp
    tar xfz /usr/src/redhat/SOURCES/openvswitch-$VERSION.tar.gz
    rpmbuild \
         -D "openvswitch_version $VERSION" \
-        -D "xen_version $XENKERNEL" \
+        -D "kernel_name $KERNEL_NAME" \
         -D "kernel_version $KERNEL_VERSION" \
-        -D "kernel_suffix $KERNEL_SUFFIX" \
+        -D "kernel_flavor $KERNEL_FLAVOR" \
         -bb openvswitch-$VERSION/xenserver/openvswitch-xen.spec
@@ -40,22 +40,25 @@ where:
     <openvswitch version> is the version number that appears in the
     name of the Open vSwitch tarball, e.g. 0.90.0.
-    <Xen kernel version> is the version number of the Xen kernel,
-    e.g.  This version number
-    appears as the name of a directory in /lib/modules inside the VM.
-    It always ends in "xen".
+    <Xen Kernel name> is the name of the Xen Kernel,
+    e.g. kernel-xen or kernel-csp-xen. By convention, the name
+    starts with "kernel-" and ends with "-xen".
+    This can be obtained by executing 
+        'rpm -q --queryformat "%{Name}" kernel.*xen'
+    with the "kernel-" stripped out using  sed 's/kernel-//'
+    e.g. kernel-csp-xen => csp-xen
-   <Xen Kernel Devel version> is the output of:
-   rpm -q --queryformat "%{Version}-%{Release}" kernel.*xen-devel
-   e.g. 
+    <Xen Kernel version> is the output of:
+    rpm -q --queryformat "%{Version}-%{Release}" kernel.*xen-devel
+    e.g.
-   <Xen Kernel Devel suffix> is the output of: 
-   rpm -q --queryformat "%{Name}" kernel.*devel 
-   with the "kernel-" and "-devel" stripped out using  sed 's/kernel-//' | sed 's/-devel//'
-   e.g. kernel-csp-xen-devel => csp-xen
+    <Xen Kernel flavor (suffix) > is either "xen" or "kdump".
+    The "xen" flavor is the main running kernel flavor and the "kdump" flavor is
+    the crashdump kernel flavor. Commonly, one would specify "xen" here.
 Three RPMs will be output into /usr/src/redhat/RPMS/i386, whose names begin
-with "openvswitch", "openvswitch-modules-xen", and "openvswitch-debuginfo".
+with "openvswitch", "openvswitch-modules-xen" (if building for kernel_flavor=xen),
+and "openvswitch-debuginfo".
 Installing Open vSwitch for XenServer
diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec
index fed63e7..9838288 100644
--- a/xenserver/openvswitch-xen.spec
+++ b/xenserver/openvswitch-xen.spec
@@ -8,23 +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 1.1.0+build123"
-#      -D "xen_version"
+#      -D "kernel_name  csp-xen"
 #      -D "kernel_version"
-#      -D "kernel_suffix csp-xen"
+#      -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
 # build-supplemental-pack.sh requires this naming for kernel module packages
-%define module_package modules-%{kernel_suffix}-%{kernel_version}
+%define module_package modules-%{kernel_flavor}-%{kernel_version}
 Name: openvswitch
 Summary: Open vSwitch daemon/database/utilities
@@ -48,12 +49,12 @@ 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-%{kernel_suffix} = %{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
 %setup -q -n openvswitch-%{openvswitch_version}

More information about the dev mailing list