-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
66 lines (52 loc) · 1.5 KB
/
install.sh
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
#!/bin/bash
# Copyright (C) 2015-2017 Amarisoft/LimeMicroSystems
# Install script version 2017-02-10
DIR=$(cd $(dirname $0) && pwd)
DST=$(cd $1 && pwd)
if [ ! -d "$DST" ] ; then
if [ "$DST" = "" ] ; then
echo "Usage:"
echo "> $0 <eNB path>"
else
echo "eNB directory '$DST' not found"
fi
exit 1
fi
# Check distrib
if [ -e "/etc/fedora-release" ]; then
version=$(cat /etc/fedora-release | cut -d " " -f3)
echo "Fedora $version found"
if [ "$version" -gt 20 ] ; then
install="dnf"
else
install="yum"
fi
PACKAGES="libusb-devel openssl-devel gcc"
$install list installed $PACKAGES 1>/dev/null
if [ "$?" != "0" ] ; then
$install install -q -y $PACKAGES 1>/dev/null
fi
else
version=$(grep -i -o -P "Ubuntu \d+" /etc/lsb-release | cut -d " " -f2)
if [ "$version" = "" ]; then
echo "Sorry, installation procedure only available on Fedora/Ubuntu distributions."
exit 1
fi
echo "Ubuntu v$version found"
apt-get -qq install -y libssl-dev libusb-1.0-0-dev 1>/dev/null
fi
# Compil
make -s -C ${DIR}
if [ "$?" = "0" ] ; then
strip ${DIR}/trx_lms7002m.so
rm -f ${DST}/trx_lms7002m.so
ln -s ${DIR}/trx_lms7002m.so ${DST}/trx_lms7002m.so
else
echo "Error while compiling trx driver"
fi
# Delete default files and copy configs
rm -Rf ${DST}/config/lms-sodera
rm -Rf ${DST}/config/lms-stream-unite7
cp -r ${DIR}/config-limeSDR/ ${DST}/config/limeSDR
${DST}/config/rf_select.sh limeSDR
exit 0