Project

General

Profile

Building OpenBSC » History » Version 44

laforge, 03/23/2018 12:55 PM

1 35 csaba
{{>toc}}
2 1 tec
3 44 laforge
{{include(cellular-infrastructure:MacroLegacy)}}
4 44 laforge
5 41 wirelesss
bq. *Before you consider building from source, be aware that there are [[cellular-infrastructure:Nightly Builds]]
6 38 wirelesss
available for Debian + Ubuntu platforms. These are recommended for normal users.*
7 1 tec
8 38 wirelesss
9 35 csaba
h2. [[OpenBSC]] build guide
10 1 tec
11 35 csaba
This page will describe the entire installation process of [[OpenBSC]] under GNU/Linux.
12 35 csaba
13 1 tec
This tutorial is based on Debian Netinstall 5.0 but will work more or less the same with other GNU/Linux
14 1 tec
distributions.
15 1 tec
16 42 wirelesss
OpenBSC User Manual is available at: http://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf
17 1 tec
18 35 csaba
19 42 wirelesss
h3. Compiling + running [[OpenBSC]]
20 35 csaba
21 35 csaba
h4. Dependencies
22 35 csaba
23 35 csaba
24 35 csaba
Installing software that [[OpenBSC]] depends upon is distribution-dependent.  On Debian (or Debian-derived) systems,
25 1 tec
you should install the following Debian packages before you start:
26 41 wirelesss
27 35 csaba
* libdbi0
28 1 tec
* libdbi0-dev
29 41 wirelesss
* libdbi-dev
30 35 csaba
* libdbd-sqlite3
31 35 csaba
* libortp-dev
32 35 csaba
* build-essential
33 35 csaba
* libtool
34 1 tec
* autoconf
35 43 msuraev
* autoconf-archive
36 35 csaba
* automake
37 35 csaba
* git-core
38 1 tec
* pkg-config
39 41 wirelesss
* libtalloc-dev
40 41 wirelesss
* libpcsclite-dev 
41 41 wirelesss
* libpcap-dev
42 1 tec
(The list may be incomplete)
43 1 tec
44 1 tec
On Debian, you can install those packages with
45 35 csaba
<pre>
46 43 msuraev
sudo apt install libdbi-dev libdbd-sqlite3 libortp-dev build-essential libtool autoconf autoconf-archive automake git-core pkg-config libtalloc-dev libpcsclite-dev libpcap-dev
47 35 csaba
</pre>
48 1 tec
49 37 msuraev
h4. Installation via packages
50 1 tec
51 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:
52 37 msuraev
<pre>
53 37 msuraev
git clone git://git.osmocom.org/XXX
54 37 msuraev
cd XXX
55 37 msuraev
dpkg-buildpackage -uc -us -tc
56 37 msuraev
cd ..
57 35 csaba
sudo dpkg -i *.deb
58 1 tec
</pre>
59 38 wirelesss
60 1 tec
h4. Building 
61 35 csaba
62 41 wirelesss
Please follow instructions as per [[cellular-infrastructure:Build from Source]] to build following projects:
63 3 tec
64 38 wirelesss
* libosmocore
65 38 wirelesss
* libosmo-abis
66 38 wirelesss
* libosmo-netif
67 38 wirelesss
* openbsc
68 35 csaba
69 14 laforge
70 35 csaba
Congratulations, you should now have the [[OpenBSC]] programs like _[[osmo-nitb]]_, _ipaccess-config_ and others in the subdirectories of 'src/',
71 17 laforge
like
72 35 csaba
* src/ipaccess/ipaccess-config (see [[ipaccess-config]])
73 35 csaba
* src/ipaccess/ipaccess-find (see [[ipaccess-find]])
74 35 csaba
* src/osmo-nitb/osmo-nitb (see [[osmo-nitb]])
75 11 laforge
76 11 laforge
To proceed from here, you typically would
77 35 csaba
* set-up your BTS (see [[BS11Getting_Started]] or [[nanoBTSGetting_Started]])
78 35 csaba
* configure and start [[osmo-nitb]]
79 17 laforge
80 11 laforge
81 35 csaba
h4. mISDN enabled kernel in case of E1 based BTS like BS-11
82 1 tec
83 1 tec
84 35 csaba
If you want to use a E1-based BTS (like the BS-11), you will need to install mISDN (or DAHDI).
85 1 tec
86 35 csaba
*If you have an IP/Ethernet based BTS (like the ip.access nanoBTS), you don't need this section!*
87 1 tec
88 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.
89 1 tec
90 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.
91 35 csaba
92 1 tec
Unpack the archive:
93 39 wirelesss
94 35 csaba
<pre>
95 25 laforge
tar --bzip2 -xvf linux-2.6.31.tar.bz2
96 35 csaba
</pre>
97 25 laforge
and create a symlink to fit the Linux standard conventions: 
98 35 csaba
<pre>
99 25 laforge
ln -s linux-2.6.30 linux
100 35 csaba
</pre>
101 26 laforge
102 26 laforge
Now change to linux-2.6.30 typing
103 35 csaba
<pre>
104 26 laforge
cd linux-2.6.30
105 35 csaba
</pre>
106 26 laforge
107 1 tec
You are ready now to prepare for the main part:
108 1 tec
109 1 tec
Install some tools needed to build the kernel.
110 1 tec
111 35 csaba
<pre>
112 1 tec
apt-get install libncurses5-dev kernel-package
113 35 csaba
</pre>
114 1 tec
115 1 tec
Now configure the kernel modules with
116 35 csaba
<pre>
117 1 tec
make menuconfig
118 35 csaba
</pre>
119 1 tec
120 35 csaba
Include the _mISDN_ modules and _hfcmulti / hfc e1 drivers_.
121 1 tec
122 35 csaba
Save the new configuration to *.config* .
123 1 tec
124 1 tec
You can now try to build the Debian kernel package:
125 35 csaba
<pre>
126 1 tec
make-kpkg linux-image --initrd --revision=openbsc01.0
127 35 csaba
</pre>
128 1 tec
129 1 tec
Go a directory higher
130 35 csaba
<pre>
131 1 tec
cd ..
132 35 csaba
</pre>
133 1 tec
134 1 tec
and install the new kernel package typing:
135 1 tec
136 35 csaba
<pre>
137 1 tec
dpkg -i  kernelpackagename.deb
138 35 csaba
</pre>
139 1 tec
140 1 tec
Now you only have to add the dslot=1 parameter for hfcmulti to load with this parameter.
141 35 csaba
Otherwise [[OpenBSC]] will talk on signalling timeslot 15 where BS11 uses 1.
142 1 tec
143 35 csaba
Simply add the following in */boot/grub/menu.lst* :
144 1 tec
145 1 tec
Add this line to the "Kernel"-line
146 1 tec
147 35 csaba
*hfcmulti.dslot=1*
148 1 tec
149 1 tec
Save changes and reboot your machine with your new kernel.
150 1 tec
151 1 tec
152 35 csaba
h4. DAHDI kernel in case of E1 based BTS like BS-11
153 35 csaba
154 35 csaba
155 1 tec
This is an alternative to the mISDN drivers.  For DAHDI installation, please check with the Asterisk / DAHDI homepage.
156 1 tec
157 35 csaba
<pre>
158 1 tec
dchan=1
159 1 tec
bchan=2-30
160 35 csaba
</pre>
161 35 csaba
162 35 csaba
<pre>
163 1 tec
e1_input
164 1 tec
 e1_line 0 driver dahdi
165 35 csaba
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)