[ovs-dev] [PATCH] xenserver: Split kernel/userspace into separate RPMs for supplemental packs.
Andrew Evans
aevans at nicira.com
Sat Feb 19 01:27:15 UTC 2011
On 2/18/11 2:58 PM, Andrew Evans wrote:
> On 2/18/11 11:18 AM, Ben Pfaff wrote:
>> I think that the userspace package could (and should) require the
>> kernel package to be installed by putting an appropriate "Provides:"
>> into the kernel package name. No?
>
> I was thinking along the same lines. We could embed a version number
> that we bump when we break binary compatibility. I'll do that now.
Ok, I've done that and it seems to do what we want.
I also realized that the 'depmod' command needs to be run in the kernel
package now, strictly speaking, so I've moved that.
I also forgot to update INSTALL.XenServer in the last commit, so I've
done that.
Here is an incremental diff:
diff --git a/INSTALL.XenServer b/INSTALL.XenServer
index e7be494..48f8178 100644
--- a/INSTALL.XenServer
+++ b/INSTALL.XenServer
@@ -41,27 +41,30 @@ where:
appears as the name of a directory in /lib/modules inside the VM.
It always ends in "xen".
-Two RPMs will be output into /usr/src/redhat/RPMS/i386, whose names
-begin with "openvswitch" and "openvswitch-debuginfo".
+Three RPMs will be output into /usr/src/redhat/RPMS/i386, whose names begin
+with "openvswitch", "openvswitch-modules-xen", and "openvswitch-debuginfo".
Installing Open vSwitch for XenServer
-------------------------------------
-To install Open vSwitch on a XenServer host, or to upgrade to a newer
-version, copy the "openvswitch" RPM to that host with "scp", then install
-it with "rpm -U", e.g.:
+To install Open vSwitch on a XenServer host, or to upgrade to a newer
version,
+copy the "openvswitch" and "openvswitch-modules-xen" RPMs to that host with
+"scp", then install them with "rpm -U", e.g.:
- scp openvswitch-$VERSION-1.i386.rpm root@<host>:
-(At this point you will have to enter <host>'s root password.)
+ scp openvswitch-$VERSION-1.i386.rpm \
+ openvswitch-modules-xen-$XEN_KERNEL_VERSION-$VERSION-1.i386.rpm \
+ root@<host>:
+(At this point you will have to enter <host>'s root password.)
ssh root@<host>
-(At this point you will have to enter <host>'s root password again.)
- rpm -U openvswitch-$VERSION-1.i386.rpm
+(At this point you will have to enter <host>'s root password again.)
+ rpm -U openvswitch-$VERSION-1.i386.rpm \
+ openvswitch-modules-xen-$XEN_KERNEL_VERSION-$VERSION-1.i386.rpm
-To uninstall Open vSwitch from a XenServer host, remove the package:
+To uninstall Open vSwitch from a XenServer host, remove the packages:
ssh root@<host>
-(At this point you will have to enter <host>'s root password again.)
- rpm -e openvswitch
+(At this point you will have to enter <host>'s root password again.)
+ rpm -e openvswitch openvswitch-modules-xen-$XEN_KERNEL_VERSION
After installing or uninstalling Open vSwitch, the XenServer should be
rebooted as soon as possible.
diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec
index 4c9d8d7..05229de 100644
--- a/xenserver/openvswitch-xen.spec
+++ b/xenserver/openvswitch-xen.spec
@@ -12,9 +12,12 @@
# 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
-#
+
%define version %{openvswitch_version}-%{xen_version}
+# 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
@@ -33,9 +36,7 @@ License: ASL 2.0
Release: 1
Source: openvswitch-%{openvswitch_version}.tar.gz
Buildroot: /tmp/openvswitch-xen-rpm
-# We should require kernel module package here, but
supplemental-pack-enforced
-# naming scheme puts kernel version in module package name, and we
don't want
-# to have to respin the userspace package every time a new kernel comes
along.
+Requires: openvswitch_mod.ko.%{module_abi_version}
%description
Open vSwitch provides standard network bridging functions augmented with
@@ -46,7 +47,7 @@ traffic.
Summary: Open vSwitch kernel module
Group: System Environment/Kernel
License: GPLv2
-Provides: %{name}-modules = %{kernel_version}
+Provides: %{name}-modules = %{kernel_version},
openvswitch_mod.ko.%{module_abi_version}
Requires: kernel%{binsuffix} = %{kernel_version}
%description %{module_package}
@@ -154,9 +155,6 @@ if runlevel >/dev/null 2>&1; then
fi
fi
-# Ensure that modprobe will find our modules.
-depmod %{xen_version}
-
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
@@ -264,6 +262,10 @@ else
printf "\n\n"
fi
+%post %{module_package}
+# Ensure that modprobe will find our modules.
+depmod %{xen_version}
+
%preun
if [ "$1" = "0" ]; then # $1 = 1 for upgrade
for s in openvswitch openvswitch-xapi-update; do
@@ -271,7 +273,6 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade
done
fi
-
%postun
# Restore original XenServer scripts if the OVS equivalent no longer
exists.
# This works both in the upgrade and erase cases.
More information about the dev
mailing list