Project

General

Profile

Building OpenBSC » History » Version 36

wirelesss, 10/20/2016 01:58 PM

1 35 csaba
{{>toc}}
2 1 tec
3 1 tec
4 35 csaba
h2. [[OpenBSC]] build guide
5 1 tec
6 35 csaba
7 35 csaba
This page will describe the entire installation process of [[OpenBSC]] under GNU/Linux.
8 35 csaba
9 1 tec
This tutorial is based on Debian Netinstall 5.0 but will work more or less the same with other GNU/Linux
10 1 tec
distributions.
11 1 tec
12 1 tec
13 35 csaba
h3. Compiling + running [[OpenBSC]]
14 1 tec
15 35 csaba
16 35 csaba
17 35 csaba
h4. Dependencies
18 35 csaba
19 35 csaba
20 35 csaba
Installing software that [[OpenBSC]] depends upon is distribution-dependent.  On Debian (or Debian-derived) systems,
21 1 tec
you should install the following Debian packages before you start:
22 35 csaba
* libdbi0
23 35 csaba
* libdbi0-dev
24 35 csaba
* libdbd-sqlite3
25 35 csaba
* libortp-dev
26 35 csaba
* build-essential
27 35 csaba
* libtool
28 35 csaba
* autoconf
29 35 csaba
* automake
30 35 csaba
* git-core
31 35 csaba
* pkg-config
32 1 tec
(The list may be incomplete)
33 1 tec
34 1 tec
On Debian, you can install those packages with
35 35 csaba
<pre>
36 36 wirelesss
apt-get install libdbi0-dev libdbd-sqlite3 build-essential libtool autoconf automake git-core pkg-config libortp-dev libtalloc-dev
37 35 csaba
</pre>
38 1 tec
39 35 csaba
40 35 csaba
h4. Building libosmocore
41 35 csaba
42 35 csaba
* Check out libosmocore from git using
43 35 csaba
<pre>
44 1 tec
git clone git://git.osmocom.org/libosmocore.git
45 35 csaba
</pre>
46 35 csaba
* Change into the right directory using
47 35 csaba
<pre>
48 1 tec
cd libosmocore
49 35 csaba
</pre>
50 35 csaba
* Rebuild the configure script using
51 35 csaba
<pre>
52 1 tec
autoreconf -fi
53 35 csaba
</pre>
54 35 csaba
* Run the configure script using
55 35 csaba
<pre>
56 1 tec
./configure
57 35 csaba
</pre>
58 35 csaba
* Build the actual software using
59 35 csaba
<pre>
60 1 tec
make
61 35 csaba
</pre>
62 35 csaba
* Install the library by using
63 35 csaba
<pre>
64 1 tec
make install
65 35 csaba
</pre>
66 35 csaba
* Don't forget ldconfig:
67 35 csaba
<pre>
68 34 csaba
ldconfig
69 35 csaba
</pre>
70 1 tec
71 1 tec
72 35 csaba
h4. Building libosmo-abis
73 35 csaba
74 35 csaba
75 35 csaba
* Check out libosmo-abis from git using
76 35 csaba
<pre>
77 1 tec
git clone git://git.osmocom.org/libosmo-abis.git
78 35 csaba
</pre>
79 35 csaba
* Change into the right directory using
80 35 csaba
<pre>
81 17 laforge
cd libosmo-abis
82 35 csaba
</pre>
83 35 csaba
* Rebuild the configure script using
84 35 csaba
<pre>
85 19 zecke2
autoreconf -fi
86 35 csaba
</pre>
87 35 csaba
* Run the configure script using
88 35 csaba
<pre>
89 1 tec
./configure
90 35 csaba
</pre>
91 35 csaba
* Build the actual software using
92 35 csaba
<pre>
93 17 laforge
make
94 35 csaba
</pre>
95 35 csaba
* Install the library by using
96 35 csaba
<pre>
97 17 laforge
make install
98 35 csaba
</pre>
99 35 csaba
* Don't forget ldconfig:
100 35 csaba
<pre>
101 1 tec
ldconfig
102 35 csaba
</pre>
103 28 laforge
104 28 laforge
105 35 csaba
h4. Building libosmo-netif
106 35 csaba
107 35 csaba
108 35 csaba
* Check out libosmo-abis from git using
109 35 csaba
<pre>
110 1 tec
git clone git://git.osmocom.org/libosmo-netif.git
111 35 csaba
</pre>
112 35 csaba
* Change into the right directory using
113 35 csaba
<pre>
114 1 tec
cd libosmo-netif
115 35 csaba
</pre>
116 35 csaba
* Rebuild the configure script using
117 35 csaba
<pre>
118 1 tec
autoreconf -fi
119 35 csaba
</pre>
120 35 csaba
* Run the configure script using
121 35 csaba
<pre>
122 1 tec
./configure
123 35 csaba
</pre>
124 35 csaba
* Build the actual software using
125 35 csaba
<pre>
126 1 tec
make
127 35 csaba
</pre>
128 35 csaba
* Install the library by using
129 35 csaba
<pre>
130 1 tec
make install
131 35 csaba
</pre>
132 35 csaba
* Don't forget ldconfig:
133 35 csaba
<pre>
134 17 laforge
ldconfig
135 35 csaba
</pre>
136 18 laforge
137 35 csaba
138 35 csaba
h4. Building [[OpenBSC]]
139 35 csaba
140 35 csaba
* Check out [[OpenBSC]] from git using
141 35 csaba
<pre>
142 1 tec
git clone git://git.osmocom.org/openbsc.git
143 35 csaba
</pre>
144 35 csaba
* Change into the right directory using
145 35 csaba
<pre>
146 1 tec
cd openbsc/openbsc
147 35 csaba
</pre>
148 35 csaba
* Rebuild the configure script using 
149 35 csaba
<pre>
150 1 tec
autoreconf -i
151 35 csaba
</pre>
152 35 csaba
* Point [[OpenBSC]] to the installation of libosmocore.
153 35 csaba
<pre>
154 17 laforge
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
155 35 csaba
</pre>
156 35 csaba
* Run the configure script using
157 35 csaba
<pre>
158 3 tec
./configure
159 35 csaba
</pre>
160 35 csaba
* Build the actual software using
161 35 csaba
<pre>
162 17 laforge
make
163 35 csaba
</pre>
164 14 laforge
165 35 csaba
Congratulations, you should now have the [[OpenBSC]] programs like _[[osmo-nitb]]_, _ipaccess-config_ and others in the subdirectories of 'src/',
166 17 laforge
like
167 35 csaba
* src/ipaccess/ipaccess-config (see [[ipaccess-config]])
168 35 csaba
* src/ipaccess/ipaccess-find (see [[ipaccess-find]])
169 35 csaba
* src/osmo-nitb/osmo-nitb (see [[osmo-nitb]])
170 11 laforge
171 11 laforge
To proceed from here, you typically would
172 35 csaba
* set-up your BTS (see [[BS11Getting_Started]] or [[nanoBTSGetting_Started]])
173 35 csaba
* configure and start [[osmo-nitb]]
174 17 laforge
175 11 laforge
176 35 csaba
h4. mISDN enabled kernel in case of E1 based BTS like BS-11
177 1 tec
178 1 tec
179 35 csaba
If you want to use a E1-based BTS (like the BS-11), you will need to install mISDN (or DAHDI).
180 1 tec
181 35 csaba
*If you have an IP/Ethernet based BTS (like the ip.access nanoBTS), you don't need this section!*
182 1 tec
183 35 csaba
Because [[OpenBSC]]'s E1 support relies on mISDN (named ISDN4Linux before) and hfcmulti as an interface to the BS11, it has to be integrated as a module into the kernel.
184 1 tec
185 35 csaba
First of all you will need to download the 2.6.31 Linux kernel from "Change to */usr/src/* on your [[OpenBSC]] machine.
186 35 csaba
<pre>
187 35 csaba
188 25 laforge
Unpack the archive:
189 35 csaba
<pre>
190 25 laforge
tar --bzip2 -xvf linux-2.6.31.tar.bz2
191 35 csaba
</pre>
192 25 laforge
and create a symlink to fit the Linux standard conventions: 
193 35 csaba
<pre>
194 25 laforge
ln -s linux-2.6.30 linux
195 35 csaba
</pre>
196 26 laforge
197 26 laforge
Now change to linux-2.6.30 typing
198 35 csaba
<pre>
199 26 laforge
cd linux-2.6.30
200 35 csaba
</pre>
201 26 laforge
202 1 tec
You are ready now to prepare for the main part:
203 1 tec
204 1 tec
Install some tools needed to build the kernel.
205 1 tec
206 35 csaba
<pre>
207 1 tec
apt-get install libncurses5-dev kernel-package
208 35 csaba
</pre>
209 1 tec
210 1 tec
Now configure the kernel modules with
211 35 csaba
<pre>
212 1 tec
make menuconfig
213 35 csaba
</pre>
214 1 tec
215 35 csaba
Include the _mISDN_ modules and _hfcmulti / hfc e1 drivers_.
216 1 tec
217 35 csaba
Save the new configuration to *.config* .
218 1 tec
219 1 tec
You can now try to build the Debian kernel package:
220 35 csaba
<pre>
221 1 tec
make-kpkg linux-image --initrd --revision=openbsc01.0
222 35 csaba
</pre>
223 1 tec
224 1 tec
Go a directory higher
225 35 csaba
<pre>
226 1 tec
cd ..
227 35 csaba
</pre>
228 1 tec
229 1 tec
and install the new kernel package typing:
230 1 tec
231 35 csaba
<pre>
232 1 tec
dpkg -i  kernelpackagename.deb
233 35 csaba
</pre>
234 1 tec
235 1 tec
Now you only have to add the dslot=1 parameter for hfcmulti to load with this parameter.
236 35 csaba
Otherwise [[OpenBSC]] will talk on signalling timeslot 15 where BS11 uses 1.
237 1 tec
238 35 csaba
Simply add the following in */boot/grub/menu.lst* :
239 1 tec
240 1 tec
Add this line to the "Kernel"-line
241 1 tec
242 35 csaba
*hfcmulti.dslot=1*
243 1 tec
244 1 tec
Save changes and reboot your machine with your new kernel.
245 1 tec
246 1 tec
247 35 csaba
h4. DAHDI kernel in case of E1 based BTS like BS-11
248 35 csaba
249 35 csaba
250 1 tec
This is an alternative to the mISDN drivers.  For DAHDI installation, please check with the Asterisk / DAHDI homepage.
251 1 tec
252 35 csaba
<pre>
253 35 csaba
<pre>
254 1 tec
dchan=1
255 1 tec
bchan=2-30
256 35 csaba
</pre>
257 1 tec
258 35 csaba
<pre>
259 35 csaba
<pre>
260 1 tec
e1_input
261 1 tec
 e1_line 0 driver dahdi
262 35 csaba
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)