forked from CentecNetworks/Lantern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD-GUIDE
162 lines (122 loc) · 6.71 KB
/
BUILD-GUIDE
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
How to Build and Install VCOS And OVS Package
=============================================
This document describes how to build and install Centec Openflow Switching System
for hardware V330 52TX-RD.
it includes 1. How to build basic Virtual Centec Operating System (VCOS) image
2. How to install Debian Linux
3. How to build and install Open vSwitch(OVS) package
Build Requirements
------------------
To compile the VCOS distribution, you will need the following system and software:
- Linux host 2.6.X (x86) (If you want to build Debian Linux system yourself,
Ubuntu/Debian linux host is recommended)
- A make program, eg. GNU make
- The GNU Toolchain 4.7.3 (cross toolchain for MIPS)
We have tested with Sourcery CodeBench Lite 2013.05-66. for mips
(http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/mips-gnu-linux.html)
You may refer to Mentor Graphics (www.mentor.com) for more details.
- Install the LZMA compression tool
We have tested with lzma 4.32.7.
(LZMA SDK which can be found from http://7-zip.org/sdk.html
lzma command line tool was written by Ville Koskinen. http://tukaani.org/lzma/)
Source code overview
--------------------
The source code tree is organized and listed below:
top -
| ARCH architecture design document for openflow
| CHANGES change Logs
| README.md readme
| configure.sh configuration script
| BUILD-GUIDE build and installation document
| LICENSE license
| Makefile makefile
| Makefile.package list all files that will be packaged into the image
+ adapt Centec adaptation layer source code for openflow
+ debian config files and prepared rootfs for installing Debian system
+ docs user guide, sdk document etc.
+ include global header files
+ lib libraries
+ mk common makefiles
+ ovs open vswitch(ovs) source code
+ platform linux and busybox source code
+ prebuilt pre-built binaries and libraries
+ sdk Centec SDK
+ third_party third-party header files
+ out output binaries and images will be put here after user built the system
Building the basic VCOS image
-----------------------------
Once you have prepared the required building host, software and Centec VCOS distribution,
you may follow the procedures below to build the
basic Linux image:
1. Configure the building environment, run script: configure.sh under the source directory: 'top'
% chmod +x ./configure.sh
% ./configure.sh -p /home/centec/mips/mips-2013.05
Usage: ./configure.sh :
-p path, specify absolute path for toolchain
-g path, specify glibc path relative to the toolchain path (must be 32bit glibc, default is mips-linux-gnu/libc/lib)
-c prefix, specify crosscompile prefix(default is mips-linux-gnu-)
-j number, specify compile speed
-d , _V330_DEBUG version
2. Run make in the top directory:
% make
or
% make all
On successful compilation, the final image will be named 'VCOS-1.0.bin', located in the 'out' directory.
Note:
1. a pre-built image is prepared for user if you don't want to build the image yourself.
The pre-built image is located in 'prebuilt/image/VCOS-1.0.bin"
2. By default, the root account is created in the pre-built image:
user name: root
password : centec
Installing Debian Linux
------------------------------------
The Centec VCOS is able to boot from Debian Linux system rather than the basic Linux system,
this gives user great flexibility to customize the switch operating system and able to
install/run your own software.
A prepared Debian Linux rootfs (created by tool 'debootstrap' based on Debian 7.2)
is located in 'top/debian/rootfs.tar.gz' (Due to GitHub single file 100Mb limit, we put this
file to dropbox, you can download it from https://www.dropbox.com/s/rx8ex9lve2fmafd/rootfs.tar.gz),
user need to untar the rootfs file into a USB storage (mounting on '/mnt/udisk' on the switch).
% tar zxvf rootfs.tar.gz
Note:
1. The file system of USB storage must be in ext3 format.
2. Files extracted from the rootfs file must be located in the root directory of USB storage.
3. If you want to start the Debian Linux from USB storage on switch, you need
to boot from basic Linux system first, and create a boot flag file 'debian_from_udisk'
in on-board flash (mounting on '/mnt/flash'), then reboot.
eg.
% touch /mnt/flash/debian_from_udisk
Please refer to V330 52TX-RD hardware installation guide for details of
how to boot the system image.
4. By default, we have created two accounts in the prepared Debian system package:
user name: root
password : centec
user name: centec
password : centec
Building and installing Open vSwitch(OVS) package
-------------------------------------------------
You may follow the procedures below to build Open vSwitch running on Debian system:
1. Configure the building environment, run script: configure.sh under the source directory: 'top'
(You may skip this step if you have done it before)
% chmod +x ./configure.sh
% ./configure.sh -p /home/centec/mips/mips-2013.05
Usage: ./configure.sh :
-p path, specify absolute path for toolchain
-g path, specify glibc path relative to the toolchain path (must be 32bit glibc, default is mips-linux-gnu/libc/lib)
-c prefix, specify crosscompile prefix(default is mips-linux-gnu-)
-j number, specify compile speed
-d , _V330_DEBUG version
2. Run make in the 'top' directory:
% make ovs_package
On successful compilation, the ovs package will be named 'open_vswitch.tar.gz',
located in the 'out' directory.
3. To install the ovs package on Debian, you should copy the ovs package to the
switch and boot from Debian system, then:
Untar the ovs package in switch:
% tar xzvf open_vswitch.tar.gz
Get into the directory of extracted package:
% cd open_vswitch
Run the installation script:
% ./install_ovs.sh
On successful installation, the ovs tools will be installed in directory '/usr/local/openvswitch',
and ovs will be run automatically on next boot.