diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2008-03-06 19:16:23 -0600 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2008-03-06 19:16:23 -0600 |
commit | a4ca3e7c2d1d1fae584ac23195a13981947884c0 (patch) | |
tree | e8523376f2f8aa01864ad3a6550fc1d293558ff6 /pm | |
parent | 2b082457e3a9d8f8067376fd45668fc7595b8fea (diff) | |
parent | 5da6cdfef068db2fac484e45732f50a572074343 (diff) |
Merge branch 'master' into vlowther-hook-option-processing
Diffstat (limited to 'pm')
-rwxr-xr-x | pm/sleep.d/94cpufreq | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pm/sleep.d/94cpufreq b/pm/sleep.d/94cpufreq index 9157fb4..cfb0c60 100755 --- a/pm/sleep.d/94cpufreq +++ b/pm/sleep.d/94cpufreq @@ -7,12 +7,17 @@ hibernate_cpufreq() { ( cd /sys/devices/system/cpu/ - for x in cpu[0-9]*/cpufreq/scaling_governor ; do - [ -f "$x" ] || continue + for x in cpu[0-9]*; do + # if cpufreq is a symlink, it is handled by another cpu. Skip. + [ -L "$x/cpufreq" ] && continue + gov="$x/cpufreq/scaling_governor" + # if we do not have a scaling_governor file, skip. + [ -f "$gov" ] || continue + # if our temporary governor is not available, skip. grep -q "$TEMPORARY_CPUFREQ_GOVERNOR" \ - "${x%/*}/scaling_available_governors" || continue - savestate "${x%%/*}_governor" $(cat "$x") - echo "$TEMPORARY_CPUFREQ_GOVERNOR" > "$x" + "$x/cpufreq/scaling_available_governors" || continue + savestate "${x}_governor" $(cat "$gov") + echo "$TEMPORARY_CPUFREQ_GOVERNOR" > "$gov" done ) } |