Bug 797966 - pm-utils intel-audio-powersave script error results in logging errors in pm-powersave.log
Summary: pm-utils intel-audio-powersave script error results in logging errors in pm-p...
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 12.2
Classification: openSUSE
Component: Other (show other bugs)
Version: Final
Hardware: x86-64 openSUSE 12.2
: P5 - None : Minor (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords: easy_fix
Depends on:
Blocks:
 
Reported: 2013-01-10 22:59 UTC by Dirk Weber
Modified: 2013-05-02 08:05 UTC (History)
1 user (show)

See Also:
Found By: Community User
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Weber 2013-01-10 22:59:57 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Firefox/17.0

The script /usr/lib/pm-utils/power.d/intel-audio-powersave contains errors which result in error entries in /var/log/pm-powersave.log

The problem exists in
pm-utils-1.4.1-18.6.1.x86_64
(current version of openSUSE 12.2) and also in 

pm-utils-1.4.1-24.2.x86_64
(current version of openSUSE factory/12.3MS2).

The faulty log entry looks like this:
Running hook /usr/lib/pm-utils/power.d/intel-audio-powersave false:
/usr/lib/pm-utils/power.d/intel-audio-powersave: line 25: printf: {/sys/module/snd_ac97_codec##*/}: invalid number
Setting power savings for  to 0...Setting power savings for  to 0...Done.


following patch solves the problem:

25c25
<       printf "Setting power savings for %s to %d..." "${dev##*/}" "$1"
---
>       printf "Setting power savings for $s to %d..." "{$dev##*/}" "$1"

With this patch the log entry looks like this:

/usr/lib/pm-utils/power.d/hal-cd-polling false: success.
Running hook /usr/lib/pm-utils/power.d/intel-audio-powersave false:
Setting power savings for snd_ac97_codec to 0...Done.






Reproducible: Always

Steps to Reproduce:
1.audio hardware detected by the script exists /sys/module/snd_*
2.intel-audio-powersave must apply settings (e.g. at system startup)
3.check /var/log/pm-powersave.log
Actual Results:  
log data in /var/log/pm-powersave.log:

Running hook /usr/lib/pm-utils/power.d/intel-audio-powersave false:
/usr/lib/pm-utils/power.d/intel-audio-powersave: line 25: printf: {/sys/module/snd_ac97_codec##*/}: invalid number
Setting power savings for  to 0...Setting power savings for  to 0...Done.

Expected Results:  
no errors in /var/log/pm-powersave.log, correct devicename.

patch for /usr/lib/pm-utils/power.d/intel-audio-powersave

25c25
<       printf "Setting power savings for %s to %d..." "${dev##*/}" "$1"
---
>       printf "Setting power savings for $s to %d..." "{$dev##*/}" "$1"
Comment 1 Peter Linnell 2013-01-14 02:17:25 UTC
https://build.opensuse.org/request/show/148335 pending
Comment 2 Bernhard Wiedemann 2013-01-16 18:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (797966) was mentioned in
https://build.opensuse.org/request/show/148745 Factory / pm-utils
Comment 3 Bernhard Wiedemann 2013-04-12 14:00:30 UTC
This is an autogenerated message for OBS integration:
This bug (797966) was mentioned in
https://build.opensuse.org/request/show/163752 Maintenance /
Comment 4 Benjamin Brunner 2013-04-22 14:53:20 UTC
Update released for openSUSE 12.2. Resolved fixed.
Comment 5 Swamp Workflow Management 2013-04-22 15:05:04 UTC
openSUSE-RU-2013:0705-1: An update that has 7 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 633491,768867,782891,797966,806632,806635,806641
CVE References: 
Sources used:
openSUSE 12.3 (src):    pm-utils-1.4.1-26.5.1
Comment 6 Dirk Weber 2013-04-22 18:26:00 UTC
the patch was not correctly included into pm-utils-1.4.1-26.5.1.x86_64
and one error is back:

####
Running hook /usr/lib/pm-utils/power.d/intel-audio-powersave false:
/usr/lib/pm-utils/power.d/intel-audio-powersave: line 25: printf: snd_ac97_codec: invalid number
Setting power savings for  to 0...Setting power savings for  to 0...Done.
####

the line 25 of the script should read:
printf "Setting power savings for %s to %d..." "${dev##*/}" "$1"

but the released script contains:
printf "Setting power savings for $s to %d..." "${dev##*/}" "$1"

To be more verbose: there is no variable $s, it should be the format specifier %s
Comment 7 Swamp Workflow Management 2013-05-02 08:05:21 UTC
openSUSE-RU-2013:0733-1: An update that has 7 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 633491,768867,782891,797966,806632,806635,806641
CVE References: 
Sources used:
openSUSE 12.2 (src):    pm-utils-1.4.1-18.10.1