Updated versions of patches in unidiff format. Work with Ubuntu (dep lsb-base) and Debian.
-- Daniele "DnaX" Napolitano https://launchpad.net/~dnax88 http://dnax.netsons.org/
--- irda-utils.orig 2009-02-11 14:13:14.000000000 +0100 +++ /etc/init.d/irda-utils 2009-02-11 14:25:24.000000000 +0100 @@ -26,6 +26,27 @@ SYSCTL="/sbin/sysctl" SMCINIT="/usr/sbin/smcinit" +if [ -f /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions +else + log_action_begin_msg () { + echo "$@" + } + log_daemon_msg () { + echo -n "$...@... " + } + log_end_msg () { + if [ "$1" -eq 0 ]; then + echo done. + else + echo failed. + fi + } + log_action_end_msg () { + :; + } +fi + test -x $DAEMON || exit 0 test -x $SYSCTL || exit 0 @@ -38,7 +59,11 @@ ENABLE="true" read -d " " DEVICE </var/run/irdadev fi -test "$ENABLE" = "false" && exit 0 +if [ "$ENABLE" = "false" ]; then + log_action_begin_msg "Skipping $DESC:" "$NAME (not enabled)" + log_action_end_msg 0 + exit 0 +fi if [ -z "$DEVICE" ]; then DEVICE="/dev/ttyS1" fi @@ -59,7 +84,7 @@ case "$1" in start) - echo -n "Starting $DESC: $NAME" + log_daemon_msg "Starting $DESC" "$NAME" # Running smcinit is needed in some laptops prior to port use # You should set this variable in /etc/default/irda-utils @@ -85,6 +110,7 @@ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \ -- $DEVICE $DONGLE $DISCOVERY + log_end_msg $? sleep 1 if [ -n "$DISCOVERY" ]; then @@ -93,18 +119,17 @@ $SYSCTL -e -q -w net.irda.discovery=0 fi - $SYSCTL -e -q -w net.irda.max_baud_rate=115200 - echo "." + $SYSCTL -e -q -w net.irda.max_baud_rate=$MAX_BAUD_RATE ;; stop) - echo -n "Stopping $DESC: $NAME" + log_daemon_msg "Stopping $DESC" "$NAME" if [ -n "$DISCOVERY" ]; then $SYSCTL -e -q -w net.irda.discovery=0 fi start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON - echo "." + log_end_msg $? ;; #reload) # ;;
--- irda-utils.def.orig 2009-02-11 14:13:34.000000000 +0100 +++ /etc/default/irda-utils 2009-02-11 14:29:15.000000000 +0100 @@ -32,3 +32,7 @@ # running smcinit to initialize the irda device prior to use. # If you device is one of them, set this option to "yes" USE_SMCINIT="no" + +# Set the max baud rate for IrDA device +# Values: 2400, 3600, 9600, 14400, 19200, 28800, 38400, 57600, 115200 +MAX_BAUD_RATE="115200"