network/openvswitch: Update scripts.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
d23b37874f
commit
939ae1a9e6
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
PRGNAM=openvswitch
|
PRGNAM=openvswitch
|
||||||
VERSION=${VERSION:-2.3.1}
|
VERSION=${VERSION:-2.3.1}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-2}
|
||||||
TAG=${TAG:-_SBo}
|
TAG=${TAG:-_SBo}
|
||||||
|
|
||||||
KERNEL=${KERNEL:-$(uname -r)}
|
KERNEL=${KERNEL:-$(uname -r)}
|
||||||
|
@ -103,7 +103,7 @@ if [ ! -f /lib/modules/$(uname -r)/kernel/net/openvswitch/openvswitch.ko ]; then
|
||||||
$PKG/lib/modules/${KERNEL}/kernel/extra/openvswitch
|
$PKG/lib/modules/${KERNEL}/kernel/extra/openvswitch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $PKG/etc/openvswitch $PKG/etc/rc.d $PKG/var/run/openvswitch
|
mkdir -p $PKG/var/lib/openvswitch $PKG/etc/rc.d $PKG/var/run/openvswitch
|
||||||
sed -e "s,@DOCDIR@,/usr/doc/$PRGNAM-$VERSION,g" $CWD/rc.openvswitch \
|
sed -e "s,@DOCDIR@,/usr/doc/$PRGNAM-$VERSION,g" $CWD/rc.openvswitch \
|
||||||
> $PKG/etc/rc.d/rc.openvswitch.new
|
> $PKG/etc/rc.d/rc.openvswitch.new
|
||||||
chmod 0755 $PKG/etc/rc.d/rc.openvswitch.new
|
chmod 0755 $PKG/etc/rc.d/rc.openvswitch.new
|
||||||
|
|
|
@ -6,16 +6,7 @@
|
||||||
#
|
#
|
||||||
# % chmod 755 /etc/rc.d/rc.openvswitch
|
# % chmod 755 /etc/rc.d/rc.openvswitch
|
||||||
|
|
||||||
# Before you can run Open vSwitch daemon, you must have a database. To
|
DBCONF=/var/lib/openvswitch/ovs-vswitchd.conf.db
|
||||||
# install an initial database, perform the following as root:
|
|
||||||
#
|
|
||||||
# % modprobe openvswitch_mod
|
|
||||||
# % ovsdb-tool create /etc/openvswitch/ovs-vswitchd.conf.db @DOCDIR@/schema/vswitch.ovsschema
|
|
||||||
#
|
|
||||||
|
|
||||||
# Module to make Open vSwitch compatible with Linux bridge utils:
|
|
||||||
BRCOMPAT=0
|
|
||||||
|
|
||||||
SOCKET=/var/run/openvswitch/db.sock
|
SOCKET=/var/run/openvswitch/db.sock
|
||||||
VSPID=/var/run/openvswitch/ovs-vswitchd.pid
|
VSPID=/var/run/openvswitch/ovs-vswitchd.pid
|
||||||
DBPID=/var/run/openvswitch/ovsdb-server.pid
|
DBPID=/var/run/openvswitch/ovsdb-server.pid
|
||||||
|
@ -26,15 +17,13 @@ DBPID=/var/run/openvswitch/ovsdb-server.pid
|
||||||
# Insert kernel driver for VLANs:
|
# Insert kernel driver for VLANs:
|
||||||
/sbin/modprobe 8021q
|
/sbin/modprobe 8021q
|
||||||
|
|
||||||
# Insert kernel driver for bridge util compatibility:
|
|
||||||
if [ $BRCOMPAT -ne 0 ] ; then
|
|
||||||
/sbin/modprobe brcompat
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start openvswitch:
|
# Start openvswitch:
|
||||||
openvswitch_start() {
|
openvswitch_start() {
|
||||||
echo "Starting openvswitch: /etc/rc.d/rc.openvswitch"
|
echo "Starting openvswitch: /etc/rc.d/rc.openvswitch"
|
||||||
/usr/sbin/ovsdb-server /etc/openvswitch/ovs-vswitchd.conf.db --remote=punix:$SOCKET --detach --pidfile=$DBPID --verbose=ANY:ANY:err
|
if [ ! -f $DBCONF ]; then
|
||||||
|
ovsdb-tool create $DBCONF @DOCDIR@/schema/vswitch.ovsschema
|
||||||
|
fi
|
||||||
|
/usr/sbin/ovsdb-server $DBCONF --remote=punix:$SOCKET --detach --pidfile=$DBPID --verbose=ANY:ANY:err
|
||||||
/usr/bin/ovs-vsctl --no-wait --verbose=ANY:ANY:err init
|
/usr/bin/ovs-vsctl --no-wait --verbose=ANY:ANY:err init
|
||||||
/usr/sbin/ovs-vswitchd unix:$SOCKET --detach --pidfile=$VSPID --verbose=ANY:ANY:err
|
/usr/sbin/ovs-vswitchd unix:$SOCKET --detach --pidfile=$VSPID --verbose=ANY:ANY:err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue