usr/lib/byobu/cpu_freq: fix cpu frequency detection on ARM, LP: #675442

This commit is contained in:
Dustin Kirkland 2010-11-24 12:44:32 -06:00
commit f867ac70dd
2 changed files with 7 additions and 3 deletions

6
debian/changelog vendored
View file

@ -1,8 +1,12 @@
byobu (3.11) unreleased; urgency=low byobu (3.11) unreleased; urgency=low
[ Dustin Kirkland ]
* README: minor edit to the instructions; tested and working for me now * README: minor edit to the instructions; tested and working for me now
-- Dustin Kirkland <kirkland@dustinkirkland.com> Mon, 22 Nov 2010 18:39:14 -0600 [ Marcin Juszkiewicz ]
* usr/lib/byobu/cpu_freq: fix cpu frequency detection on ARM, LP: #675442
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 24 Nov 2010 12:43:03 -0600
byobu (3.10-0ubuntu1) natty; urgency=low byobu (3.10-0ubuntu1) natty; urgency=low

View file

@ -28,8 +28,8 @@ fi
if [ -r "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ]; then if [ -r "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ]; then
freq=$(awk '{ printf "%.1f", $1 / 1000000 }' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq) freq=$(awk '{ printf "%.1f", $1 / 1000000 }' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
else else
if freq=$(egrep -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo | awk -F"[:.]" '{ printf "%.1f", $2 / 1000 }'); then if egrep -q -s -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo; then
true freq=$(egrep -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo | awk -F"[:.]" '{ printf "%.1f", $2 / 1000 }')
else else
# Must scale frequency by number of processors, if counting bogomips # Must scale frequency by number of processors, if counting bogomips
count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo) count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo)