aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-10-13 17:28:54 -0400
committerGravatar Jason Gross <jgross@mit.edu>2017-10-13 17:28:54 -0400
commit65d876ee94d2e8e637aae3646fb4145020adc2a0 (patch)
tree5ebc93c55b03fd8104c1a2147de65aab1130995a /etc
parent1ad6f6ba1e91d021f207b2fbdcabfbd537633903 (diff)
Support machines without controllable cpu speed
Diffstat (limited to 'etc')
-rwxr-xr-xetc/governor.sh3
-rwxr-xr-xetc/machine.sh8
2 files changed, 11 insertions, 0 deletions
diff --git a/etc/governor.sh b/etc/governor.sh
index 4e11cf2fd..3b059fd70 100755
--- a/etc/governor.sh
+++ b/etc/governor.sh
@@ -13,6 +13,9 @@ for cpu in "/sys/devices/system/cpu/cpu"[0-9]* ; do
if grep -vq '^1$' "$cpu/online" 2>/dev/null; then
continue
fi
+ if [ ! -e "$cpu/cpufreq/scaling_available_governors" ]; then
+ continue
+ fi
generators="$(cat "$cpu/cpufreq/scaling_available_governors")"
if [ "$#" -eq 0 ] || [ -z "$1" ]; then
usage "$generators"
diff --git a/etc/machine.sh b/etc/machine.sh
index 69edb149a..b57f52679 100755
--- a/etc/machine.sh
+++ b/etc/machine.sh
@@ -2,12 +2,20 @@
set -eu
online_governors() {
+ FOUND=""
for cpu in "/sys/devices/system/cpu/cpu"[0-9]* ; do
if grep -vq '^1$' "$cpu/online" 2>/dev/null; then
continue
fi
+ if [ ! -e "$cpu/cpufreq" ]; then
+ continue
+ fi
cat "$cpu/cpufreq/scaling_governor"
+ FOUND=1
done
+ if [ -z "$FOUND" ]; then
+ echo "nocpufreq_support"
+ fi
}
printf "$(hostname)"