Project

General

Profile

Building OpenBSC » History » Version 39

wirelesss, 12/07/2016 01:31 PM

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