Add files for deploying to sysmoBTS 2050

This commit is contained in:
Keith Whyte 2019-09-07 11:55:10 +02:00
parent be267a8857
commit 0b1ab8df7a
4 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,10 @@
[Unit]
Description=Flash the LED
Before=getty@tty1.service
[Service]
ExecStart=/etc/init.d/leds.sh r timer fast
Type=oneshot
[Install]
WantedBy=default.target

View file

@ -0,0 +1,41 @@
#!/bin/bash
# Control the LED on a SysmoBTS 2050
# We have a Red and a Green LED in one
# Both on = Orange.
_AL=/sys/class/leds/activity_led/
_OL=/sys/class/leds/online_led/
_B=brightness
_T=trigger
_D=delay_on
_DO=delay_off
if [ "$1" == "green" -o "$1" == "g" ]; then
_L=$_AL
fi
if [ "$1" == "red" -o "$1" == "r" ]; then
_L=$_OL
fi
if [ "$1" == "reset" ]; then
echo 0 > $_AL$_B
echo 0 > $_OL$_B
fi
if [ "$2" == "on" ]; then
echo 1 > $_L$_B
fi
if [ "$2" == "off" ]; then
echo 0 > $_L$_B
fi
if [ "$2" == "timer" -o "$2" == "cpu0" ]; then
echo $2 > $_L$_T
if [ "$3" == fast ]; then
echo 50 > $_L$_D
echo 100 > $_L$_DO
fi
fi

View file

@ -0,0 +1,24 @@
[Unit]
Description=osmo-bts for sysmocom sysmoBTS
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStartPre=/bin/sh -c 'echo cpu0 > /sys/class/leds/online_led/trigger'
ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts-sysmo.cfg -M
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStopPost=/bin/sh -c 'echo none > /sys/class/leds/online_led/trigger'
ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/online_led/brightness'
ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s'
Restart=always
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=sysmobts.service
Alias=osmo-bts.service

View file

@ -449,6 +449,11 @@ schedule { 'repo':
}
}
file { '/var/SysmoBTS':
ensure => present,
source => 'puppet:///modules/rhizo_base/var/SysmoBTS',
}
file { '/var/log/rccn':
ensure => link,
target => '/var/rhizomatica/rccn/log',