hal-polling script in package laptop-mode-tools is incorrect

Bug #308065 reported by Dragonet
4
Affects Status Importance Assigned to Milestone
laptop-mode-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The script /usr/share/laptop-mode-tools/modules/hal-polling in package laptop-mode-tools version1.45-1ubuntu4 has a wrong behavior, so that once hal-polling was disabled, it can never be enabled anymore by this script.

The problem lies in line 7 through 17:

# Some backward compatibility for version 1.42
if [ x$BATT_ENABLE_HAL_POLLING = x1 ] ; then
 BATT_DISABLE_HAL_POLLING=0
else
 BATT_DISABLE_HAL_POLLING=1
fi
if [ x$AC_ENABLE_HAL_POLLING = x1 ] ; then
 AC_DISABLE_HAL_POLLING=0
else
 AC_DISABLE_HAL_POLLING=1
fi

Note that the variable $BATT_ENABLE_HAL_POLLING was replaced by $BATT_DISABLE_HAL_POLLING in newer versions of this package, hence it would be null; therefore $BATT_DISABLE_HAL_POLLING will be always 1 no matter what value it was set in configuration file /etc/laptop-mode/conf.d/hal-polling.conf and hal-polling can be never enabled anymore. Same for $AC_ENABLE_HAL_POLLING and $AC_DISABLE_HAL_POLLING variables.

Steve Langasek (vorlon)
Changed in laptop-mode-tools (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.9 KiB)

This bug was fixed in the package laptop-mode-tools - 1.52-1ubuntu1

---------------
laptop-mode-tools (1.52-1ubuntu1) lucid; urgency=low

  [ Whoopie ]
  * Merge with Debian (LP: #422620; LP: #469517, #308065, #307947),
    remaining changes:
    + Drop sdparm Recommends to Suggests: It is in universe.
    + etc/laptop-mode/laptop-mode.conf: change default spindown time and
      power management modes.
    + Add/Modify pm-utils hooks to ensure laptop-mode is running as
      expected after power change or thaw/resume
      - power.d/laptop-mode: runs laptop-mode on power change
      - sleep.d/99laptop-mode: don't run laptop-mode if disabled in
        /etc/default/laptop-mode
    + etc/init.d/laptop-mode: Check if laptop mode is disabled in
      /etc/default/laptop-mode (that's the file laptop_mode looks into, too,
      but it incorrectly evaluates the ENABLE_LAPTOP_MODE setting) as well
      as in /etc/default/acpi-support.
    + usr/sbin/laptop_mode: Do not parse arguments, ignore "force" and
      let start/stop mean enable/disable.
    + /usr/sbin/laptop_mode: Do not read $ACTIVATE_WITH_POSSIBLE_DATA_LOSS
      from /var/run/laptop-mode-state to see if state has changed.
    + debian/rules: Do not ship acpi/apm scripts (we handle that ourselves)
    + debian/laptop-mode-tools.preinst: Remove any old acpi/apm scripts
    + debian/laptop-mode-tools.postinst: Create /etc/default/laptop-mode
      (with ENABLE_LAPTOP_MODE=false) if the file does not exist yet and we
      are on ppc.
    + Also accept "stop" as second argument since the init script
      calls laptop_mode with "init stop"

  [ Steve Langasek ]
  * Dropped changes, merged in Debian: sleep.d/96laptop-mode: superseded by
    sleep.d/99laptop-mode

laptop-mode-tools (1.52-1) unstable; urgency=low

  * New Upstream Release
    + Initialize DEBUG to 0 by default. THanks to Matthijs Kooijman for
      pointing it out. (Closes: #546371)
    + Add an option to completely disable ethernet devices when on battery.
    + Introduce hooks to enable debug mode for individual modules
    + Use iwconfig to determine device type for iwlwifi devices also
    + Collect the correct exit code for iwconfig execution.
    + Use iwconfig in wireless-iwl-power. Thanks to Darren Hoo for spotting it
    + Handle spaces in mount point names. Thanks to Louis Simard for the patch
    + Clarify about Global Debug mode and Module Specific Debug mode.
    + Fix incorrect variable reference in video-out module. Thanks to Hans
      Werner for noticing that.
  * laptop-mode-tools.preinst: remove (and backup) the obsolete
    /etc/pm/sleep.d/99laptop-mode config file. Thanks to Tormod
    Volden for the fix. (LP: #384875)

laptop-mode-tools (1.51-1) unstable; urgency=low

  * New Upstream Release
    + Add option to blacklist usb devices by their device id.
      Thanks to <email address hidden> for the patch
    + Trigger timer change for power mgmt by doing a device open/close
      The open/close operation can fail if the audio device is busy.
      Since this failure is non-fatal (worst case is that the timer changes
      don't get activated), we don't bother if it was successful or not.
    + Add support fo...

Read more...

Changed in laptop-mode-tools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.