Project

General

Profile

Building OpenBSC » History » Version 37

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

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 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 csaba
</pre>
38 1 tec
39 37 msuraev
h4. Installation via packages
40 1 tec
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 37 msuraev
<pre>
43 37 msuraev
git clone git://git.osmocom.org/XXX
44 37 msuraev
cd XXX
45 37 msuraev
dpkg-buildpackage -uc -us -tc
46 37 msuraev
cd ..
47 37 msuraev
sudo dpkg -i *.deb
48 37 msuraev
</pre>
49 37 msuraev
50 35 csaba
h4. Building libosmocore
51 35 csaba
52 35 csaba
* Check out libosmocore from git using
53 1 tec
<pre>
54 35 csaba
git clone git://git.osmocom.org/libosmocore.git
55 35 csaba
</pre>
56 35 csaba
* Change into the right directory using
57 1 tec
<pre>
58 1 tec
cd libosmocore
59 35 csaba
</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 csaba
<pre>
62 1 tec
autoreconf -fi
63 35 csaba
</pre>
64 35 csaba
* Run the configure script using
65 35 csaba
<pre>
66 1 tec
./configure
67 35 csaba
</pre>
68 35 csaba
* Build the actual software using
69 35 csaba
<pre>
70 1 tec
make
71 35 csaba
</pre>
72 35 csaba
* Install the library by using
73 35 csaba
<pre>
74 1 tec
make install
75 35 csaba
</pre>
76 35 csaba
* Don't forget ldconfig:
77 35 csaba
<pre>
78 34 csaba
ldconfig
79 35 csaba
</pre>
80 1 tec
81 35 csaba
82 35 csaba
h4. Building libosmo-abis
83 35 csaba
84 35 csaba
85 35 csaba
* Check out libosmo-abis from git using
86 1 tec
<pre>
87 35 csaba
git clone git://git.osmocom.org/libosmo-abis.git
88 35 csaba
</pre>
89 35 csaba
* Change into the right directory using
90 1 tec
<pre>
91 17 laforge
cd libosmo-abis
92 35 csaba
</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 csaba
<pre>
95 19 zecke2
autoreconf -fi
96 35 csaba
</pre>
97 35 csaba
* Run the configure script using
98 35 csaba
<pre>
99 1 tec
./configure
100 35 csaba
</pre>
101 35 csaba
* Build the actual software using
102 35 csaba
<pre>
103 17 laforge
make
104 35 csaba
</pre>
105 35 csaba
* Install the library by using
106 35 csaba
<pre>
107 17 laforge
make install
108 35 csaba
</pre>
109 35 csaba
* Don't forget ldconfig:
110 35 csaba
<pre>
111 1 tec
ldconfig
112 35 csaba
</pre>
113 28 laforge
114 35 csaba
115 35 csaba
h4. Building libosmo-netif
116 35 csaba
117 35 csaba
118 35 csaba
* Check out libosmo-abis from git using
119 1 tec
<pre>
120 35 csaba
git clone git://git.osmocom.org/libosmo-netif.git
121 35 csaba
</pre>
122 1 tec
* Change into the right directory using
123 35 csaba
<pre>
124 1 tec
cd libosmo-netif
125 35 csaba
</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 csaba
<pre>
128 1 tec
autoreconf -fi
129 35 csaba
</pre>
130 35 csaba
* Run the configure script using
131 35 csaba
<pre>
132 1 tec
./configure
133 35 csaba
</pre>
134 35 csaba
* Build the actual software using
135 35 csaba
<pre>
136 1 tec
make
137 35 csaba
</pre>
138 35 csaba
* Install the library by using
139 35 csaba
<pre>
140 1 tec
make install
141 35 csaba
</pre>
142 35 csaba
* Don't forget ldconfig:
143 35 csaba
<pre>
144 35 csaba
ldconfig
145 18 laforge
</pre>
146 35 csaba
147 35 csaba
148 35 csaba
h4. Building [[OpenBSC]]
149 35 csaba
150 35 csaba
* Check out [[OpenBSC]] from git using
151 1 tec
<pre>
152 35 csaba
git clone git://git.osmocom.org/openbsc.git
153 1 tec
</pre>
154 35 csaba
* Change into the right directory using
155 35 csaba
<pre>
156 1 tec
cd openbsc/openbsc
157 35 csaba
</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 csaba
<pre>
160 1 tec
autoreconf -i
161 35 csaba
</pre>
162 35 csaba
* Point [[OpenBSC]] to the installation of libosmocore.
163 35 csaba
<pre>
164 17 laforge
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
165 35 csaba
</pre>
166 35 csaba
* Run the configure script using
167 35 csaba
<pre>
168 3 tec
./configure
169 35 csaba
</pre>
170 35 csaba
* Build the actual software using
171 35 csaba
<pre>
172 17 laforge
make
173 35 csaba
</pre>
174 14 laforge
175 35 csaba
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 csaba
* src/ipaccess/ipaccess-config (see [[ipaccess-config]])
178 35 csaba
* src/ipaccess/ipaccess-find (see [[ipaccess-find]])
179 35 csaba
* src/osmo-nitb/osmo-nitb (see [[osmo-nitb]])
180 11 laforge
181 11 laforge
To proceed from here, you typically would
182 35 csaba
* set-up your BTS (see [[BS11Getting_Started]] or [[nanoBTSGetting_Started]])
183 35 csaba
* configure and start [[osmo-nitb]]
184 17 laforge
185 11 laforge
186 35 csaba
h4. mISDN enabled kernel in case of E1 based BTS like BS-11
187 1 tec
188 1 tec
189 35 csaba
If you want to use a E1-based BTS (like the BS-11), you will need to install mISDN (or DAHDI).
190 1 tec
191 35 csaba
*If you have an IP/Ethernet based BTS (like the ip.access nanoBTS), you don't need this section!*
192 1 tec
193 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.
194 1 tec
195 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.
196 35 csaba
<pre>
197 35 csaba
198 25 laforge
Unpack the archive:
199 35 csaba
<pre>
200 25 laforge
tar --bzip2 -xvf linux-2.6.31.tar.bz2
201 35 csaba
</pre>
202 25 laforge
and create a symlink to fit the Linux standard conventions: 
203 35 csaba
<pre>
204 25 laforge
ln -s linux-2.6.30 linux
205 35 csaba
</pre>
206 26 laforge
207 26 laforge
Now change to linux-2.6.30 typing
208 35 csaba
<pre>
209 26 laforge
cd linux-2.6.30
210 35 csaba
</pre>
211 26 laforge
212 1 tec
You are ready now to prepare for the main part:
213 1 tec
214 1 tec
Install some tools needed to build the kernel.
215 1 tec
216 35 csaba
<pre>
217 1 tec
apt-get install libncurses5-dev kernel-package
218 35 csaba
</pre>
219 1 tec
220 1 tec
Now configure the kernel modules with
221 35 csaba
<pre>
222 1 tec
make menuconfig
223 35 csaba
</pre>
224 1 tec
225 35 csaba
Include the _mISDN_ modules and _hfcmulti / hfc e1 drivers_.
226 1 tec
227 35 csaba
Save the new configuration to *.config* .
228 1 tec
229 1 tec
You can now try to build the Debian kernel package:
230 35 csaba
<pre>
231 1 tec
make-kpkg linux-image --initrd --revision=openbsc01.0
232 35 csaba
</pre>
233 1 tec
234 1 tec
Go a directory higher
235 35 csaba
<pre>
236 1 tec
cd ..
237 35 csaba
</pre>
238 1 tec
239 1 tec
and install the new kernel package typing:
240 1 tec
241 35 csaba
<pre>
242 1 tec
dpkg -i  kernelpackagename.deb
243 35 csaba
</pre>
244 1 tec
245 1 tec
Now you only have to add the dslot=1 parameter for hfcmulti to load with this parameter.
246 35 csaba
Otherwise [[OpenBSC]] will talk on signalling timeslot 15 where BS11 uses 1.
247 1 tec
248 35 csaba
Simply add the following in */boot/grub/menu.lst* :
249 1 tec
250 1 tec
Add this line to the "Kernel"-line
251 1 tec
252 35 csaba
*hfcmulti.dslot=1*
253 1 tec
254 1 tec
Save changes and reboot your machine with your new kernel.
255 1 tec
256 1 tec
257 35 csaba
h4. DAHDI kernel in case of E1 based BTS like BS-11
258 35 csaba
259 35 csaba
260 1 tec
This is an alternative to the mISDN drivers.  For DAHDI installation, please check with the Asterisk / DAHDI homepage.
261 1 tec
262 35 csaba
<pre>
263 35 csaba
<pre>
264 1 tec
dchan=1
265 1 tec
bchan=2-30
266 35 csaba
</pre>
267 1 tec
268 35 csaba
<pre>
269 35 csaba
<pre>
270 1 tec
e1_input
271 1 tec
 e1_line 0 driver dahdi
272 35 csaba
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)