From 6bf11c02e8404851b7bfbf0bcfb728d41a4679c226343eca036de1f7cd77000b Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 3 May 2012 07:51:43 +0000 Subject: [PATCH] Accepting request 113572 from home:onielsen:branches:network Adjusted build fix for factory; build KMP packages from kernel-source on openSuSE > 12.1. OBS-URL: https://build.opensuse.org/request/show/113572 OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=9 --- Module.supported | 1 + openvswitch.changes | 5 +++++ openvswitch.spec | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 Module.supported diff --git a/Module.supported b/Module.supported new file mode 100644 index 0000000..e8c381c --- /dev/null +++ b/Module.supported @@ -0,0 +1 @@ +- kernel/net/openvswitch/openvswitch diff --git a/openvswitch.changes b/openvswitch.changes index d6689a6..fe711fe 100644 --- a/openvswitch.changes +++ b/openvswitch.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Apr 5 10:08:32 UTC 2012 - on@morlock.nu + +- Build KMP packages from kernel-source on openSuSE > 12.1. + ------------------------------------------------------------------- Tue Mar 13 12:16:43 UTC 2012 - mvidner@suse.com diff --git a/openvswitch.spec b/openvswitch.spec index 60ef13a..d8553ad 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -18,6 +18,13 @@ # norootforbuild %define build_kmp 1 +%define build_in_kernel_kmp 0 + +# openSuSE versions above 12.1 +# Do not build kernel module - Open vSwitch is now shipping as part of Linux 3.3 +%if 0%{?suse_version} > 1210 +%define build_in_kernel_kmp 1 +%endif %bcond_with pyside @@ -82,6 +89,9 @@ Group: System/Kernel License: GPLv2 Summary: Open vSwitch kernel modules BuildRequires: %kernel_module_package_buildreqs +%if 0%{?build_in_kernel_kmp} +BuildRequires: kernel-source +%endif # Requires: kernel-default kernel-desktop # BuildRequires: perl-base autoconf automake libtool kernel-source kernel-syms module-init-tools # suse_kernel_module_package ec2 xen xenpae vmi um @@ -209,6 +219,16 @@ pushd source bash -x boot.sh popd %if 0%{?build_kmp} +%if 0%{?build_in_kernel_kmp} +for flavor in %flavors_to_build; do + mkdir -p $flavor + cp -a $RPM_SOURCE_DIR/Module.supported $flavor/ + krel=$(make -s -C /usr/src/linux-obj/%_target_cpu/$flavor kernelrelease) + kernel_source_dir=$(readlink /lib/modules/$krel/source) + cp -a $kernel_source_dir/net/openvswitch/* $flavor/ + make -C %{kernel_source $flavor} modules M=$PWD/$flavor +done +%else export EXTRA_CFLAGS='-DVERSION=\"%version\"' for flavor in %flavors_to_build; do rm -rf obj/$flavor @@ -223,6 +243,7 @@ for flavor in %flavors_to_build; do popd done %endif +%endif ls source pushd source %configure \ @@ -235,9 +256,13 @@ popd export INSTALL_MOD_PATH=%{buildroot} export INSTALL_MOD_DIR=updates for flavor in %flavors_to_build; do +%if 0%{?build_in_kernel_kmp} + make -C %{kernel_source $flavor} modules_install M=$PWD/$flavor +%else pushd obj/$flavor/datapath/linux make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install M=$PWD popd +%endif done %endif pushd source