summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/remotes
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
commit2648e999d277eac5c3d331a3609bcc73fafbea71 (patch)
tree40951fb8e7fdbe28a0baa324ae615055203f1e2e /abs/core/runit-scripts/runitscripts/services/remotes
parentc759b5e0c4aa6fc37412b4dee2cf9ad993fd376d (diff)
parent7e6f7ca174e1af67178dc5293a312a4a733eb095 (diff)
downloadlinhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.zip
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.gz
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.bz2
Merge branch 'testing'
# By James Meyer (1091) and others # Via James Meyer (5) and others * testing: (1148 commits) LinHES-config: during install don't kill off lirc. This keeps the remote active all the way to the finish Change version numbers to 8.0 to match the release number. LinHES-conifg LinHES-system mythdb-initial runit-scripts supplemental-web LinHES-conifig: mv_install.py for the last partition don't go all the way to the end. Gotta leave room for gpt tables. xf86-video-ati: xorg ati driver. LinHES-config: timezip.py add syncing up of parental lvl passwords and starting level with MBE. LinHES-system: correct the logic for breaking out of the wmctrl loop. As written it would break out of the inner loop..but not the 60 iteration loop. e16_theme_settings: remove slide-in prop for new windows. For whatever reason this was preventing mplayer from being positioned correctly for appletrailers. LinHES-config, mythinstall: change case of hd_pvr and serial to all lower refs #902 zilog-firmware: firmware for TX support of the hdpvr and pvr-150 In general I can't recommend anybody using these transmitters but including the firmware just in case someone really wants to linhes-udev-rules: added hdprv_lirc rule. All of these lirc rules are limited to exactly one device. If more then one device is present then only the last device in init will get the symlink 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 LinHES-system: add lh_system_restore and lh_system_backup. These scripts are called from the mythmenu. refs #900 iguanair: rebuild with python 2.7 LinHES-system: msg_daemon.py fix init and nasty bug related to timeout. In a nutshell timeout wouldn't work unless a msg without a timeout was called first. linhes-udev-rules: add rules for mce,streamzap,serial lirc devices. mythinstall: recompile for matching libs mythtv: latest .25-fixes and change mythbackup/restore call lh_system_$op to replace mythbackup/mythrestore. mythbackup no longer works correctly with the new windowmanager linhes-scripts: myth2mp3, myth2x264, myth2xvid: use mythutil to get cutlist LinHES-config, supplimental-web: Fix proxy numbering for Ceton infiniTV linhes-system: add additional stuff to the system backup and also introduced an exclude file. The exclude/include files are locate in /home/mythtv/backup_config/ ...
Diffstat (limited to 'abs/core/runit-scripts/runitscripts/services/remotes')
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/remotes/run138
1 files changed, 109 insertions, 29 deletions
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