Remove linprocfs path

This commit is contained in:
Justin Coffman 2019-11-14 15:20:07 -05:00
commit 69c5c9f103

View file

@ -30,12 +30,12 @@ __cpu_freq() {
fpdiv $hz "1000000" 1 # 1Ghz
freq="$_RET"
elif [ -r "/proc/cpuinfo" ]; then
if egrep -q -s -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo; then
freq=$(egrep -i -m 1 "^cpu MHz|^clock" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }')
if egrep -q -s -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo; then
freq=$(egrep -i -m 1 "^cpu MHz|^clock" /proc/cpuinfo | awk -F"[:.]" '{ printf "%01.1f", $2 / 1000 }')
else
# Must scale frequency by number of processors, if counting bogomips
count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /compat/linux/proc/cpuinfo)
freq=$(egrep -i -m 1 "^bogomips" /compat/linux/proc/cpuinfo | awk -F"[:.]" '{ print $2 }')
count=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo)
freq=$(egrep -i -m 1 "^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ print $2 }')
freq=$(printf "%s %s" "$freq" "$count" | awk '{printf "%01.1f\n", $1/$2/1000}')
fi
elif [ $(uname -s) = 'FreeBSD' ]; then
@ -53,7 +53,7 @@ __cpu_freq() {
freq="$_RET"
fi
elif hz=$(sysctl -n hw.cpufrequency 2>/dev/null); then
fpdiv $hz "1000000000" 1 # 1Ghz
'fpdiv $hz "1000000000" 1 # 1Ghz
freq="$_RET"
fi
[ -n "$freq" ] || return