Package: laptop-mode-tools
Version: 1.45-1
Severity: normal

Hello.
In my system, wireless-iwl-power module fails at startup of laptop-mode-tools, 
if the wireless 
interface are not up. The error seems to be that the scriptcannot write power 
level to 
/sys/class/net/$DEVICE/device/power_level if $DEVICE is down.
The error showed is: "/usr/share/laptop-mode-tools/modules/wireless-iwl-power: 
line 48: echo: write error: 
Resource temporarily unavailable"

The driver used is the iwl3945.

The error seems to be corrected if everytime it searches for an interface, it 
checks if it is 
up via /sys/class/net/$DEVICE/device/enable (1 for up, 0 for down)

This change seems to work at least in my computer:

--- wireless-iwl-power  2009-01-13 03:52:00.000000000 +0200
+++ wireless-iwl-power-new      2009-01-13 04:34:10.000000000 +0200
@@ -16,6 +16,7 @@
 findWifiIfsByDriver () {
        local DEVICE;
        local LINK_TARGET;
+    local ENABLED;

        for DEVICE in /sys/class/net/*; do
                if [ -d $DEVICE/wireless -a -h $DEVICE/device/driver ]; then
@@ -23,8 +24,8 @@
                        # the driver.
                        LINK_TARGET=`readlink $DEVICE/device/driver`
                        LINK_TARGET=${LINK_TARGET##*/}
-
-                       if [ "$LINK_TARGET" = "$1" ] ; then
+            ENABLED=`cat $DEVICE/device/enable`
+                       if [ "$LINK_TARGET" = "$1" ] && [ $ENABLED -eq 1 ] ; 
then
                                # add the interface name to the list
                                WIFI_IFNAMES="$WIFI_IFNAMES ${DEVICE##*/}"



-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (500, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-2-erebus (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages laptop-mode-tools depends on:
ii  lsb-base                      3.2-20     Linux Standard Base 3.2 init scrip
ii  util-linux                    2.13.1.1-1 Miscellaneous system utilities

Versions of packages laptop-mode-tools recommends:
ii  acpid                         1.0.8-1    Utilities for using ACPI power man
ii  hal                           0.5.11-8   Hardware Abstraction Layer
ii  hdparm                        8.9-3      tune hard disk parameters for high
ii  sdparm                        1.02-1     Output and modify SCSI device para

laptop-mode-tools suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to