Line 0
Link Here
|
|
|
1 |
--- usr/lib/byobu/cpu_freq.orig 2016-04-07 22:05:52 UTC |
2 |
+++ usr/lib/byobu/cpu_freq |
3 |
@@ -20,7 +20,7 @@ |
4 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
5 |
|
6 |
__cpu_freq_detail() { |
7 |
- cat /proc/cpuinfo |
8 |
+ cat /compat/linux/proc/cpuinfo |
9 |
} |
10 |
|
11 |
__cpu_freq() { |
12 |
@@ -29,13 +29,13 @@ __cpu_freq() { |
13 |
read hz < /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq |
14 |
fpdiv $hz "1000000" 1 # 1Ghz |
15 |
freq="$_RET" |
16 |
- elif [ -r "/proc/cpuinfo" ]; then |
17 |
- if egrep -q -s -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo; then |
18 |
- freq=$(egrep -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }') |
19 |
+ elif [ -r "/compat/linux/proc/cpuinfo" ]; then |
20 |
+ if egrep -q -s -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo; then |
21 |
+ freq=$(egrep -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }') |
22 |
else |
23 |
# Must scale frequency by number of processors, if counting bogomips |
24 |
- count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo) |
25 |
- freq=$(egrep -i -m 1 "^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ print $2 }') |
26 |
+ count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /compat/linux/proc/cpuinfo) |
27 |
+ freq=$(egrep -i -m 1 "^bogomips" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ print $2 }') |
28 |
freq=$(printf "%s %s" "$freq" "$count" | awk '{printf "%01.1f\n", $1/$2/1000}') |
29 |
fi |
30 |
elif hz=$(sysctl -n hw.cpufrequency 2>/dev/null); then |