Package: laptop-mode-tools Version: 1.71-1 Severity: normal Tags: patch Dear Maintainer,
When using the wireless-power module (with its config-file unmodified), it fails to enable wireless powersavings. When running with debugging enabled, and when running the borked internal command manually: > sudo iw dev wlan0 set txpower fixed it shows: > Missing TX power level argument. When I manually run the command with an added parameter, e.g.: > sudo iw dev wlan0 set txpower fixed 1 and then check the result with: > sudo iw dev wlan0 info it shows the updated value OK. Note that the lowest value it accepts in my case is 1, not 0. This has been fixed (actually, avoided) upstream with the following sequence of commits: https://github.com/rickysarraf/laptop-mode-tools/commit/3644486a9ee4fda7887fa0ecf224e66c4d12a0d2 https://github.com/rickysarraf/laptop-mode-tools/commit/791191702b91f7e23b280f35e292869631f5ba22 https://github.com/rickysarraf/laptop-mode-tools/commit/9ca191ff3e5b002f759d69435f14c7f54020085f Namely, they use: > iw dev wlan0 set power_save [on/off] and *no* txpower settings if "iw" is available, falling back to the old txpower commands with iwconfig (and fixed a variable typo in the test). So it would be good if upstream's new way of running the two commands could be backported as a Debian patch while we wait for upstream to make the next release for packaging. For that purpose I attached a diff by merging the relevant parts of the above 3 commits (note it is the diff that should be turned into a Debian patch, not a diff for creating the debian patch itself). -- System Information: Debian Release: 9.0 APT prefers unstable APT policy: (900, 'unstable'), (500, 'testing'), (500, 'stable'), (100, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_GB.UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages laptop-mode-tools depends on: ii init-system-helpers 1.48 ii lsb-base 9.20161125 ii psmisc 22.21-2.1+b2 ii util-linux 2.29.2-1 Versions of packages laptop-mode-tools recommends: ii ethtool 1:4.8-1+b1 ii hdparm 9.51+ds-1 ii net-tools 1.60+git20161116.90da8a0-1 ii python-qt4 4.11.4+dfsg-2+b1 ii sdparm 1.08-1+b1 ii udev 232-23 ii wireless-tools 30~pre9-12+b1 Versions of packages laptop-mode-tools suggests: ii acpid 1:2.0.28-1+b1 -- Configuration Files: /etc/laptop-mode/conf.d/auto-hibernate.conf changed [not included] /etc/laptop-mode/conf.d/bluetooth.conf changed [not included] /etc/laptop-mode/conf.d/configuration-file-control.conf changed [not included] /etc/laptop-mode/conf.d/cpufreq.conf changed [not included] /etc/laptop-mode/conf.d/dpms-standby.conf changed [not included] /etc/laptop-mode/conf.d/eee-superhe.conf changed [not included] /etc/laptop-mode/conf.d/kbd-backlight.conf changed [not included] /etc/laptop-mode/conf.d/lcd-brightness.conf changed [not included] /etc/laptop-mode/conf.d/radeon-dpm.conf changed [not included] /etc/laptop-mode/conf.d/runtime-pm.conf changed [not included] /etc/laptop-mode/conf.d/video-out.conf changed [not included] /etc/laptop-mode/conf.d/wireless-ipw-power.conf changed [not included] /etc/laptop-mode/conf.d/wireless-iwl-power.conf changed [not included] -- no debconf information -- debsums errors found:
--- a/usr/share/laptop-mode-tools/modules/wireless-power 2017-01-12 15:57:19.000000000 +0200 +++ b/usr/share/laptop-mode-tools/modules/wireless-power 2017-05-19 16:56:56.701809056 +0300 @@ -66,17 +66,12 @@ if [ -n "$IW" ]; then $IW dev $IF set power_save $ONOFF - if [ $ONOFF = "ON" ]; then - $IW dev $IF set txpower auto - else - $IW dev $IF set txpower fixed - fi else $IWCONFIG $IF power $ONOFF - if [ $ONOFF = "ON" ]; then + if [ $ONOFF = "on" ]; then $IWCONFIG $IF txpower auto else - $IW dev $IF txpower fixed + $IWCONFIG dev $IF txpower fixed fi fi }