Upgrade scripts to install Open vSwtich 2.0.0
Change-Id: I69494725f9751c4a4e4a453ec50924d3f1d5a312
This commit is contained in:
parent
ccd711ed9f
commit
52c88b4844
@ -1,17 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## Install Open vSwitch. This file is translated from
|
## Install Open vSwitch (2.0.0). This file is translated from
|
||||||
## cookbook/openvswitch/recipes/default.
|
## cookbook/openvswitch/recipes/default
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
sudo apt-get -y install build-essential \
|
sudo apt-get -y install build-essential \
|
||||||
git \
|
git \
|
||||||
autoconf \
|
autoconf \
|
||||||
|
python-dev \
|
||||||
python-simplejson \
|
python-simplejson \
|
||||||
python-qt4 \
|
python-qt4 \
|
||||||
python-twisted-conch \
|
python-twisted-conch \
|
||||||
uml-utilities \
|
uml-utilities \
|
||||||
libtool \
|
libtool \
|
||||||
|
libssl-dev \
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
||||||
sudo mkdir -p /opt/openvswitch
|
sudo mkdir -p /opt/openvswitch
|
||||||
@ -20,20 +22,22 @@ sudo chown root:root /opt/openvswitch
|
|||||||
|
|
||||||
sudo mkdir -p /etc/openvswitch
|
sudo mkdir -p /etc/openvswitch
|
||||||
sudo chmod 00755 /etc/openvswitch
|
sudo chmod 00755 /etc/openvswitch
|
||||||
sudo chown root:root /opt/openvswitch
|
sudo chown root:root /etc/openvswitch
|
||||||
|
|
||||||
sudo chmod a+w /opt/openvswitch
|
sudo chmod a+w /opt/openvswitch
|
||||||
cd /opt/openvswitch
|
cd /opt/openvswitch
|
||||||
git clone git://openvswitch.org/openvswitch
|
wget http://openvswitch.org/releases/openvswitch-2.0.0.tar.gz
|
||||||
|
tar xzvf openvswitch-2.0.0.tar.gz
|
||||||
|
mv openvswitch-2.0.0 openvswitch
|
||||||
cd openvswitch
|
cd openvswitch
|
||||||
git checkout 3b6f2889400fd340b851c2d36356457559ae6e81
|
|
||||||
./boot.sh
|
|
||||||
./configure --with-linux=/lib/modules/`uname -r`/build \
|
./configure --with-linux=/lib/modules/`uname -r`/build \
|
||||||
--prefix=/usr --localstatedir=/var # default to these libraries
|
--prefix=/usr --localstatedir=/var # default to these libraries
|
||||||
make -j
|
make -j
|
||||||
sudo make install
|
sudo make install
|
||||||
|
sudo make modules_install
|
||||||
sudo ovsdb-tool create /etc/openvswitch/conf.db \
|
sudo ovsdb-tool create /etc/openvswitch/conf.db \
|
||||||
vswitchd/vswitch.ovsschema
|
vswitchd/vswitch.ovsschema
|
||||||
|
sudo /usr/bin/ovs-vsctl --no-wait init
|
||||||
|
|
||||||
echo "start on (filesystem and net-device-up)
|
echo "start on (filesystem and net-device-up)
|
||||||
stop on runlevel [016]
|
stop on runlevel [016]
|
||||||
@ -45,17 +49,19 @@ respawn
|
|||||||
expect fork
|
expect fork
|
||||||
|
|
||||||
pre-start script
|
pre-start script
|
||||||
/sbin/insmod /opt/openvswitch/openvswitch/datapath/linux/openvswitch.ko
|
/sbin/modprobe openvswitch
|
||||||
|
/sbin/modprobe gre
|
||||||
mkdir -p /var/run/openvswitch/
|
mkdir -p /var/run/openvswitch/
|
||||||
end script
|
end script
|
||||||
|
|
||||||
script
|
script
|
||||||
exec /usr/sbin/ovsdb-server /etc/openvswitch/conf.db \\
|
exec /usr/sbin/ovsdb-server /etc/openvswitch/conf.db \\
|
||||||
--remote=punix:/var/run/openvswitch/db.sock \\
|
--remote=punix:/var/run/openvswitch/db.sock \\
|
||||||
--remote=db:Open_vSwitch,manager_options \\
|
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \\
|
||||||
--private-key=db:SSL,private_key \\
|
--private-key=db:Open_vSwitch,SSL,private_key \\
|
||||||
--certificate=db:SSL,certificate \\
|
--certificate=db:Open_vSwitch,SSL,certificate \\
|
||||||
--bootstrap-ca-cert=db:SSL,ca_cert --pidfile --detach --log-file
|
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \\
|
||||||
|
--pidfile --detach
|
||||||
end script
|
end script
|
||||||
|
|
||||||
# seems main script only allows one daemon, so we move another
|
# seems main script only allows one daemon, so we move another
|
||||||
@ -73,5 +79,6 @@ post-stop script
|
|||||||
end script
|
end script
|
||||||
" | sudo tee /etc/init/openvswitch.conf
|
" | sudo tee /etc/init/openvswitch.conf
|
||||||
sudo chmod 00755 /etc/init/openvswitch.conf
|
sudo chmod 00755 /etc/init/openvswitch.conf
|
||||||
sudo chown root:root /opt/openvswitch
|
sudo chown root:root /etc/init/openvswitch.conf
|
||||||
|
|
||||||
sudo service openvswitch start
|
sudo service openvswitch start
|
||||||
|
Loading…
Reference in New Issue
Block a user