[MERGED] osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-19 Thread Max
Max has submitted this change and it was merged.

Change subject: Add script for fetching BTS-specific L1 headers
..


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
---
A scripts/osmo-layer1-headers.sh
1 file changed, 47 insertions(+), 0 deletions(-)

Approvals:
  Max: Verified
  Harald Welte: Looks good to me, approved



diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 000..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"

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 5
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-19 Thread Max

Patch Set 5: Verified+1

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 5
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-18 Thread Neels Hofmeyr

Patch Set 5:

> > osmo-gsm-tester scripts don't use osmo-ci
 > 
 > So why you've comment in another patch that "each is still callable
 > on its own" in the context of osmo-gsm-tester and jenkins_* helpers
 > in osmo-bts? Those are using osmo-ci.

I don't get your question? I hope the reasons why I comment are clear. I can 
only try to read a real question in this comment.

osmo-ci.git is about our "internal" jenkins.osmocom.org setup. You mentioned 
the osmo-gsm-tester in above comment, after I asked you which users you intend 
to benefit from this patch; hence I decided to point out that the tester is so 
far kept separate from osmocom's "internal" jenkins setup on purpose, doesn't 
use osmo-ci and probably won't ever (it is intended to run on anyone's jenkins, 
not only ours; installation is easier when those scripts don't need osmo-ci; if 
we change our jenkins setup, other peoples' jenkins should remain independent, 
so that we don't need to worry about them in osmo-ci).

And true, I want the osmo-ci bts build scripts to still be callable on their 
own, not necessarily needing the bts_model.sh script, which is an unrelated 
fact to anything else, and frankly not too much to ask.

Anything still unclear?

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 5
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-18 Thread Harald Welte

Patch Set 5: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 5
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-14 Thread Neels Hofmeyr

Patch Set 4: Code-Review+1

(1 comment)

(btw, osmo-gsm-tester scripts don't use osmo-ci, to be self-contained in 
osmo-gsm-tester.git)

https://gerrit.osmocom.org/#/c/2893/4/scripts/osmo-layer1-headers.sh
File scripts/osmo-layer1-headers.sh:

Line 31: # if 2nd parameter was specified and it's not 'master' than use it 
instead of default
"then"


-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 4
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: Yes


[PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-13 Thread Max
Hello Neels Hofmeyr,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2893

to look at the new patch set (#3).

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
---
A scripts/osmo-layer1-headers.sh
1 file changed, 46 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/3

diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 000..720c7a7
--- /dev/null
+++ b/scripts/osmo-layer1-headers.sh
@@ -0,0 +1,46 @@
+#!/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' than use it instead of 
default
+if [ -n "$2" ]
+   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

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-13 Thread Max

Patch Set 2:

osmo-pcu could use it too. Initially I though it'd be called from 
jenkins_bts_model.sh regardless of a model, but to keep it compatible with 
osmo-gsm-tester it'll be called from per-BTS scripts so I'll adjust error code.

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-13 Thread Neels Hofmeyr

Patch Set 2: Code-Review+1

(1 comment)

There is a benefit in avoiding code dup, but there is also a benefit in having 
a plain self-contained script and less code complexity. I would be fine with 
the minimal amount of copy-paste we have, but ok.

What users do you have in mind? osmo-bts.git or others as well?

https://gerrit.osmocom.org/#/c/2893/2/scripts/osmo-layer1-headers.sh
File scripts/osmo-layer1-headers.sh:

Line 28:exit 0
unless we already have such model that does not require headers, IMHO this 
should rather exit 1


-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: Yes


[PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-12 Thread Max

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
---
A scripts/osmo-layer1-headers.sh
1 file changed, 47 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/2

diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 000..0f3b6c8
--- /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'"
+   # we assume that unknown BTS model do not require L1 headers
+   exit 0
+   ;;
+esac
+
+# if 2nd parameter was specified and it's not 'master' than use it instead of 
default
+if [ -n "$2" ]
+   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

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: neels 


[PATCH] osmo-ci[master]: Add script for fetching BTS-specific L1 headers

2017-06-12 Thread Max

Review at  https://gerrit.osmocom.org/2893

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
---
A scripts/osmo-layer1-headers.sh
1 file changed, 46 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/2893/1

diff --git a/scripts/osmo-layer1-headers.sh b/scripts/osmo-layer1-headers.sh
new file mode 100755
index 000..966a7f5
--- /dev/null
+++ b/scripts/osmo-layer1-headers.sh
@@ -0,0 +1,46 @@
+#!/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' than use it instead of 
default
+if [ -n "$2" ]
+   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

-- 
To view, visit https://gerrit.osmocom.org/2893
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I840533d5bf9233822bc0534a25c252f1cab0a7b0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Max