-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
187 lines (118 loc) · 6.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
=== WHAT IS THIS?
* quickly build the entire Osmocom core network stack from source, with a
generated top-level makefile (see the rest of this README file below).
* quickly configure, launch and tear down an entire Osmocom core network on
your box (see net/README).
=== Quick Start
sudo apt install \
build-essential gcc g++ make automake autoconf libtool pkg-config \
libtalloc-dev libpcsclite-dev libortp-dev libsctp-dev libssl-dev libdbi-dev \
libdbd-sqlite3 libsqlite3-dev libpcap-dev libc-ares-dev libgnutls28-dev \
libsctp-dev sqlite3 libusb-1.0-0-dev libmnl-dev libsofia-sip-ua-glib-dev
./gen_makefile.py default.opts iu.opts no_dahdi.opts -I -m make
cd make
make
- 'make' will ask for sudo password to run 'make install' and 'ldconfig'.
To run non-interactively:
- 'make install':
chown $USER: /usr/local
Then call gen_makefile.py once without the -I option
- 'ldconfig':
echo "$USER ALL= NOPASSWD: /sbin/ldconfig" > /etc/sudoers.d/ldconfig
=== gen_makefile.py
This provides a set of top-level makefiles to build variants of the Osmocom
source trees. It is inteded for the core network components and related
projects, but works generically.
The idea is to have all your Osmocom git clones in ./src, while keeping one or
more separate build trees in ./make-*.
Run ./gen_makefile.py with a choice of choice of configure options.
Examples:
CN with full 2G and 3G support:
./gen_makefile.py default.opts iu.opts -m make
cd make
make cn
Other make targets exist for specific use cases:
- 'usrp':
Build the CN, OsmoBSC, OsmoBTS and OsmoTRX (default, e.g. when connecting
to an USRP)
- 'cn-bsc':
Build the CN and OsmoBSC (e.g. when connecting to an external sysmoBTS)
- 'osmo-msc':
Build only the OsmoMSC project and its dependencies (this can be used for
any project in all.deps).
- '.make.osmo-ttcn3-hacks.clone'
Clone the osmo-ttcn3-hacks git repository (it cannot be built by osmo-dev,
but cloning it is still useful.)
If you make modifications in one of the source trees, this Makefile will pick
it up, rebuild the project and also rebuild all dependencies (according to
all.deps).
If you modify the all.deps or *.opts file, you can easily run 'make regen' in a
make-* subdir to regenerate the Makefile from the same files.
In your make-* subdir there are empty status files that are touched for every
completed make target. From these, 'make' can detect what needs to be rebuilt.
You can manually remove them to force a rebuild of a specific target.
For example, if you 'rm .make.libosmocore.autoconf', libosmocore and all
projects depending on libosmocore will be rebuilt from scratch.
For more details on the *.opts and all.deps syntax, read the docs at the top of
./gen_makefile.py.
It is also easily possible to keep sources and build trees in various
configurations, see the command line options of ./gen_makefile.py.
=== Install in /usr
By default, the Osmocom install prefix is /usr/local, while (currently) the
default systemd *.service files expect binaries installed in /usr/bin. To
install in /usr instead, use prefix_usr.opts, which sets --prefix=/usr.
=== Systemd Service Files
If you encounter problems installing *.service files, no_systemd.opts may help:
Systemd recommends installing service files in the distribution's single
service file location; that may sound sane, but if that location is
/lib/systemd/system, that means even a --prefix=/home/private/prefix ends up
trying to install service files system-wide in /lib/systemd/system, making all
attempts to install to a user-writable location fail.
no_systemd.opts disables installing *.service files.
=== Build Environment
For dependencies, see the "External dependencies" on:
https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source
If /usr/local/ is not writable by your user, pass the --sudo-make-install
option to gen_makefile.py above (a custom --prefix is not yet supported).
If your system doesn't have this by default, you will need:
export LD_LIBRARY_PATH="/usr/local/lib"
and
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
to your environment. To use the installed binaries after installation, also
export PATH="$PATH:/usr/local/bin"
=== osmo-uninstall.sh
Remove osmocom built binaries and headers from given prefix,
default is /usr/local.
=== src/*
Find other useful scripts in src/, see src/README.
=== ttcn3/ttcn3.sh
Run a given testsuite with docker, so it behaves exactly the same as when
jenkins runs it [1], but use osmo-dev to build all related Osmocom components
and the testsuite, and mount them inside the docker containers. After building
the docker containers for the first time (which takes rather long), this gives
short test cycles: just modify something, run the script again and the relevant
objects will be built directly, already built objects do not need to be
rebuilt. (This is a big speed improvement over just using docker containers as
you don't need to push your sources to a git server first, have the docker
containers fetch the git sources and build the modified component from scratch
again.)
The docker containers are used, so we don't have to maintain a second set of
configs which works without docker (that was tried before, and found not to be
feasible).
Example usage:
./ttcn3/ttcn3.sh mgw
IMAGE_SUFFIX=latest ./ttcn3/ttcn3.sh mgw
More about the testsuites:
https://osmocom.org/projects/cellular-infrastructure/wiki/Titan_TTCN3_Testsuites
Video explaining this script, related approaches and osmo-dev in general:
https://media.ccc.de/v/osmodevcall-20211210-osmith-osmo-dev-ttcn3
[1] https://jenkins.osmocom.org/jenkins/view/TTCN3/
=== ttcn3/tmux
It's possible to run TTCN-3 test cases without using Docker. This directory
contains scripts for starting a testsuite and the related binaries in a tmux
session. For example, ttcn3-bsc-test.sh does the following:
* Starts osmo-bsc, osmo-stp, and three instances of osmo-bts-omldummy.
* Prepares a command for execuring the test suite.
=== Troubleshooting
When using sanitize.opts, osmo-trx is not built with the address sanitizer
enabled. Linking a sanitizer-enabled libosmocore will not work.