1.4.1-fix-intel-audio-powersave-hook.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From: Florian Kriener <florian@kriener.org>
  2. To: submit@bugs.debian.org
  3. Subject: [pm-utils] wrong path in intel-audio-powersave (and a small bug)
  4. Date: Sat, 25 Sep 2010 11:27:30 +0200
  5. In the script intel-audio-powersave is this loop
  6. for dev in /sys/module/snd_*/parameters/power_save; do
  7. [ -w "$dev/parameters/power_save" ] || continue
  8. printf "Setting power savings for $s to %d..." "$dev##*/" "$1"
  9. echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed.
  10. done
  11. I think it should be
  12. for dev in /sys/module/snd_*; do
  13. [ -w "$dev/parameters/power_save" ] || continue
  14. printf "Setting power savings for %s to %d..." "${dev##*/}" "$1"
  15. echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed.
  16. done
  17. This fixes the two bugs.
  18. diff --git a/pm/power.d/intel-audio-powersave b/pm/power.d/intel-audio-powersave
  19. index 36675a8..da63e40 100644
  20. --- a/pm/power.d/intel-audio-powersave
  21. +++ b/pm/power.d/intel-audio-powersave
  22. @@ -20,9 +20,9 @@ EOF
  23. audio_powersave() {
  24. [ "$INTEL_AUDIO_POWERSAVE" = "true" ] || exit $NA
  25. - for dev in /sys/module/snd_*/parameters/power_save; do
  26. + for dev in /sys/module/snd_*; do
  27. [ -w "$dev/parameters/power_save" ] || continue
  28. - printf "Setting power savings for $s to %d..." "$dev##*/" "$1"
  29. + printf "Setting power savings for %s to %d..." "${dev##*/}" "$1"
  30. echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed.
  31. done
  32. }