Merge "Define localstatedir for ovs compilation"
This commit is contained in:
@@ -35,16 +35,22 @@ function load_module {
|
|||||||
# Accepts two parameters:
|
# Accepts two parameters:
|
||||||
# - first one is True, modules are built and installed.
|
# - first one is True, modules are built and installed.
|
||||||
# - second optional parameter defines prefix for ovs compilation
|
# - second optional parameter defines prefix for ovs compilation
|
||||||
|
# - third optional parameter defines localstatedir for ovs single machine runtime
|
||||||
# Env variables OVS_REPO_NAME, OVS_REPO and OVS_BRANCH must be set
|
# Env variables OVS_REPO_NAME, OVS_REPO and OVS_BRANCH must be set
|
||||||
function compile_ovs {
|
function compile_ovs {
|
||||||
local _pwd=$PWD
|
local _pwd=$PWD
|
||||||
local build_modules=${1:-True}
|
local build_modules=${1:-True}
|
||||||
local prefix=$2
|
local prefix=$2
|
||||||
|
local localstatedir=$3
|
||||||
|
|
||||||
if [ -n "$prefix" ]; then
|
if [ -n "$prefix" ]; then
|
||||||
prefix="--prefix=$prefix"
|
prefix="--prefix=$prefix"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$localstatedir" ]; then
|
||||||
|
localstatedir="--localstatedir=$localstatedir"
|
||||||
|
fi
|
||||||
|
|
||||||
cd $DEST
|
cd $DEST
|
||||||
if [ ! -d $OVS_REPO_NAME ] ; then
|
if [ ! -d $OVS_REPO_NAME ] ; then
|
||||||
git clone $OVS_REPO
|
git clone $OVS_REPO
|
||||||
@@ -67,9 +73,9 @@ function compile_ovs {
|
|||||||
fi
|
fi
|
||||||
if [ ! -f config.status ] || [ configure -nt config.status ] ; then
|
if [ ! -f config.status ] || [ configure -nt config.status ] ; then
|
||||||
if [[ "$build_modules" == "True" ]]; then
|
if [[ "$build_modules" == "True" ]]; then
|
||||||
./configure $prefix --with-linux=/lib/modules/$(uname -r)/build
|
./configure $prefix $localstatedir --with-linux=/lib/modules/$(uname -r)/build
|
||||||
else
|
else
|
||||||
./configure $prefix
|
./configure $prefix $localstatedir
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
make -j$[$(nproc) + 1]
|
make -j$[$(nproc) + 1]
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ then
|
|||||||
uninstall_package $package
|
uninstall_package $package
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
compile_ovs True /usr
|
compile_ovs True /usr /var
|
||||||
start_new_ovs
|
start_new_ovs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user