Update kvm-probes.d/cpu.sh to deal with PowerPC CPUs (/proc/cpuinfo)

This commit is contained in:
Sledge Sulaweyo authored and Ruben S. Montero committed 2018-04-18 15:00:15 +02:00
1 parent 2432337eda
commit 8ab7de56c0
1 file changed
+13 -3
+13 -3
View File
@@ -16,10 +16,20 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
MODEL=''
if [ -f /proc/cpuinfo ]; then
for NAME in 'model name' 'cpu'; do
MODEL=$(grep -m1 "^${NAME}[[:space:]]*:" /proc/cpuinfo | \
cut -d: -f2 | \
sed -e 's/^ *//')
echo -n "MODELNAME=\""
grep -m 1 "model name" /proc/cpuinfo | cut -d: -f2 | sed -e 's/^ *//' | sed -e 's/$/"/'
if [ -n "${MODEL}" ]; then
break
fi
done
fi
if [ -n "${MODEL}" ]; then
echo "MODELNAME=\"${MODEL}\""
fi