Merge "Add support for building ovs from git sources on stacking"
This commit is contained in:
commit
59d1673e86
@ -69,7 +69,15 @@ function compile_ovs {
|
||||
|
||||
if is_fedora ; then
|
||||
# is_fedora covers Fedora, RHEL, CentOS, etc...
|
||||
install_package kernel-devel
|
||||
echo NOTE: if kernel-devel-$(uname -r) or kernel-headers-$(uname -r) installation
|
||||
echo failed, please, provide a repository with the package, or yum update / reboot
|
||||
echo your machine to get the latest kernel.
|
||||
|
||||
install_package kernel-devel-$(uname -r)
|
||||
install_package kernel-headers-$(uname -r)
|
||||
|
||||
elif is_ubuntu ; then
|
||||
install_package linux-headers-$(uname -r)
|
||||
fi
|
||||
|
||||
if [ ! -f configure ] ; then
|
||||
@ -98,6 +106,15 @@ function compile_ovs {
|
||||
|
||||
# start_new_ovs() - removes old ovs database, creates a new one and starts ovs
|
||||
function start_new_ovs () {
|
||||
rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~
|
||||
sudo rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~
|
||||
sudo /usr/share/openvswitch/scripts/ovs-ctl start
|
||||
}
|
||||
|
||||
# remove_ovs_packages() - removes old ovs packages from the system
|
||||
function remove_ovs_packages() {
|
||||
for package in openvswitch openvswitch-switch openvswitch-common; do
|
||||
if is_package_installed $package; then
|
||||
uninstall_package $package
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -6,6 +6,9 @@ source $LIBDIR/l2_agent
|
||||
source $LIBDIR/l2_agent_sriovnicswitch
|
||||
source $LIBDIR/ml2
|
||||
source $LIBDIR/qos
|
||||
source $LIBDIR/ovs
|
||||
|
||||
Q_BUILD_OVS_FROM_GIT=$(trueorfalse False Q_BUILD_OVS_FROM_GIT)
|
||||
|
||||
if [[ "$1" == "stack" ]]; then
|
||||
case "$2" in
|
||||
@ -19,6 +22,12 @@ if [[ "$1" == "stack" ]]; then
|
||||
if is_service_enabled q-bgp; then
|
||||
configure_bgp
|
||||
fi
|
||||
if [[ "$Q_AGENT" == "openvswitch" ]] && \
|
||||
[[ "$Q_BUILD_OVS_FROM_GIT" == "True" ]]; then
|
||||
remove_ovs_packages
|
||||
compile_ovs True /usr /var
|
||||
start_new_ovs
|
||||
fi
|
||||
;;
|
||||
post-config)
|
||||
if is_service_enabled q-agt; then
|
||||
|
@ -49,11 +49,7 @@ then
|
||||
# we use a commit on branch-2.5 that fixes compilation with the
|
||||
# latest ubuntu trusty kernel.
|
||||
OVS_BRANCH=8c0b419a0b9ac0141d6973dcc80306dfc6a83d31
|
||||
for package in openvswitch openvswitch-switch openvswitch-common; do
|
||||
if is_package_installed $package; then
|
||||
uninstall_package $package
|
||||
fi
|
||||
done
|
||||
remove_ovs_packages
|
||||
compile_ovs True /usr /var
|
||||
start_new_ovs
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user