From 86af4a0e5d5b0dc5bfb9c98e19e3b18518cab2e8 Mon Sep 17 00:00:00 2001 From: Kyle Mestery Date: Tue, 24 Jun 2014 11:07:54 +0000 Subject: [PATCH] Don't install openvswitch-datapath-dkms on newer kernels On kernels >= 3.13 for Ubuntu, there is no need to install the openvswitch-datapath-dkms package anymore. Consequently we don't need the dkms package anymore, nor the linux headers. Update the opendaylight devstack code to correctly check for this and make the right decision. While here, also utilize get_packages() and common code where possible. Change-Id: Idd6a71951f6f77b6e3c4e536e735dfead6a40bc1 Closes-Bug: #1331111 --- files/apts/opendaylight | 2 -- files/apts/openvswitch | 3 +++ files/rpms-suse/opendaylight | 3 --- files/rpms-suse/openvswitch | 3 +++ files/rpms/opendaylight | 1 - files/rpms/openvswitch | 1 + lib/neutron_plugins/ovs_base | 26 ++++++++++++-------------- lib/opendaylight | 18 +++--------------- 8 files changed, 22 insertions(+), 35 deletions(-) delete mode 100644 files/apts/opendaylight create mode 100644 files/apts/openvswitch delete mode 100644 files/rpms-suse/opendaylight create mode 100644 files/rpms-suse/openvswitch delete mode 100644 files/rpms/opendaylight create mode 100644 files/rpms/openvswitch diff --git a/files/apts/opendaylight b/files/apts/opendaylight deleted file mode 100644 index ec3cc9daf8..0000000000 --- a/files/apts/opendaylight +++ /dev/null @@ -1,2 +0,0 @@ -openvswitch-datapath-dkms # NOPRIME -openvswitch-switch # NOPRIME diff --git a/files/apts/openvswitch b/files/apts/openvswitch new file mode 100644 index 0000000000..4c0af4ae2d --- /dev/null +++ b/files/apts/openvswitch @@ -0,0 +1,3 @@ +fakeroot +make +openvswitch-switch diff --git a/files/rpms-suse/opendaylight b/files/rpms-suse/opendaylight deleted file mode 100644 index f7fafffae1..0000000000 --- a/files/rpms-suse/opendaylight +++ /dev/null @@ -1,3 +0,0 @@ -openvswitch # NOPRIME -openvswitch-switch # NOPRIME - diff --git a/files/rpms-suse/openvswitch b/files/rpms-suse/openvswitch new file mode 100644 index 0000000000..edfb4d21aa --- /dev/null +++ b/files/rpms-suse/openvswitch @@ -0,0 +1,3 @@ +openvswitch +openvswitch-switch + diff --git a/files/rpms/opendaylight b/files/rpms/opendaylight deleted file mode 100644 index 98aaaf48f7..0000000000 --- a/files/rpms/opendaylight +++ /dev/null @@ -1 +0,0 @@ -openvswitch # NOPRIME diff --git a/files/rpms/openvswitch b/files/rpms/openvswitch new file mode 100644 index 0000000000..64796f72cd --- /dev/null +++ b/files/rpms/openvswitch @@ -0,0 +1 @@ +openvswitch diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base index e13cbb1b18..26c5489c5b 100644 --- a/lib/neutron_plugins/ovs_base +++ b/lib/neutron_plugins/ovs_base @@ -32,26 +32,24 @@ function neutron_ovs_base_cleanup { done } +function _neutron_ovs_base_install_ubuntu_dkms { + # install Dynamic Kernel Module Support packages if needed + local kernel_version=$(uname -r) + local kernel_major_minor=`echo $kernel_version | cut -d. -f1-2` + # From kernel 3.13 on, openvswitch-datapath-dkms is not needed + if [ `vercmp_numbers "$kernel_major_minor" "3.13"` -lt "0" ]; then + install_package "dkms openvswitch-datapath-dkms linux-headers-$kernel_version" + fi +} + function _neutron_ovs_base_install_agent_packages { - local kernel_version # Install deps - # FIXME add to ``files/apts/neutron``, but don't install if not needed! + install_package $(get_packages "openvswitch") if is_ubuntu; then - kernel_version=`cat /proc/version | cut -d " " -f3` - ovs_packages="make fakeroot dkms openvswitch-switch" - # From kernel 3.13 on, openvswitch-datapath-dkms is not needed - kernel_major_minor=`echo $kernel_version | cut -d. -f1-2` - if [ `vercmp_numbers "$kernel_major_minor" "3.13"` -lt "0" ]; then - ovs_packages="$ovs_packages openvswitch-datapath-dkms" - fi - ovs_packages="$ovs_packages linux-headers-$kernel_version" - install_package $ovs_packages + _neutron_ovs_base_install_ubuntu_dkms elif is_fedora; then - install_package openvswitch - # Ensure that the service is started restart_service openvswitch elif is_suse; then - install_package openvswitch-switch restart_service openvswitch-switch fi } diff --git a/lib/opendaylight b/lib/opendaylight index 0ac7f2b0e5..33b3f0aeca 100644 --- a/lib/opendaylight +++ b/lib/opendaylight @@ -122,22 +122,10 @@ function install_opendaylight { unzip -u $ODL_PKG } -# install_opendaylight-compute - Make sure OVS is install +# install_opendaylight-compute - Make sure OVS is installed function install_opendaylight-compute { - local kernel_version - # Install deps - # FIXME add to ``files/apts/neutron``, but don't install if not needed! - if is_ubuntu; then - kernel_version=`cat /proc/version | cut -d " " -f3` - install_package make fakeroot dkms openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version - elif is_fedora; then - install_package openvswitch - # Ensure that the service is started - restart_service openvswitch - elif is_suse; then - install_package openvswitch-switch - restart_service openvswitch-switch - fi + # packages are the same as for Neutron OVS agent + _neutron_ovs_base_install_agent_packages } # start_opendaylight() - Start running processes, including screen