Merge ~joalif/ubuntu/+source/systemd:lp1806012 into ~joalif/ubuntu/+source/systemd:ubuntu/eoan-devel

Proposed by Ioanna Alifieraki
Status: Needs review
Proposed branch: ~joalif/ubuntu/+source/systemd:lp1806012
Merge into: ~joalif/ubuntu/+source/systemd:ubuntu/eoan-devel
Diff against target: 66 lines (+30/-22)
1 file modified
debian/extra/set-cpufreq (+30/-22)
Reviewer Review Type Date Requested Status
Dan Streetman (community) Approve
Review via email: mp+367137@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dan Streetman (ddstreet) wrote :

looks good!

review: Approve

Unmerged commits

fc23499... by Ioanna Alifieraki

Ondemand - add option to configure governor from /etc/default/cpufrequtils

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/extra/set-cpufreq b/debian/extra/set-cpufreq
2index 4ffe126..59da0be 100755
3--- a/debian/extra/set-cpufreq
4+++ b/debian/extra/set-cpufreq
5@@ -5,32 +5,40 @@ set -eu
6 FIRSTCPU=`cut -f1 -d- /sys/devices/system/cpu/online`
7 AVAILABLE="/sys/devices/system/cpu/cpu$FIRSTCPU/cpufreq/scaling_available_governors"
8 DOWN_FACTOR="/sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor"
9+CPUFREQUTILS="/etc/default/cpufrequtils"
10+GOVERNOR=""
11+GOVS="interactive ondemand powersave"
12
13 [ -f $AVAILABLE ] || exit 0
14
15-read governors < $AVAILABLE
16-case $governors in
17- *interactive*)
18- GOVERNOR="interactive"
19- break
20- ;;
21- *ondemand*)
22- GOVERNOR="ondemand"
23- case $(uname -m) in
24- ppc64*)
25- SAMPLING=100
26+if [ -f $CPUFREQUTILS ]; then
27+ echo "/etc/default/cpufrequtils file is present, will follow its policy"
28+ . $CPUFREQUTILS
29+fi
30+
31+GOVS="$GOVERNOR $GOVS"
32+GOVERNOR=""
33+
34+read available_govs < $AVAILABLE
35+for g in $GOVS
36+do
37+ for a in $available_govs
38+ do
39+ if [ "$g" = "$a" ] ; then
40+ GOVERNOR=$g
41+ break 2
42+ fi
43+ done
44+done
45+
46+if [ "$GOVERNOR" = "ondemand" ] ; then
47+ case $(uname -m) in
48+ ppc64*)
49+ SAMPLING=100
50 ;;
51- esac
52- break
53- ;;
54- *powersave*)
55- GOVERNOR="powersave"
56- break
57- ;;
58- *)
59- exit 0
60- ;;
61-esac
62+ esac
63+fi
64+
65
66 [ -n "${GOVERNOR:-}" ] || exit 0
67

Subscribers

People subscribed via source and target branches

to all changes: