diff options
author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-07-19 06:42:48 (GMT) |
---|---|---|
committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-07-19 06:42:48 (GMT) |
commit | 9bb1cdafc910c52aa1b5575ce9a47e13de20962a (patch) | |
tree | 5d3a1779715e395d60b357c8e84f5b889a898bbb /abs/core-testing/runit-scripts | |
parent | 78d204762df37d87ac1b6139bb04d90ac863a9c1 (diff) | |
parent | 4cb1ab858b9ad93a2bc16b3e9966dee4c2043ddd (diff) | |
download | linhes_pkgbuild-9bb1cdafc910c52aa1b5575ce9a47e13de20962a.zip linhes_pkgbuild-9bb1cdafc910c52aa1b5575ce9a47e13de20962a.tar.gz linhes_pkgbuild-9bb1cdafc910c52aa1b5575ce9a47e13de20962a.tar.bz2 |
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Diffstat (limited to 'abs/core-testing/runit-scripts')
-rwxr-xr-x | abs/core-testing/runit-scripts/PKGBUILD | 2 | ||||
-rwxr-xr-x | abs/core-testing/runit-scripts/runitscripts/services/lircd/run | 128 |
2 files changed, 68 insertions, 62 deletions
diff --git a/abs/core-testing/runit-scripts/PKGBUILD b/abs/core-testing/runit-scripts/PKGBUILD index 7fe22bf..aa26834 100755 --- a/abs/core-testing/runit-scripts/PKGBUILD +++ b/abs/core-testing/runit-scripts/PKGBUILD @@ -1,6 +1,6 @@ pkgname=runit-scripts pkgver=1.8.0 -pkgrel=91 +pkgrel=93 pkgdesc="collection of startup scripts for runit" url="http://smarden.org/runit/" license="BSD" diff --git a/abs/core-testing/runit-scripts/runitscripts/services/lircd/run b/abs/core-testing/runit-scripts/runitscripts/services/lircd/run index 6d67537..7067b90 100755 --- a/abs/core-testing/runit-scripts/runitscripts/services/lircd/run +++ b/abs/core-testing/runit-scripts/runitscripts/services/lircd/run @@ -1,30 +1,36 @@ #!/bin/bash + exec 2>&1 export TERM=linux + . /etc/rc.conf . /etc/rc.d/functions #since what we do may not be enough #if your one of those people, this is where you place your stuff + LOG=/tmp/lirc.log + if [ -f $LOG ] then - rm -f $LOG + rm -f $LOG fi + if [ -f /etc/runit/lirc.sh ] then #program must not terminate. - stat_runit "Starting lirc" + stat_runit "Starting lirc" /etc/runit/lirc.sh else . /etc/systemconfig stat_runit "Starting lirc" + [ -e /etc/sv/lircd/.runtime ] || mkdir -p /etc/sv/lircd/.runtime function dvico_detect { - if [ x$Remotetype = "xdvico" ] + if [ x$Remotetype = "xdvico" ] || [ x$Remotetype = "xDvico-Dual-Digital4-rev2" ] then RunDvico=true else @@ -35,15 +41,26 @@ else num_lirc=`ls -la /dev/lirc[0-9] 2>/dev/null |wc -l ` num_lirc=$((num_lirc-1)) - #/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 + serial_port="" + if [ x$ReceiverType = xSerial ] then - case $ReceiverSerialport in + serial_port=$ReceiverSerialport + 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" + FLAGS="io=0x3f8 irq=4" ;; ttyS1) FLAGS="io=0x2f8 irq=3" @@ -52,81 +69,70 @@ else FLAGS="io=0x3e8 irq=4" ;; ttyS3) - FLAGS="io=0x2f8 irq=3" + FLAGS="io=0x2e8 irq=3" ;; esac - /usr/bin/setserial /dev/$ReceiverSerialport uart none - sleep .5 + /usr/bin/setserial /dev/serial_port uart none + sleep 0.5 /sbin/modprobe lirc_serial $FLAGS - sleep .5 - elif [ x$HostBlasterType = xSerial ] - then - case $HostSerialPort_blasterlirc in - ttyS0) - FLAGS="io=0x3f8 irq=4" - ;; - ttyS1) - FLAGS="io=0x2f8 irq=3" - ;; - ttyS2) - FLAGS="io=0x3e8 irq=4" - ;; - ttyS3) - FLAGS="io=0x2f8 irq=3" - ;; - esac - /usr/bin/setserial /dev/$ReceiverSerialport uart none - sleep .5 - /sbin/modprobe lirc_serial $FLAGS - sleep .5 + sleep 0.5 fi dvico_detect + if [ x$HostBlasterType = xCommandIR -o x$ReceiverType = xCommandIR ] then CMD="/usr/sbin/lircd -n --driver=commandir" printhl " Using commandir" $CMD >>$LOG 2>>$LOG - elif [ x$HostBlasterType = xiguanaIR-usb -o x$ReceiverType = xiguanaIR-usb ] - then +echo $CMD + elif [ x$HostBlasterType = xiguanaIR-usb -o x$ReceiverType = xiguanaIR-usb ] + then sv start igdaemon CMD="/usr/sbin/lircd -n --driver=iguanaIR" printhl " Using iguanaIR usb" +echo $CMD $CMD >>$LOG 2>>$LOG else LASTCMD="" + for i in `seq 1 $num_lirc` do CMD="/usr/sbin/lircd -d /dev/lirc$i --output=/dev/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i" -# echo $CMD printhl " Device $i" +echo $CMD $CMD >>$LOG 2>>$LOG LASTCMD="--connect=localhost:876$i $LASTCMD " done - if [ $RunDvico = "true" -a $num_lirc -lt 0 ] - then - #only run dvicio - LCMD="/usr/sbin/lircd -n -d /dev/usb/dvicoIR --driver=dvico --output /dev/lircd" - # echo $LCMD - printhl " Device Dvicio" - - exec $LCMD >>$LOG 2>>$LOG - elif [ $RunDvico = true -a $num_lirc -gt -1 ] - then - #chain them together - i=$((i+1)) - CMD="/usr/sbin/lircd -d /dev/usb/dvicoIR --driver=dvico --output=/dev/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i" - # echo $CMD - $CMD >> $LOG - LASTCMD="--connect=localhost:876$i $LASTCMD " - printhl " Device Dvicio" - - /usr/sbin/lircd -n -d /dev/lirc0 --output /dev/lircd $LASTCMD >>$LOG 2>>$LOG - else - LCMD="/usr/sbin/lircd -n -d /dev/lirc0 --output /dev/lircd $LASTCMD" - # echo $LCMD - - exec $LCMD >>$LOG 2>>$LOG - fi + + if [ $RunDvico = "true" ] + then + if [ x$Remotetype = "xdvico" ] + then + LCMD="/usr/sbin/lircd -n -d /dev/usb/dvicoIR --driver=dvico --output /dev/lircd" + else + LCMD="/usr/sbin/lircd -n -d /dev/input/irremote --driver=devinput --output /dev/lircd" + fi + + if [ $num_lirc -lt 0 ] + then + # Only run Dvico + printhl " Device $Remotetype" +echo $LCMD + exec $LCMD >>$LOG 2>>$LOG + elif [ $num_lirc -gt -1 ] + then + i=$((i+1)) + CMD="$LCMD --output=/dev/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i" + $CMD >> $LOG + LASTCMD="--connect=localhost:876$i $LASTCMD " + printhl " Device Dvico" + /usr/sbin/lircd -n -d /dev/lirc0 --output /dev/lircd $LASTCMD >>$LOG 2>>$LOG + fi + else + LCMD="/usr/sbin/lircd -n -d /dev/lirc0 --output /dev/lircd $LASTCMD" +echo $LCMD + exec $LCMD >>$LOG 2>>$LOG + fi fi fi |