-
Notifications
You must be signed in to change notification settings - Fork 16
/
start-ovs-deb.sh
95 lines (88 loc) · 2.86 KB
/
start-ovs-deb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
echo "Removing old ovs configuration."
sudo /etc/init.d/openvswitch-switch stop
sudo kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid`
sudo rm -rf /usr/local/var/run/openvswitch
sudo mkdir -p /usr/local/var/run/openvswitch
sudo rm -rf /usr/local/etc/openvswitch
sudo mkdir -p /usr/local/etc/openvswitch
sudo rm -rf /var/run/openvswitch
sudo mkdir -p /var/run/openvswitch
sudo rm -rf /etc/openvswitch
sudo mkdir -p /etc/openvswitch
sudo rm -rf /var/log/openvswitch
sudo mkdir -p /var/log/openvswitch
sudo rmmod openvswitch
sudo rmmod gre
sudo rmmod vxlan
sudo rmmod libcrc32c
sudo rmmod openvswitch
sudo dpkg --force-all --purge openvswitch-switch
sudo dpkg --force-all --purge openvswitch-common
sudo dpkg --force-all --purge openvswitch-datapath-dkms
sudo rm /tmp/ovsdb.txt
touch /tmp/ovsdb.txt
sudo rm /tmp/vswitch.txt
touch /tmp/vswitch.txt
git clone https://github.com/openvswitch/ovs.git
git clone https://github.com/yyang13/ovs_nsh_patches.git
cd ovs
git config user.email "[email protected]"
git config user.name "Yi Yang"
git reset --hard 7d433ae57ebb90cd68e8fa948a096f619ac4e2d8
git am ../ovs_nsh_patches/*.patch
make clean
./boot.sh
./configure --with-linux=/lib/modules/`uname -r`/build
sudo make uninstall
sudo apt-get install -y build-essential
sudo apt-get install -y fakeroot
sudo apt-get install -y debhelper
sudo apt-get install -y autoconf
sudo apt-get install -y automake
sudo apt-get install -y libssl-dev
sudo apt-get install -y bzip2
sudo apt-get install -y openssl
sudo apt-get install -y graphviz
sudo apt-get install -y python-all
sudo apt-get install -y procps
sudo apt-get install -y python-qt4
sudo apt-get install -y python-zopeinterface
sudo apt-get install -y python-twisted-conch
sudo apt-get install -y libtool
sudo apt-get install -y dh-autoreconf
echo "Checking Build Dependencies."
sudo dpkg-checkbuilddeps
if [ $? -gt 0 ]; then
echo "ERROR:Build Dependencies not met."
exit 1
fi
echo "Creating Debian Packages."
rm ../openvswitch-*.deb
rm ../python-openvswitch*.deb
DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
if [ $? -gt 0 ]; then
echo "ERROR:Creating Debian packages failed."
exit 1
fi
echo "Installing kernel module using dkms."
sudo apt-get install -y linux-headers-`uname -r`
sudo apt-get install -y dkms
sudo dpkg --install ../openvswitch-datapath-dkms*
if [ $? -gt 0 ]; then
echo "ERROR:Installing openvswitch kernel module failed."
exit 1
fi
echo "Installing openvswitch userland packages."
sudo dpkg --install ../openvswitch-common*
sudo dpkg --install ../openvswitch-switch*
if [ $? -gt 0 ]; then
echo "ERROR:Installing openvswitch userland packages failed."
exit 1
fi
sudo /etc/init.d/openvswitch-switch restart
sudo lsmod | grep -i open
sudo update-rc.d -f openvswitch-switch remove
sudo update-rc.d openvswitch-switch defaults
sudo ovs-vsctl show
echo "Install Complete!"