Project

General

Profile

Building OpenBSC » History » Version 37

msuraev, 11/25/2016 02:56 PM
add .deb-specific instructions

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