Commit 10b0d903 authored by Robert Ricci's avatar Robert Ricci

Handle corrupted dmesg output better - sometimes, we get junk left

around from the last boot, and we have more than one CPU: line.
Sometimes (such as at Wisc.), the first instance contains garbage. So,
instead of exiting after the first CPU: line, use a different method
of handling unknown CPU speeds, modeled after chipset.awk .
parent 726314c1
......@@ -5,43 +5,58 @@
# All rights reserved.
#
BEGIN {
found = 0;
}
/^CPU:.*\((24[5-9][0-9]|25[0-4][0-9])\.[0-9]+\-MHz/ {
print "2500";
found = 1;
exit
}
/^CPU:.*\((23[5-9][0-9]|24[0-4][0-9])\.[0-9]+\-MHz/ {
print "2400";
found = 1;
exit
}
/^CPU:.*\((19[5-9][0-9]|20[0-4][0-9])\.[0-9]+\-MHz/ {
print "2000";
found = 1;
exit
}
/^CPU:.*\((17[5-9][0-9]|18[0-4][0-9])\.[0-9]+\-MHz/ {
print "1800";
found = 1;
exit
}
/^CPU:.*\((14[5-9][0-9]|15[0-4][0-9])\.[0-9]+\-MHz/ {
print "1500";
found = 1;
exit
}
/^CPU:.*\(8[0-9][0-9]\.[0-9]+\-MHz/ {
print "850";
found = 1;
exit
}
/^CPU:.*\((72[0-9]|73[0-9])\.[0-9]+\-MHz/ {
print "733";
found = 1;
exit
}
/^CPU:.*\(6[0-9][0-9]\.[0-9]+\-MHz/ {
print "600";
found = 1;
exit
}
/^CPU:.*\(29[0-9]|30[0-9]\.[0-9]+\-MHz/ {
print "300";
found = 1;
exit
}
/^CPU:.*/ {
print "0";
exit
END {
if (found == 0) {
print "0";
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment