Browse Source

Upgrade scripts to install Open vSwtich 2.0.0

Change-Id: I69494725f9751c4a4e4a453ec50924d3f1d5a312
Changbin Liu 5 years ago
parent
commit
52c88b4844
1 changed files with 19 additions and 12 deletions
  1. 19
    12
      bin/pre_install_ovs.sh

+ 19
- 12
bin/pre_install_ovs.sh View File

@@ -1,17 +1,19 @@
1 1
 #!/bin/bash
2 2
 
3
-## Install Open vSwitch. This file is translated from
4
-## cookbook/openvswitch/recipes/default.
3
+## Install Open vSwitch (2.0.0). This file is translated from
4
+## cookbook/openvswitch/recipes/default
5 5
 
6 6
 # dependencies
7 7
 sudo apt-get -y install build-essential \
8 8
     git \
9 9
     autoconf \
10
+    python-dev \
10 11
     python-simplejson \
11 12
     python-qt4 \
12 13
     python-twisted-conch \
13 14
     uml-utilities \
14 15
     libtool \
16
+    libssl-dev \
15 17
     pkg-config
16 18
 
17 19
 sudo mkdir -p /opt/openvswitch
@@ -20,20 +22,22 @@ sudo chown root:root /opt/openvswitch
20 22
 
21 23
 sudo mkdir -p /etc/openvswitch
22 24
 sudo chmod 00755 /etc/openvswitch
23
-sudo chown root:root /opt/openvswitch
25
+sudo chown root:root /etc/openvswitch
24 26
 
25 27
 sudo chmod a+w /opt/openvswitch
26 28
 cd /opt/openvswitch
27
-git clone git://openvswitch.org/openvswitch
29
+wget http://openvswitch.org/releases/openvswitch-2.0.0.tar.gz
30
+tar xzvf openvswitch-2.0.0.tar.gz
31
+mv openvswitch-2.0.0 openvswitch
28 32
 cd openvswitch
29
-git checkout 3b6f2889400fd340b851c2d36356457559ae6e81
30
-./boot.sh
31 33
 ./configure --with-linux=/lib/modules/`uname -r`/build \
32 34
     --prefix=/usr --localstatedir=/var # default to these libraries
33 35
 make -j
34 36
 sudo make install
37
+sudo make modules_install
35 38
 sudo ovsdb-tool create /etc/openvswitch/conf.db \
36 39
     vswitchd/vswitch.ovsschema
40
+sudo /usr/bin/ovs-vsctl --no-wait init
37 41
 
38 42
 echo "start on (filesystem and net-device-up)
39 43
 stop on runlevel [016]
@@ -45,17 +49,19 @@ respawn
45 49
 expect fork
46 50
 
47 51
 pre-start script
48
-  /sbin/insmod /opt/openvswitch/openvswitch/datapath/linux/openvswitch.ko
52
+  /sbin/modprobe openvswitch
53
+  /sbin/modprobe gre
49 54
   mkdir -p /var/run/openvswitch/
50 55
 end script
51 56
 
52 57
 script
53 58
   exec /usr/sbin/ovsdb-server /etc/openvswitch/conf.db \\
54 59
         --remote=punix:/var/run/openvswitch/db.sock \\
55
-        --remote=db:Open_vSwitch,manager_options \\
56
-        --private-key=db:SSL,private_key \\
57
-        --certificate=db:SSL,certificate \\
58
-        --bootstrap-ca-cert=db:SSL,ca_cert --pidfile --detach --log-file
60
+        --remote=db:Open_vSwitch,Open_vSwitch,manager_options \\
61
+        --private-key=db:Open_vSwitch,SSL,private_key \\
62
+        --certificate=db:Open_vSwitch,SSL,certificate \\
63
+        --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \\
64
+        --pidfile --detach
59 65
 end script
60 66
 
61 67
 # seems main script only allows one daemon, so we move another
@@ -73,5 +79,6 @@ post-stop script
73 79
 end script
74 80
 " | sudo tee /etc/init/openvswitch.conf
75 81
 sudo chmod 00755 /etc/init/openvswitch.conf
76
-sudo chown root:root /opt/openvswitch
82
+sudo chown root:root /etc/init/openvswitch.conf
83
+
77 84
 sudo service openvswitch start

Loading…
Cancel
Save