From 95f93a5cd8b9e9d91a38850f652d65e41474628f Mon Sep 17 00:00:00 2001
From: Cecil <knoppmyth@gmail.com>
Date: Sun, 22 Apr 2012 15:26:22 -0700
Subject: sapphire: Bumped to version 3.3.

---
 abs/extra/sapphire/PKGBUILD       | 11 +++++-----
 abs/extra/sapphire/sapphire.patch | 43 +++++++++++++++++++++++++++------------
 2 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/abs/extra/sapphire/PKGBUILD b/abs/extra/sapphire/PKGBUILD
index 7877f8f..dd7c0cb 100644
--- a/abs/extra/sapphire/PKGBUILD
+++ b/abs/extra/sapphire/PKGBUILD
@@ -2,15 +2,15 @@
 
 pkgname=sapphire
 _kernver=`uname -r`
-pkgver=3.2
-pkgrel=2
+pkgver=3.3
+pkgrel=1
 pkgdesc="Kernel module for Sapphire remote"
 arch=('i686' 'x86_64')
 url="http://rtr.ca/sapphire_remote"
 license=('GPL2')
 depends=('kernel26')
 makedepends=('kernel26-headers')
-options=(!makeflags)
+options=(!makeflags docs)
 install=sapphire.install
 source=(http://rtr.ca/sapphire_remote/${pkgname}-${pkgver}.tar.gz sapphire.patch)
 
@@ -28,8 +28,7 @@ package() {
   install -m 755 sapphire_keymap.sh ${pkgdir}/usr/bin
   install -m 644 README.txt ${pkgdir}/usr/share/doc/sapphire
   install -m 644 keymap.default ${pkgdir}/usr/share/doc/sapphire
-  install -m 644 sapphire.c ${pkgdir}/usr/share/doc/sapphire
   rm -fr ${pkgdir}/lib/modules/$_kernver/modules*
 }
-md5sums=('7379b9dd3283871234cbfb0f61516eae'
-         'db733f5dd3697895062027d7a58a6657')
+md5sums=('2f5734d338bb7795f8405689f7d52389'
+         'b72bd9141297af07546c2da850f82a2c')
diff --git a/abs/extra/sapphire/sapphire.patch b/abs/extra/sapphire/sapphire.patch
index ddd0653..36cf217 100644
--- a/abs/extra/sapphire/sapphire.patch
+++ b/abs/extra/sapphire/sapphire.patch
@@ -1,24 +1,41 @@
-diff -ruaN sapphire-3.2.orig//Makefile sapphire-3.2/Makefile
---- sapphire-3.2.orig//Makefile	2012-04-12 18:00:50.000000000 +0000
-+++ sapphire-3.2/Makefile	2012-04-22 08:42:19.000000000 +0000
-@@ -4,7 +4,7 @@
- #
+diff -ruaN sapphire-3.3.orig/Makefile sapphire-3.3/Makefile
+--- sapphire-3.3.orig/Makefile	2012-04-22 16:19:27.000000000 +0000
++++ sapphire-3.3/Makefile	2012-04-22 22:19:18.000000000 +0000
+@@ -5,7 +5,7 @@
  MODNAME=sapphire
+ MODSOURCE=$(MODNAME).c
  CONFLICTS=hid_topseed
 -BLACKLIST=/etc/modprobe.d/blacklist-$(CONFLICTS).conf
 +BLACKLIST=$(DESTDIR)/etc/modprobe.d/blacklist-$(CONFLICTS).conf
+ KEYMAP_SCRIPT=sapphire_keymap.sh
+ EXTRACT_KEYDEFS=extract_keydefs.sh
+ INPUT_H=/usr/include/linux/input.h
+@@ -39,12 +39,12 @@
  
- ## MODPARMS is not used any more, but we have to nuke old copies to prevent issues:
- MODPARMS=/etc/modprobe.d/$(MODNAME).conf
-@@ -49,8 +49,8 @@
+ modinstall: $(MODNAME).ko
+ 	$(MAKE) -C $(KDIR)/build M=`pwd` modules_install
+-	depmod $(KVER)
+-	@if [ "$(KVER)" = "$$(uname -r)" ]; then \
+-		rmmod $(MODNAME)   2>/dev/null ;\
+-		rmmod $(CONFLICTS) 2>/dev/null ;\
+-		modprobe -v $(MODNAME) ;\
+-	fi
++#	depmod $(KVER)
++#	@if [ "$(KVER)" = "$$(uname -r)" ]; then \
++#		rmmod $(MODNAME)   2>/dev/null ;\
++#		rmmod $(CONFLICTS) 2>/dev/null ;\
++#		modprobe -v $(MODNAME) ;\
++#	fi
+ 
+ clean:
+ 	$(MAKE) -C $(KDIR)/build M=`pwd` clean
+@@ -61,7 +61,7 @@
  	depmod
  
- install: $(MODNAME).ko clean_modparms modloader $(BLACKLIST)
--	cp sapphire_keymap.sh /usr/local/bin/
--	chmod a+rx /usr/local/bin/sapphire_keymap.sh
+ install: $(MODNAME).ko clean_modparms modinstall $(BLACKLIST) $(KEYMAP_SCRIPT)
+-	install -m 0755 $(KEYMAP_SCRIPT) /usr/local/bin/
 -	sync
-+#	cp sapphire_keymap.sh /usr/local/bin/
-+#	chmod a+rx /usr/local/bin/sapphire_keymap.sh
++#	install -m 0755 $(KEYMAP_SCRIPT) /usr/local/bin/
 +#	sync
  
  all: install
-- 
cgit v0.12


From c17b329192c8c9eed4b732084dc1691d699be9bb Mon Sep 17 00:00:00 2001
From: Cecil <knoppmyth@gmail.com>
Date: Sun, 22 Apr 2012 22:26:55 -0700
Subject: sapphire:Bumped module to version 3.4.

---
 abs/extra/sapphire/PKGBUILD       |  6 +++---
 abs/extra/sapphire/sapphire.patch | 14 ++++++++------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/abs/extra/sapphire/PKGBUILD b/abs/extra/sapphire/PKGBUILD
index dd7c0cb..f6d872b 100644
--- a/abs/extra/sapphire/PKGBUILD
+++ b/abs/extra/sapphire/PKGBUILD
@@ -2,7 +2,7 @@
 
 pkgname=sapphire
 _kernver=`uname -r`
-pkgver=3.3
+pkgver=3.4
 pkgrel=1
 pkgdesc="Kernel module for Sapphire remote"
 arch=('i686' 'x86_64')
@@ -30,5 +30,5 @@ package() {
   install -m 644 keymap.default ${pkgdir}/usr/share/doc/sapphire
   rm -fr ${pkgdir}/lib/modules/$_kernver/modules*
 }
-md5sums=('2f5734d338bb7795f8405689f7d52389'
-         'b72bd9141297af07546c2da850f82a2c')
+md5sums=('da5243f914aa3cecb8821dd12fe85933'
+         '90fcf01a3b96eb49a69d20bca74167a2')
diff --git a/abs/extra/sapphire/sapphire.patch b/abs/extra/sapphire/sapphire.patch
index 36cf217..93e4047 100644
--- a/abs/extra/sapphire/sapphire.patch
+++ b/abs/extra/sapphire/sapphire.patch
@@ -1,6 +1,6 @@
-diff -ruaN sapphire-3.3.orig/Makefile sapphire-3.3/Makefile
---- sapphire-3.3.orig/Makefile	2012-04-22 16:19:27.000000000 +0000
-+++ sapphire-3.3/Makefile	2012-04-22 22:19:18.000000000 +0000
+diff -ruaN sapphire-3.4.orig//Makefile sapphire-3.4/Makefile
+--- sapphire-3.4.orig//Makefile	2012-04-23 02:33:11.000000000 +0000
++++ sapphire-3.4/Makefile	2012-04-23 05:23:07.000000000 +0000
 @@ -5,7 +5,7 @@
  MODNAME=sapphire
  MODSOURCE=$(MODNAME).c
@@ -10,26 +10,28 @@ diff -ruaN sapphire-3.3.orig/Makefile sapphire-3.3/Makefile
  KEYMAP_SCRIPT=sapphire_keymap.sh
  EXTRACT_KEYDEFS=extract_keydefs.sh
  INPUT_H=/usr/include/linux/input.h
-@@ -39,12 +39,12 @@
+@@ -39,13 +39,13 @@
  
- modinstall: $(MODNAME).ko
+ modinstall: $(MODNAME).ko $(KEYMAP_SCRIPT)
  	$(MAKE) -C $(KDIR)/build M=`pwd` modules_install
 -	depmod $(KVER)
 -	@if [ "$(KVER)" = "$$(uname -r)" ]; then \
 -		rmmod $(MODNAME)   2>/dev/null ;\
 -		rmmod $(CONFLICTS) 2>/dev/null ;\
 -		modprobe -v $(MODNAME) ;\
+-		[ -e /etc/sapphire.keymap ] && ./$(KEYMAP_SCRIPT) /etc/sapphire.keymap ;\
 -	fi
 +#	depmod $(KVER)
 +#	@if [ "$(KVER)" = "$$(uname -r)" ]; then \
 +#		rmmod $(MODNAME)   2>/dev/null ;\
 +#		rmmod $(CONFLICTS) 2>/dev/null ;\
 +#		modprobe -v $(MODNAME) ;\
++#		[ -e /etc/sapphire.keymap ] && ./$(KEYMAP_SCRIPT) /etc/sapphire.keymap ;\
 +#	fi
  
  clean:
  	$(MAKE) -C $(KDIR)/build M=`pwd` clean
-@@ -61,7 +61,7 @@
+@@ -62,7 +62,7 @@
  	depmod
  
  install: $(MODNAME).ko clean_modparms modinstall $(BLACKLIST) $(KEYMAP_SCRIPT)
-- 
cgit v0.12


From 9a303f31cba2f320a41a3a00e8cfd64e0259dbfe Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Mon, 23 Apr 2012 12:46:30 -0500
Subject: runit-scripts: replace lircd with remotes

---
 abs/core/runit-scripts/PKGBUILD                    |   2 +-
 abs/core/runit-scripts/runit.install               |  13 +-
 .../runitscripts/services/lircd/finish             |  23 ---
 .../runit-scripts/runitscripts/services/lircd/run  | 163 -------------------
 .../runitscripts/services/remotes/finish           |   8 +-
 .../runitscripts/services/remotes/run              | 173 ++++++++++-----------
 6 files changed, 100 insertions(+), 282 deletions(-)
 delete mode 100755 abs/core/runit-scripts/runitscripts/services/lircd/finish
 delete mode 100755 abs/core/runit-scripts/runitscripts/services/lircd/run

diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index b368cd0..da205a5 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=runit-scripts
 pkgver=2.1.1
-pkgrel=58
+pkgrel=59
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
diff --git a/abs/core/runit-scripts/runit.install b/abs/core/runit-scripts/runit.install
index 2f9cf90..213d10f 100755
--- a/abs/core/runit-scripts/runit.install
+++ b/abs/core/runit-scripts/runit.install
@@ -3,7 +3,7 @@
 post_install () {
  
   [ -e /service ] ||  mkdir /service
-  servicelist="acpid cron frontend lircd ntpd alsa-utils avahi dbus sshd rsyslog tty2 tty3"
+  servicelist="acpid cron frontend remotes ntpd alsa-utils avahi dbus sshd rsyslog tty2 tty3"
   for i in $servicelist
   do
    ln -s /etc/sv/$i /service/$i
@@ -43,6 +43,17 @@ post_upgrade(){
 	  
   fi
 
+  if [ -e /service/lircd ]
+  then
+      /sbin/sv stop lircd
+      /sbin/remove_service.sh lircd
+      /sbin/add_service.sh remotes
+  fi
+
+  if [ -e /etc/sv/lircd ]
+  then
+      rm -r /etc/sv/lircd
+  fi
 	 
 }
 
diff --git a/abs/core/runit-scripts/runitscripts/services/lircd/finish b/abs/core/runit-scripts/runitscripts/services/lircd/finish
deleted file mode 100755
index f6d8b95..0000000
--- a/abs/core/runit-scripts/runitscripts/services/lircd/finish
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-export TERM=linux
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /usr/MythVantage/bin/install_functions.sh
-
-killall -9 lircd 2>/dev/null
-rm -f /var/run/lirc*.pid
-[ -e /etc/sv/lircd/.runtime ] || mkdir -p /etc/sv/lircd/.runtime
-touch /etc/sv/lircd/.runtime/`date +%s`
-numfiles=`/usr/bin/file_time_offset.py   -s4 -d/etc/sv/lircd/.runtime `
-if [ $numfiles -gt 3 ]
-then
-	 rm -f /etc/sv/lircd/.runtime/* 2>/dev/null
-	 sv stop lircd
-	 printhl "    lircd is not able to start, disabling it"
-fi
-
-
-
-
-
- in_kernel_support "enable"
\ No newline at end of file
diff --git a/abs/core/runit-scripts/runitscripts/services/lircd/run b/abs/core/runit-scripts/runitscripts/services/lircd/run
deleted file mode 100755
index 93d9585..0000000
--- a/abs/core/runit-scripts/runitscripts/services/lircd/run
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/bin/bash
-
-exec 2>&1
-export TERM=linux
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /usr/MythVantage/bin/install_functions.sh
-
-LOG=/tmp/lirc.log
-
-if [ -f $LOG ]
-then
-    rm -f $LOG
-fi
-
-
-
-
-
-
-
-
-#since what we do may not be enough
-#if your one of those people, this is where you place your stuff
-#This means place your lirc stuff in /etc/runit/lirc.sh.
-#Anything in that file will be used and the rest of this file is ignored
-
-if [ -f /etc/runit/lirc.sh ]
-then
-    #program must not terminate.
-
-    stat_runit "Starting lirc"
-
-    /etc/runit/lirc.sh
-else
-    . /etc/systemconfig
-    stat_runit "Starting lirc"
-
-    in_kernel_support "disable"
-
-    [ -e /etc/sv/lircd/.runtime ] || mkdir -p /etc/sv/lircd/.runtime
-    [ -e /var/run/lirc ] || mkdir -p /var/run/lirc
-
-    function dvico_detect {
-        if [[ x$Remotetype = xdvico* ]] || [ x$Remotetype = "xDvico-Dual-Digital4-rev2" ]
-        then
-            RunDvico=true
-        else
-            RunDvico=false
-        fi
-    }
-
-    num_lirc=`ls -la /dev/lirc[0-9] 2>/dev/null |wc -l `
-    num_lirc=$((num_lirc-1))
-
-    serial_port=""
-
-    if [ x$ReceiverType = xSerial ]
-    then
-        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"
-               ;;
-        ttyS1)
-               FLAGS="io=0x2f8  irq=3"
-               ;;
-        ttyS2)
-               FLAGS="io=0x3e8  irq=4"
-               ;;
-        ttyS3)
-               FLAGS="io=0x2e8  irq=3"
-               ;;
-        esac
-        /usr/bin/setserial /dev/$serial_port uart none
-        sleep 0.5
-        /sbin/modprobe lirc_serial $FLAGS
-        sleep 0.5
-    fi
-
-    dvico_detect
-
-    if [ x$HostBlasterType = xCommandIR -o x$ReceiverType = xCommandIR ]
-    then
-        CMD="/usr/sbin/lircd -r -n  --driver=commandir"
-        printhl "   Using commandir"
-        $CMD >>$LOG 2>>$LOG
-        #echo $CMD
-    elif [  x$HostBlasterType = xiguanaIR-usb -o x$ReceiverType = xiguanaIR-usb ]
-    then
-        sv start igdaemon
-        CMD="/usr/sbin/lircd -r -n  --driver=iguanaIR"
-        printhl "       Using iguanaIR usb"
-        #echo $CMD
-        $CMD >>$LOG 2>>$LOG
-
-    elif [ x$ReceiverType = "xSiliconDust_HDHR" ]
-    then
-        # if using the SiliconDust_HDHR as an I/R Receiver
-        printhl "   Using SiliconDust on port 5000"
-        CMD="/usr/sbin/lircd -H udp -d 5000 -n"
-        exec $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
-            $CMD >>$LOG 2>>$LOG
-            LASTCMD="--connect=localhost:876$i   $LASTCMD    "
-        done
-
-        if [ $RunDvico = "true" ]
-        then
-            if [[ x$Remotetype = xdvico* ]]
-            then
-                LCMD="/usr/sbin/lircd -r -n -d /dev/remotes/dvicoIR --driver=dvico  --output /var/run/lirc/lircd"
-            else
-                LCMD="/usr/sbin/lircd -r -n -d /dev/remotes/dvicoDualDigital4 --driver=devinput  --output /var/run/lirc/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=/var/run/lirc/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 -r -n -d /dev/lirc0 --output /var/run/lirc/lircd  $LASTCMD  >>$LOG 2>>$LOG
-            fi
-        elif [[ x$Remotetype = ximon* ]]
-        then
-            /usr/bin/ir-keytable -c -p lirc -w /etc/rc_keymaps/imon_pad
-            LCMD="/usr/sbin/lircd -r -n --driver devinput -d /dev/remotes/SoundGraph --output /var/run/lirc/lircd"
-            exec $LCMD >>$LOG 2>>$LOG
-        else
-            LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd  $LASTCMD"
-            #echo $LCMD
-            exec $LCMD >>$LOG 2>>$LOG
-        fi
-    fi
-fi
diff --git a/abs/core/runit-scripts/runitscripts/services/remotes/finish b/abs/core/runit-scripts/runitscripts/services/remotes/finish
index ac04a33..c1a5554 100755
--- a/abs/core/runit-scripts/runitscripts/services/remotes/finish
+++ b/abs/core/runit-scripts/runitscripts/services/remotes/finish
@@ -4,6 +4,9 @@ export TERM=linux
 . /etc/rc.d/functions
 . /usr/MythVantage/bin/install_functions.sh
 
+LOG=/tmp/remotes.log
+echo "`date` --- finish started" >> $LOG
+
 killall -9 lircd 2>/dev/null
 rm -f /var/run/lirc*.pid
 [ -e /etc/sv/remotes/.runtime ] || mkdir -p /etc/sv/remotes/.runtime
@@ -12,10 +15,11 @@ numfiles=`/usr/bin/file_time_offset.py   -s4 -d/etc/sv/remotes/.runtime `
 if [ $numfiles -gt 3 ]
 then
 	 rm -f /etc/sv/remotes/.runtime/* 2>/dev/null
-	 sv stop remotes
+	 sv stop remotes >> $LOG
 	 printhl "    remotes is not able to start, disabling it"
+     echo "    remotes is not able to start, disabling it" >> $LOG
 fi
 
 
-
+echo "Enable in kernel remote driver" >> $LOG
 in_kernel_support "enable"
diff --git a/abs/core/runit-scripts/runitscripts/services/remotes/run b/abs/core/runit-scripts/runitscripts/services/remotes/run
index d32b09e..35d3f80 100755
--- a/abs/core/runit-scripts/runitscripts/services/remotes/run
+++ b/abs/core/runit-scripts/runitscripts/services/remotes/run
@@ -14,112 +14,101 @@ then
     rm -f $LOG
 fi
 
+echo "`date` --- run started" >> $LOG
 
 
+. /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
 
-#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/remotes.sh
-#Anything in that file will be used and the rest of this file is ignored
+num_lirc=`ls -la /dev/lirc[0-9] 2>/dev/null |wc -l `
+num_lirc=$((num_lirc-1))
 
-if [ -f /etc/remotes.sh ]
+serial_port=""
+
+if [ x$ReceiverType = xSerial ]
+then
+    serial_port=$ReceiverSerialport
+elif [ x$HostBlasterType = xSerial ]
 then
-    #program must not terminate.
+    serial_port=$HostSerialPort_blasterlirc
+fi
 
-    stat_runit "Starting remotes from /etc/remotes.sh"
+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"
+           ;;
+    ttyS1)
+           FLAGS="io=0x2f8  irq=3"
+           ;;
+    ttyS2)
+           FLAGS="io=0x3e8  irq=4"
+           ;;
+    ttyS3)
+           FLAGS="io=0x2e8  irq=3"
+           ;;
+    esac
+    /usr/bin/setserial /dev/$serial_port uart none
+    sleep 0.5
+    /sbin/modprobe lirc_serial $FLAGS
+    sleep 0.5
+fi
 
-    /etc/remotes.sh
+if [ x$HostBlasterType = xCommandIR -o x$ReceiverType = xCommandIR ]
+then
+    CMD="/usr/sbin/lircd -r -n  --driver=commandir"
+    printhl "   Using commandir"
+    echo $CMD >>$LOG
+    exec $CMD >>$LOG 2>>$LOG
+elif [ x$HostBlasterType = xiguanaIR-usb -o x$ReceiverType = xiguanaIR-usb ]
+then
+    sv start igdaemon
+    CMD="/usr/sbin/lircd -r -n  --driver=iguanaIR"
+    printhl "       Using iguanaIR usb"
+    echo $CMD >>$LOG
+    exec $CMD >>$LOG 2>>$LOG
+elif [ x$ReceiverType = "xSiliconDust_HDHR" ]
+then
+    # if using the SiliconDust_HDHR as an I/R Receiver
+    CMD="/usr/sbin/lircd -H udp -d 5000 -n"
+    printhl "   Using SiliconDust on port 5000"
+    echo $CMD >>$LOG
+    exec $CMD >>$LOG 2>>$LOG
 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))
+    LASTCMD=""
 
-    serial_port=""
+    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
+        exec $CMD >>$LOG 2>>$LOG
+        LASTCMD="--connect=localhost:876$i   $LASTCMD    "
+    done
 
-    if [ x$ReceiverType = xSerial ]
-    then
-        serial_port=$ReceiverSerialport
-    elif [ x$HostBlasterType = xSerial ]
-    then
-        serial_port=$HostSerialPort_blasterlirc
-    fi
+    echo $LASTCMD >>$LOG
 
-    if [ -n "$serial_port" ]
+    if [ -f /etc/remote.run ]
     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"
-               ;;
-        ttyS1)
-               FLAGS="io=0x2f8  irq=3"
-               ;;
-        ttyS2)
-               FLAGS="io=0x3e8  irq=4"
-               ;;
-        ttyS3)
-               FLAGS="io=0x2e8  irq=3"
-               ;;
-        esac
-        /usr/bin/setserial /dev/$serial_port uart none
-        sleep 0.5
-        /sbin/modprobe lirc_serial $FLAGS
-        sleep 0.5
-    fi
+        #program must not terminate.
 
-    if [ x$HostBlasterType = xCommandIR -o x$ReceiverType = xCommandIR ]
-    then
-        CMD="/usr/sbin/lircd -r -n  --driver=commandir"
-        printhl "   Using commandir"
-        $CMD >>$LOG 2>>$LOG
-        #echo $CMD
-    elif [ x$HostBlasterType = xiguanaIR-usb -o x$ReceiverType = xiguanaIR-usb ]
-    then
-        sv start igdaemon
-        CMD="/usr/sbin/lircd -r -n  --driver=iguanaIR"
-        printhl "       Using iguanaIR usb"
-        #echo $CMD
-        $CMD >>$LOG 2>>$LOG
-    elif [ x$ReceiverType = "xSiliconDust_HDHR" ]
-    then
-        # if using the SiliconDust_HDHR as an I/R Receiver
-        printhl "   Using SiliconDust on port 5000"
-        CMD="/usr/sbin/lircd -H udp -d 5000 -n"
-        exec $CMD >>$LOG 2>>$LOG
+        stat_runit "Starting remotes from /etc/remote.run"
+        echo "Starting remotes from /etc/remote.run" >>$LOG
+        exec /etc/remote.run    $LASTCMD >>$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
-            $CMD >>$LOG 2>>$LOG
-            LASTCMD="--connect=localhost:876$i   $LASTCMD    "
-        done
-
-        if [ -f /etc/remote.run ]
-        then
-            #program must not terminate.
-
-            stat_runit "Starting remotes from /etc/remote.run"
-
-            /etc/remote.run
-        else
-            in_kernel_support "disable"
-            LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd  $LASTCMD"
-            #echo $LCMD
-            exec $LCMD >>$LOG 2>>$LOG
-        fi
+        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 $LCMD >>$LOG
+        exec $LCMD >>$LOG 2>>$LOG
     fi
 fi
-- 
cgit v0.12


From 8c0d396181e43158de3f54c479456ca7ed052248 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Mon, 23 Apr 2012 13:00:31 -0500
Subject: LinHES-config: mv_ir.py: replace lircd service with remotes. refs
 #821

---
 abs/core/LinHES-config/PKGBUILD |  4 ++--
 abs/core/LinHES-config/mv_ir.py | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/abs/core/LinHES-config/PKGBUILD b/abs/core/LinHES-config/PKGBUILD
index 2777277..da14839 100644
--- a/abs/core/LinHES-config/PKGBUILD
+++ b/abs/core/LinHES-config/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=LinHES-config
 pkgver=2.3
-pkgrel=65
+pkgrel=66
 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev LinHes-config )
 pkgdesc="Install and configure your system"
 depends=('bc' 'libstatgrab'  'mysql-python' 'expect' 'curl' 'dnsutils' 'parted'
@@ -128,7 +128,7 @@ md5sums=('18af4fe481e1fc2ae02050026eb5cd27'
          '5f3259afe031fda189edae41dd1458f0'
          'dc150c1e2c915a55a616d1af5bb1f6de'
          'b845de3e05c1734cce4b9ac5e8f1baaf'
-         '03d866e4dc287d13734e35f4ebe15edb'
+         '6801f87992b44118a12b6dfe6ea68127'
          '5e69839659d65ddda35b8a9982dc29e9'
          '62b4ce94277c32f525db5c1480670acd'
          'ec6a9961e4d1b53ec1240c5979efff11'
diff --git a/abs/core/LinHES-config/mv_ir.py b/abs/core/LinHES-config/mv_ir.py
index df6feb5..36f7545 100755
--- a/abs/core/LinHES-config/mv_ir.py
+++ b/abs/core/LinHES-config/mv_ir.py
@@ -57,8 +57,8 @@ def add_module(filename,module):
     mv_common.runcmd(cmd)
 
 def unload_all_lirc():
-    logging.debug("    Unloading all lirc modules")
-    cmd = "sv stop lircd"
+    logging.debug("    Unloading all remote modules")
+    cmd = "sv stop remotes"
     mv_common.runcmd(cmd)
     cmd = "killall -9 lircd"
     mv_common.runcmd(cmd)
@@ -83,7 +83,7 @@ def include_file( incfile,filename):
 def setup_ir_remote(Remotetype,templates,mythhome,HostBlasterType):
     logging.debug("    Setup of remote type %s",Remotetype)
     if Remotetype == "no_remote" and HostBlasterType == "None" :
-        mv_common.remove_service("lircd")
+        mv_common.remove_service("remotes")
     elif Remotetype == "tinker":
         pass
     else:
@@ -155,7 +155,7 @@ def setup_ir_remote(Remotetype,templates,mythhome,HostBlasterType):
 
         cmd =  "chmod 755 /etc/lircrc /etc/remote.run"
         mv_common.runcmd(cmd)
-        mv_common.add_service("lircd")
+        mv_common.add_service("remotes")
 
 
 def setup_ir_receiver(ReceiverType,TEMPLATES,HDHRlirc_device,myip):
@@ -375,7 +375,7 @@ def setup_ir(systemconfig, data_config):
         mv_common.runcmd(cmd)
         time.sleep(2)
         mv_common.udev_trigger()
-        cmd="sv start lircd"
+        cmd="sv start remotes"
         mv_common.runcmd(cmd)
         rc = [ True , True ]
     if systemconfig.get("LCDtype"):
-- 
cgit v0.12