← Back to team overview

desktop-packages team mailing list archive

[Bug 1544612] Re: Missing fix for 1299975 claimed to be in pm-utils (1.4.1-13ubuntu0.1)

 

Actually, this is more tricky than I thought. The validity of the bug
1299975 patch depends on which wireless driver is in use, apparently
reflecting some crufty aspects of sysfs and its driver implementations.

In bug 1299975, on rereading, the reporter (savage) says that with an
Intel wireless device the virtual file presented in
/sys/class/net/$device/device was named "enabled" whereas the script
/usr/lib/pm-utils/power.d/wireless referenced "enable".

Whereas I observe that, if present, the virtual file presented in
/sys/class/net/$device/device is named "enable", just as in the
directory listing in comment #3.

In a Toshiba Tecra 8200 with wlan1 identified as Qualcomm Atheros
ARS212/5213/2414 (driver "ath5k"), it's present as "enable".

In a Dell Inspiron 1721 with wlan0 identified as Broadcom Corporation
BCM4321 (driver "b43-pci-bridge"), it's not present at all in
/sys/class/net/$device/device, but there is a corresponding
/sys/bus/pci/drivers/b43-pci-bridge/0000:0b:00.0/enable (and writing 0
to this file disables the driver). However the test in the wireless
script assumes that the device is disabled if the
/sys/class/net/$device/device/enable* file doesn't exist, so the script
fails in this case.

Presumably

a) the presence of the /sys/class/net/$device/device/enable* file
depends on whether the ability to disable the device via
/sys/class/net/$device/device is supported by the device+driver
combination,

b) if the file is present its exact name depends on some details of the
driver's sysfs interface and installation procedure, but it is either
"enable" or "enabled" (and both are never present together), and

c) if the file is not present the wireless script should assume the
device is enabled.

If these assumptions are valid, the following might be a better bet for
lines 22-23 of /usr/lib/pm-utils/power.d/wireless:

    # Assume device is disabled if enable or enabled file exists containing 0; then skip
    [ -f /sys/class/net/$1/device/enable* ] && [ "$(cat /sys/class/net/$1/device/enable*)" = "0" ] && return 1

Obviously there are multiline options that could be more precise.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to pm-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1544612

Title:
  Missing fix for 1299975 claimed to be in pm-utils (1.4.1-13ubuntu0.1)

Status in pm-utils package in Ubuntu:
  New

Bug description:
  The patch debian/patches/17-fix-wireless-hook.patch for bug 1299975 is
  supposed to be applied in pm-utils (1.4.1-13ubuntu0.1) but is not
  installed in that version from trusty-updates.

  The file /usr/lib/pm-utils/power.d/wireless dated 2014-07-15 16:15 (attached) supposedly installed by the updated package still contains line 23
     [ "$(cat /sys/class/net/$1/device/enabled)" = "1" ] || return 1
  which should be 
     [ "$(cat /sys/class/net/$1/device/enable)" = "1" ] || return 1

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: pm-utils 1.4.1-13ubuntu0.1 [modified: usr/lib/pm-utils/pm-functions]
  ProcVersionSignature: Ubuntu 3.13.0-78.122-generic 3.13.11-ckt33
  Uname: Linux 3.13.0-78-generic i686
  ApportVersion: 2.14.1-0ubuntu3.19
  Architecture: i386
  CurrentDesktop: LXDE
  Date: Thu Feb 11 15:10:05 2016
  InstallationDate: Installed on 2014-07-15 (576 days ago)
  InstallationMedia: Lubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20140416.2)
  PackageArchitecture: all
  SourcePackage: pm-utils
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/1544612/+subscriptions


References