Change in osmo-bts[master]: Add OC-2G systemd service and config

2018-10-26 Thread Omar Ramadan
Omar Ramadan has abandoned this change. ( https://gerrit.osmocom.org/11448 )

Change subject: Add OC-2G systemd service and config
..


Abandoned

Squashing into 11447
--
To view, visit https://gerrit.osmocom.org/11448
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic4b5a97b9677051442f3c3341ba23add35b43715
Gerrit-Change-Number: 11448
Gerrit-PatchSet: 1
Gerrit-Owner: Omar Ramadan 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 


Change in osmo-bts[master]: Add OC-2G systemd service and config

2018-10-26 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11448 )

Change subject: Add OC-2G systemd service and config
..


Patch Set 1:

see my other comment, let's squash those three patches into one patch, and also 
add the jenkins.sh integration


--
To view, visit https://gerrit.osmocom.org/11448
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic4b5a97b9677051442f3c3341ba23add35b43715
Gerrit-Change-Number: 11448
Gerrit-PatchSet: 1
Gerrit-Owner: Omar Ramadan 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 26 Oct 2018 10:46:16 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: Add OC-2G systemd service and config

2018-10-23 Thread Omar Ramadan
Omar Ramadan has uploaded this change for review. ( 
https://gerrit.osmocom.org/11448


Change subject: Add OC-2G systemd service and config
..

Add OC-2G systemd service and config

Change-Id: Ic4b5a97b9677051442f3c3341ba23add35b43715
---
A contrib/systemd/oc2gbts-mgr.service
A contrib/systemd/osmo-bts-oc2g.service
A doc/examples/oc2g/oc2gbts-mgr.cfg
A doc/examples/oc2g/osmo-bts.cfg
4 files changed, 121 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/11448/1

diff --git a/contrib/systemd/oc2gbts-mgr.service 
b/contrib/systemd/oc2gbts-mgr.service
new file mode 100644
index 000..ed915b3
--- /dev/null
+++ b/contrib/systemd/oc2gbts-mgr.service
@@ -0,0 +1,29 @@
+[Unit]
+Description=osmo-bts manager for OC-2G
+After=oc2g-sysdev-remap.service
+Wants=oc2g-sysdev-remap.service
+
+[Service]
+Type=simple
+NotifyAccess=all
+WatchdogSec=21780s
+Restart=always
+RestartSec=2
+
+# Make sure directories and symbolic link exist
+ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/oc2gbts-mgr || mkdir -p 
/mnt/storage/var/run/oc2gbts-mgr ; test -d /var/run/oc2gbts-mgr || ln -sf 
/mnt/storage/var/run/oc2gbts-mgr/ /var/run'
+# Make sure BTS operation hour exist
+ExecStartPre=/bin/sh -c 'test -f 
/mnt/storage/var/run/oc2gbts-mgr/hours-running || echo 0 > 
/mnt/storage/var/run/oc2gbts-mgr/hours-running'
+# Shutdown all PA correctly
+ExecStartPre=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
+#ExecStartPre=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 
> /var/oc2g/pa-supply/min_microvolts'
+
+ExecStart=/usr/bin/oc2gbts-mgr -s -c /etc/osmocom/oc2gbts-mgr.cfg
+
+# Shutdown all PA correctly
+ExecStopPost=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
+#ExecStopPost=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 
> /var/oc2g/pa-supply/min_microvolts'
+
+[Install]
+WantedBy=multi-user.target
+Alias=osmo-bts-mgr.service
diff --git a/contrib/systemd/osmo-bts-oc2g.service 
b/contrib/systemd/osmo-bts-oc2g.service
new file mode 100644
index 000..2f2d837
--- /dev/null
+++ b/contrib/systemd/osmo-bts-oc2g.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=osmo-bts for OC-2G
+
+[Service]
+Type=simple
+ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
+ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness'
+ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts.cfg -M
+ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
+ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness'
+Restart=always
+RestartSec=2
+RestartPreventExitStatus=1
+
+# The msg queues must be read fast enough
+CPUSchedulingPolicy=rr
+CPUSchedulingPriority=1
+
+[Install]
+WantedBy=multi-user.target
+Alias=osmo-bts.service
diff --git a/doc/examples/oc2g/oc2gbts-mgr.cfg 
b/doc/examples/oc2g/oc2gbts-mgr.cfg
new file mode 100644
index 000..8248f60
--- /dev/null
+++ b/doc/examples/oc2g/oc2gbts-mgr.cfg
@@ -0,0 +1,33 @@
+!
+! oc2gbts-mgr (0.3.0.284-a7c2-dirty) configuration saved from vty
+!!
+!
+log stderr
+  logging filter all 1
+  logging color 1
+  logging print category 0
+  logging timestamp 0
+  logging level temp info
+  logging level fw info
+  logging level find info
+  logging level calib info
+  logging level lglobal notice
+  logging level llapd notice
+  logging level linp notice
+  logging level lmux notice
+  logging level lmi notice
+  logging level lmib notice
+  logging level lsms notice
+  logging level lctrl notice
+  logging level lgtp notice
+!
+line vty
+ no login
+!
+oc2gbts-mgr
+ limits supply_volt
+   threshold warning min 17500
+   threshold critical min 19000
+ limits supply_pwr
+   threshold warning max 110
+   threshold critical max 120
diff --git a/doc/examples/oc2g/osmo-bts.cfg b/doc/examples/oc2g/osmo-bts.cfg
new file mode 100644
index 000..f985f3b
--- /dev/null
+++ b/doc/examples/oc2g/osmo-bts.cfg
@@ -0,0 +1,38 @@
+!
+! OsmoBTS (0.0.1.100-0455-dirty) configuration saved from vty
+!!
+!
+log stderr
+  logging color 1
+  logging timestamp 0
+  logging level rsl info
+  logging level oml info
+  logging level rll notice
+  logging level rr notice
+  logging level meas notice
+  logging level pag info
+  logging level l1c info
+  logging level l1p info
+  logging level dsp debug
+  logging level abis notice
+  logging level rtp notice
+  logging level lglobal notice
+  logging level llapd notice
+  logging level linp notice
+  logging level lmux notice
+  logging level lmi notice
+  logging level lmib notice
+  logging level lsms notice
+!
+line vty
+ no login
+!
+phy 0
+ instance 0
+  trx-calibration-path /mnt/rom/factory/calib
+bts 0
+ band 900
+ ipa unit-id 1500 0
+ oml remote-ip 10.42.0.1
+ trx 0
+  phy 0 instance 0

--
To view, visit https://gerrit.osmocom.org/11448
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: