Project

General

Profile

Building OpenBSC » History » Version 30

ahuemer, 02/19/2016 10:47 PM

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