summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-02-01 02:02:15 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-02-01 21:07:15 (GMT)
commitdddb3574ba842c8de5de6c4b5481a1b86b571090 (patch)
tree0de8dca7f5e0f0840652d87194a64a2303236332 /abs/core/runit-scripts/runitscripts
parentbf9991d8258086515c1350d8719622c659924f37 (diff)
downloadlinhes_pkgbuild-dddb3574ba842c8de5de6c4b5481a1b86b571090.zip
linhes_pkgbuild-dddb3574ba842c8de5de6c4b5481a1b86b571090.tar.gz
linhes_pkgbuild-dddb3574ba842c8de5de6c4b5481a1b86b571090.tar.bz2
runit-scripts: fix logging for igdeamon, add support to remote init script so that the blaster is always the first device in the chain.
added support specificly for hd_pvr refs #902 res #902
Diffstat (limited to 'abs/core/runit-scripts/runitscripts')
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/igdaemon/log/run7
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/igdaemon/run2
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/remotes/run138
3 files changed, 117 insertions, 30 deletions
diff --git a/abs/core/runit-scripts/runitscripts/services/igdaemon/log/run b/abs/core/runit-scripts/runitscripts/services/igdaemon/log/run
new file mode 100755
index 0000000..f7e3b49
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/igdaemon/log/run
@@ -0,0 +1,7 @@
+#!/bin/sh
+exec 2>&1
+#export TERM=linux
+#. /etc/rc.conf
+#. /etc/rc.d/functions
+/usr/bin/logger -p info -t igdaemon
+
diff --git a/abs/core/runit-scripts/runitscripts/services/igdaemon/run b/abs/core/runit-scripts/runitscripts/services/igdaemon/run
index ea4f33b..37bf25c 100755
--- a/abs/core/runit-scripts/runitscripts/services/igdaemon/run
+++ b/abs/core/runit-scripts/runitscripts/services/igdaemon/run
@@ -6,4 +6,4 @@ export TERM=linux
stat_runit "Starting IguanaWorks IR daemon"
-exec /usr/bin/igdaemon --no-ids -n -l /var/log/igdaemon.log
+exec /usr/bin/igdaemon --no-ids -n
diff --git a/abs/core/runit-scripts/runitscripts/services/remotes/run b/abs/core/runit-scripts/runitscripts/services/remotes/run
index 2248322..4040d7e 100755
--- a/abs/core/runit-scripts/runitscripts/services/remotes/run
+++ b/abs/core/runit-scripts/runitscripts/services/remotes/run
@@ -1,8 +1,6 @@
#!/bin/bash
-
exec 2>&1
export TERM=linux
-
. /etc/rc.conf
. /etc/rc.d/functions
. /usr/MythVantage/bin/install_functions.sh
@@ -16,8 +14,6 @@ fi
echo "`date` --- run started" >> $LOG
-
-
#What is done in this file may not be enough to start your specific remote.
#If that is true of your remote place your remote startup commands in:
# /etc/runit/lirc.sh
@@ -32,30 +28,30 @@ then
else
. /etc/systemconfig
stat_runit "Starting remotes"
-
+
[ -e /etc/sv/remotes/.runtime ] || mkdir -p /etc/sv/remotes/.runtime
[ -e /var/run/lirc ] || mkdir -p /var/run/lirc
-
+
num_lirc=`ls -la /dev/lirc[0-9] 2>/dev/null |wc -l `
num_lirc=$((num_lirc-1))
-
+
serial_port=""
-
- if [ x$ReceiverType = xSerial ]
+
+ if [ x$ReceiverType = xserial ]
then
serial_port=$ReceiverSerialport
- elif [ x$HostBlasterType = xSerial ]
+ elif [ x$HostBlasterType = xserial ]
then
serial_port=$HostSerialPort_blasterlirc
fi
-
+
if [ -n "$serial_port" ]
then
#/dev/ttyS0 (COM1), port 0x3f8, irq 4
#/dev/ttyS1 (COM2), port 0x2f8, irq 3
#/dev/ttyS2 (COM3), port 0x3e8, irq 4
#/dev/ttyS3 (COM4), port 0x2e8, irq 3
-
+
case $serial_port in
ttyS0)
FLAGS="io=0x3f8 irq=4"
@@ -75,13 +71,14 @@ else
/sbin/modprobe lirc_serial $FLAGS
sleep 0.5
fi
-
+
if [ x$HostBlasterType = xCommandIR -o x$ReceiverType = xCommandIR ]
then
CMD="/usr/sbin/lircd -r -n --driver=commandir"
printhl " Using commandir"
echo $CMD >>$LOG
$CMD >>$LOG 2>>$LOG
+
elif [ x$HostBlasterType = xiguanaIR-usb -o x$ReceiverType = xiguanaIR-usb ]
then
sv start igdaemon
@@ -89,6 +86,7 @@ else
printhl " Using iguanaIR usb"
echo $CMD >>$LOG
$CMD >>$LOG 2>>$LOG
+
elif [ x$ReceiverType = "xSiliconDust_HDHR" ]
then
# if using the SiliconDust_HDHR as an I/R Receiver
@@ -96,34 +94,116 @@ else
printhl " Using SiliconDust on port 5000"
echo $CMD >>$LOG
$CMD >>$LOG 2>>$LOG
+
else
- LASTCMD=""
-
- for i in `seq 1 $num_lirc`
- do
- CMD="/usr/sbin/lircd -r -d /dev/lirc$i --output=/var/run/lirc/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
- printhl " Device $i"
- echo $CMD >>$LOG
- $CMD >>$LOG 2>>$LOG
- LASTCMD="--connect=localhost:876$i $LASTCMD "
- done
-
- echo $LASTCMD >>$LOG
-
if [ -f /etc/remote.run ]
then
#program must not terminate.
-
stat_runit "Starting remotes from /etc/remote.run"
- LCMD="/etc/remote.run $LASTCMD"
+ LCMD="/etc/remote.run"
echo "Starting remotes from $LCMD" >>$LOG
exec $LCMD >>$LOG 2>>$LOG
else
+ #/etc/remote.run not found, carry one with normal init
+ LASTCMD=""
+ USE_BLASTER="False"
+ DEFINED_RECEIVER="False"
+
+ case x$ReceiverType in
+ xmce)
+ IRNODE=/dev/remotes/mce_lirc
+ DEFINED_RECEIVER="True"
+ LASTCMD="--connect=localhost:8761"
+ ;;
+ xserial)
+ IRNODE=/dev/remotes/serial_lirc
+ DEFINED_RECEIVER="True"
+ LASTCMD="--connect=localhost:8761"
+ ;;
+ xNone)
+ IRNODE='None'
+ DEFINED_RECEIVER="False"
+ ;;
+ xstreamzap)
+ IRNODE=/dev/remotes/streamzap_lirc
+ DEFINED_RECEIVER="True"
+ LASTCMD="--connect=localhost:8761"
+ ;;
+ xhd_pvr)
+ IRNODE=/dev/remotes/hdpvr_lirc
+ DEFINED_RECEIVER="True"
+ LASTCMD="--connect=localhost:8761"
+ ;;
+
+ Default|*)
+ DEFINED_RECEIVER="False"
+ for i in `seq 1 $num_lirc`
+ do
+ CMD="/usr/sbin/lircd -r -d /dev/lirc$i --output=/var/run/lirc/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
+ printhl " Device $i"
+ echo $CMD >>$LOG
+ $CMD >>$LOG 2>>$LOG
+ LASTCMD="--connect=localhost:876$i $LASTCMD "
+ done
+ ;;
+ esac
+
+ #find valid blaster device and make it the LCMD
+ # Receiver, Serial, MCE, NONE
+ case x$HostBlasterType in
+ xmce)
+ BLASTERNODE=/dev/remotes/mce_lirc
+ USE_BLASTER="True"
+ ;;
+ xserial)
+ BLASTERNODE=/dev/remotes/serial_lirc
+ USE_BLASTER="True"
+ ;;
+ xNone)
+ BLASTERNODE='None'
+ USE_BLASTER="False"
+ ;;
+ xReceiver)
+ BLASTERNODE=$IRNODE
+ USE_BLASTER="True"
+ DEFINED_RECEIVER="False"
+ ;;
+ xhd_pvr)
+ BLASTERNODE=/dev/remotes/hdpvr_lirc
+ USE_BLASTER="True"
+ esac
+
+
+ if [ x$USE_BLASTER = xTrue -a x$DEFINED_RECEIVER = xTrue ]
+ then
+ #start receiver
+ #start blaster chain
+ CMD="/usr/sbin/lircd -r -d $IRNODE --output=/var/run/lirc/lircd1 --pidfile=/var/run/lircd1.pid --listen=8761"
+ LCMD="/usr/sbin/lircd -r -n -d $BLASTERNODE --output /var/run/lirc/lircd $LASTCMD"
+ echo $CMD >>$LOG
+ $CMD >>$LOG 2>>$LOG
+
+ elif [ x$USE_BLASTER = xTrue ]
+ then
+ #start only the blaster
+ LCMD="/usr/sbin/lircd -r -n -d $BLASTERNODE --output /var/run/lirc/lircd $LASTCMD"
+
+ elif [ x$DEFINED_RECEIVER = xTrue ]
+ then
+ #start reciever
+ LCMD="/usr/sbin/lircd -r -n -d $IRNODE --output /var/run/lirc/lircd"
+
+ else
+ #default case of /dev/lirc0
+ LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd $LASTCMD"
+ fi
+
+ echo $LASTCMD >>$LOG
echo "Disable in kernel remote driver" >>$LOG
in_kernel_support "disable"
- LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd $LASTCMD"
echo "Starting remotes from $LCMD" >>$LOG
exec $LCMD >>$LOG 2>>$LOG
+
fi
fi
fi