summaryrefslogtreecommitdiff
path: root/packages/irda-utils/files
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2007-04-06 10:11:19 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2007-04-06 10:11:19 +0000
commit40097bddbebbc1ec87560eca0bbe8e4bb586bcb8 (patch)
tree06c91d12c8b267766a4b690dda92587b021232cb /packages/irda-utils/files
parent25382a5b4176440e9bdbdce41ef51a1df03a6b6d (diff)
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.
Diffstat (limited to 'packages/irda-utils/files')
-rwxr-xr-xpackages/irda-utils/files/init21
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/irda-utils/files/init b/packages/irda-utils/files/init
index 2d93af34df..1944b9d782 100755
--- a/packages/irda-utils/files/init
+++ b/packages/irda-utils/files/init
@@ -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 @@ fi
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."
;;
*)