[oe-commits] org.oe.dev irda-utils: Make service script detect default IrDA port on PXA2xx devices.

pfalcon commit openembedded-commits at lists.openembedded.org
Fri Apr 6 10:31:33 UTC 2007


irda-utils: Make service script detect default IrDA port on PXA2xx devices.
* Some issue is that some PXA2xx devices use ttyS2 for non-IrDA, these should 
be added to case *before* '"XScale-PXA2"*'. This should not be a problem as
irattach is no longer started on boot, only manually.
* Otherwise, assume that default is no IrDA, not some random serial port.
* A bit of reformatting, too.

Author: pfalcon at openembedded.org
Branch: org.openembedded.dev
Revision: 38adb5ed0ade384a3d60d0c1ff8910ec38ab74b1
ViewMTN: http://monotone.openembedded.org/revision.psp?id=38adb5ed0ade384a3d60d0c1ff8910ec38ab74b1
Files:
1
packages/irda-utils/files/init
Diffs:

#
# mt diff -rb13026a6acf1b6e770c03a27d126771c086f27e0 -r38adb5ed0ade384a3d60d0c1ff8910ec38ab74b1
#
# 
# 
# patch "packages/irda-utils/files/init"
#  from [db1886c6f6bab388b0b1fbc5da3539272d3c8b94]
#    to [50e53478559c164daabeebad47dfa85420fdccf7]
# 
============================================================
--- packages/irda-utils/files/init	db1886c6f6bab388b0b1fbc5da3539272d3c8b94
+++ packages/irda-utils/files/init	50e53478559c164daabeebad47dfa85420fdccf7
@@ -1,21 +1,26 @@
 #! /bin/sh
 
+NAME="irattach"
+
 module_id() {
         awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
 }
+cpuid_id() {
+        awk '/Processor/ { print $3; exit; }' /proc/cpuinfo
+}
 
 if [ ! -f /etc/sysconfig/irda ]; then
 
-    case `module_id` in
-	"HP iPAQ H2200" | "HP iPAQ HX4700" | "HTC Universal")
+    case `cpuid_id` in
+	"XScale-PXA2"*)
 	    IRDA=yes
 	    DEVICE=/dev/ttyS2
 	    DONGLE=
 	    DISCOVERY=
 	    ;;
 	*)
-	    IRDA=yes
-	    DEVICE=/dev/ttyS1
+	    IRDA=no
+	    DEVICE=/dev/null
 	    DONGLE=
 	    DISCOVERY=
 	    ;;
@@ -48,19 +53,19 @@ case "$1" in
 case "$1" in
   start)
         echo -n "Starting IrDA: "
-		irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
+	irattach ${DEVICE} ${ARGS} > /dev/null 2>&1
         echo "$NAME."
         ;;
   stop)
         echo -n "Stopping IrDA: "
-		killall irattach > /dev/null 2>&1
+	killall irattach > /dev/null 2>&1
         echo "$NAME."
         ;;
   restart|force-reload)
         echo -n "Restarting IrDA: "
-		irattach ${DEVICE} ${ARGS} > /dev/null 2>&1 &
+	irattach ${DEVICE} ${ARGS} > /dev/null 2>&1
         sleep 1
-		killall irattach > /dev/null 2>&1
+	killall irattach > /dev/null 2>&1
         echo "$NAME."
         ;;
   *)






More information about the Openembedded-commits mailing list