Merge "gate_hook: Compile ovs only with supported kernels"

This commit is contained in:
Jenkins 2016-09-08 17:04:37 +00:00 committed by Gerrit Code Review
commit 1588559407
2 changed files with 24 additions and 8 deletions

View File

@ -31,6 +31,20 @@ function load_module {
fi
}
# is_kernel_supported_for_ovs25() - compilation of openvswitch 2.5 kernel module
# supports only kernels up to 4.3.x, function
# determines whether compilation from source
# will succeed on this machine
function is_kernel_supported_for_ovs25 {
major=$(uname -r | cut -d\. -f 1)
minor=$(uname -r | cut -d\. -f 2)
if [ $major -le 4 -a $minor -le 3 ]; then
return 0
fi
return 1
}
# compile_ovs() - Compile OVS from source and load needed modules.
# Accepts two parameters:
# - first one is True, modules are built and installed.

View File

@ -44,14 +44,16 @@ case $VENV in
configure_host_for_func_testing
# The OVS_BRANCH variable is used by git checkout. In the case below,
# we use a current (2016-08-19) HEAD commit from branch-2.5 that contains
# a fix for usage of VXLAN tunnels on a single node:
# https://github.com/openvswitch/ovs/commit/741f47cf35df2bfc7811b2cff75c9bb8d05fd26f
OVS_BRANCH=042326c3fcf61e8638fa15926f984ce5ae142f4b
remove_ovs_packages
compile_ovs True /usr /var
start_new_ovs
if is_kernel_supported_for_ovs25; then
# The OVS_BRANCH variable is used by git checkout. In the case below,
# we use a current (2016-08-19) HEAD commit from branch-2.5 that contains
# a fix for usage of VXLAN tunnels on a single node:
# https://github.com/openvswitch/ovs/commit/741f47cf35df2bfc7811b2cff75c9bb8d05fd26f
OVS_BRANCH=042326c3fcf61e8638fa15926f984ce5ae142f4b
remove_ovs_packages
compile_ovs True /usr /var
start_new_ovs
fi
load_conf_hook iptables_verify
# Make the workspace owned by the stack user