From 68a2915ae45a03a34ff7dc72c04c67ce5b306af1 Mon Sep 17 00:00:00 2001 From: George Paitaris Date: Thu, 18 Oct 2018 16:55:23 +0300 Subject: [PATCH 1/4] Adding Boost C++ dependency --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 0f5622a..aa2c779 100755 --- a/build.sh +++ b/build.sh @@ -6,12 +6,12 @@ # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # See the COPYING file in the main directory for details. @@ -115,6 +115,7 @@ installIfMissing libreadline-dev installIfMissing libncurses5 installIfMissing libncurses5-dev installIfMissing pkg-config +installIfMissing libboost-all-dev # libsqliteodbc deps installIfMissing cdbs installIfMissing libsqlite0-dev From 89ed8dad93e0dc2f575313ac2712040aeaf255a5 Mon Sep 17 00:00:00 2001 From: George Paitaris Date: Thu, 18 Oct 2018 16:58:19 +0300 Subject: [PATCH 2/4] Systemd configuration for openbts, asterisk, sipauthserve, smqueue --- .../asterisk.service | 16 ++++++++++++++++ .../openbts.service | 10 ++++++++++ .../sipauthserve.service | 9 +++++++++ .../smqueue.service | 9 +++++++++ 4 files changed, 44 insertions(+) create mode 100644 systemd-service-units-configuration/asterisk.service create mode 100644 systemd-service-units-configuration/openbts.service create mode 100644 systemd-service-units-configuration/sipauthserve.service create mode 100644 systemd-service-units-configuration/smqueue.service diff --git a/systemd-service-units-configuration/asterisk.service b/systemd-service-units-configuration/asterisk.service new file mode 100644 index 0000000..edafd85 --- /dev/null +++ b/systemd-service-units-configuration/asterisk.service @@ -0,0 +1,16 @@ +[Unit] +Description=Asterisk PBX for OpenBTS +After=network.target +Documentation=man:asterisk(8) + +[Service] +Type=simple +Environment=statedir=/var/run/asterisk +Environment=LC_ALL=C +ExecStartPre=/bin/mkdir -p ${statedir} +ExecStart=/usr/sbin/asterisk -f -g +ExecStop=/usr/sbin/asterisk -rx 'core stop now' +ExecReload=/usr/sbin/asterisk -rx 'core reload' + +[Install] +WantedBy=multi-user.target diff --git a/systemd-service-units-configuration/openbts.service b/systemd-service-units-configuration/openbts.service new file mode 100644 index 0000000..719f2e1 --- /dev/null +++ b/systemd-service-units-configuration/openbts.service @@ -0,0 +1,10 @@ +[Unit] +Description=OpenBTS + +[Service] +Type=simple +ExecStart=/OpenBTS/OpenBTS +WorkingDirectory=/OpenBTS + +[Install] +WantedBy=multi-user.target diff --git a/systemd-service-units-configuration/sipauthserve.service b/systemd-service-units-configuration/sipauthserve.service new file mode 100644 index 0000000..18b5d4d --- /dev/null +++ b/systemd-service-units-configuration/sipauthserve.service @@ -0,0 +1,9 @@ +[Unit] +Description=OpenBTS SIP Authorization Service + +[Service] +Type=simple +ExecStart=/OpenBTS/sipauthserve + +[Install] +WantedBy=multi-user.target diff --git a/systemd-service-units-configuration/smqueue.service b/systemd-service-units-configuration/smqueue.service new file mode 100644 index 0000000..3d4f448 --- /dev/null +++ b/systemd-service-units-configuration/smqueue.service @@ -0,0 +1,9 @@ +[Unit] +Description=OpenBTS Store-and-Forward Short Message Service + +[Service] +Type=simple +ExecStart=/OpenBTS/smqueue + +[Install] +WantedBy=multi-user.target From aa429403c53c562a56b2c5090428d2f3dee2eea9 Mon Sep 17 00:00:00 2001 From: George Paitaris Date: Thu, 18 Oct 2018 17:01:25 +0300 Subject: [PATCH 3/4] builds and installs, tested with B210 and N210 on Ubuntu 16.04 LTS on amd64 --- build-and-install.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 build-and-install.sh diff --git a/build-and-install.sh b/build-and-install.sh new file mode 100755 index 0000000..fadca9b --- /dev/null +++ b/build-and-install.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +source $(dirname $0)/common.source + +SDR=$1 +ROOT=`pwd` + +usage () { + echo "# - Usage: $0 radio-type" + echo "# - Valid radio types are: SDR1, USRP1, B100, B110, B200, B210, N200, N210" + exit 1 +} + +if [ "$EUID" -ne 0 ] + then echo "# - $(whoami) please run me as root" + # sudo $0 $SDR + exit 1 +fi + +if [ -z "$SDR" ]; then + echo "# - ERROR : radio type must be specified" + usage + exit 1 +fi + +./clone.sh +./build.sh $SDR asterisk +./build.sh $SDR liba53 + +cd ${ROOT}/libcoredumper +./build.sh LOCAL +sayAndDo "dpkg -i libcoredumper1_1.2.1-1_*.deb" +sayAndDo "dpkg -i libcoredumper-dev_1.2.1-1_*.deb" + +cd $ROOT +./build.sh $SDR subscriberRegistry +./build.sh $SDR smqueue +./build.sh $SDR openbts +./build.sh $SDR asterisk-config + +sayAndDo "find BUILDS -name range-asterisk_11.7.0.5_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name liba53_0.1_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name smqueue_5.0_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name openbts_5.0_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name range-asterisk-config_5.0_all.deb -exec dpkg -i {} \;" + +sayAndDo cp systemd-service-units-configuration/asterisk.service /etc/systemd/system/ +sayAndDo cp systemd-service-units-configuration/sipauthserve.service /etc/systemd/system/ +sayAndDo cp systemd-service-units-configuration/smqueue.service /etc/systemd/system/ +sayAndDo cp systemd-service-units-configuration/openbts.service /etc/systemd/system/ +sayAndDo systemctl daemon-reload + +sayAndDo cp ./NodeManager/nmcli.py /OpenBTS/ +sayAndDo chown -R asterisk:www-data /var/lib/asterisk + +exit 0 From b92dc791e56ad80640262453aea2a7dc379d3bb7 Mon Sep 17 00:00:00 2001 From: George Paitaris Date: Sat, 20 Oct 2018 10:46:55 +0300 Subject: [PATCH 4/4] to sign --- build-and-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-and-install.sh b/build-and-install.sh index fadca9b..ce43e7d 100755 --- a/build-and-install.sh +++ b/build-and-install.sh @@ -12,7 +12,7 @@ usage () { } if [ "$EUID" -ne 0 ] - then echo "# - $(whoami) please run me as root" + then echo "# - $(whoami) please run ${0}(me) as root" # sudo $0 $SDR exit 1 fi