aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-06-12 18:34:13 +0200
committerMax <msuraev@sysmocom.de>2017-06-15 11:34:21 +0200
commit1f512a6b25b515005456320b8f0e4780b44d1364 (patch)
tree2fc26ed249e7be13699afa816a9dc9fb88103ff0
parent01bda4369bbe08d58c3a9d98065c1d07f7e94ddf (diff)
Add script for fetching BTS-specific L1 headers
Several of the supported BTS models require hw-specific L1 headers for compilation which are stored in separate repository. Instead of copy-pasting code which obtains those header for each BTS it's better to create separate script. Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0 Related: SYS#3682
-rwxr-xr-xscripts/osmo-layer1-headers.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 0000000..b2372d4
--- /dev/null
+++ b/scripts/osmo-layer1-headers.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# -e: fail if any of the subsequent commands fail
+# -x: trace each executed command via debug log
+set -e -x
+
+# Usage:
+# ./osmo-layer1-headers.sh sysmo superfemto_v5.1
+# where 'sysmo' is BTS type and 'superfemto_v5.1' is version specifier (tag or branch for git reset)
+# 2nd parameter is optional and defaults to latest master branch
+
+case "$1" in
+ sysmo)
+ uri="git://git.sysmocom.de/sysmo-bts/layer1-api"
+ version="origin/master"
+ ;;
+ oct)
+ uri="git://git.osmocom.org/octphy-2g-headers"
+ version="origin/master"
+ ;;
+ lc15)
+ uri="https://gitlab.com/nrw_litecell15/litecell15-fw"
+ version="nrw/litecell15-next"
+ ;;
+ *)
+ echo "Unknown BTS model '$1'"
+ exit 1
+ ;;
+esac
+
+# if 2nd parameter was specified and it's not 'master' then use it instead of default
+if [ -n "$2" ]
+then
+ if [ "$2" != "master" ]
+ then
+ version=$2
+ fi
+fi
+
+if ! test -d layer1-headers;
+then
+ git clone "$uri" layer1-headers
+fi
+
+cd layer1-headers
+git fetch origin
+git reset --hard "$version"