config_cpu: beautify "Detecting CPU" for SMP systems. 0.5-18
authorMichael Prokop <mika@grml.org>
Tue, 31 Oct 2006 14:36:53 +0000 (15:36 +0100)
committerMichael Prokop <mika@grml.org>
Tue, 31 Oct 2006 14:36:53 +0000 (15:36 +0100)
autoconfig.functions
debian/changelog

index fa5dd55..dbe9d63 100755 (executable)
@@ -1171,7 +1171,14 @@ else
   elif [ ! -e /lib/modules/${KERNEL}/kernel/arch/i386/kernel/cpu/cpufreq -o ! -e /lib/modules/${KERNEL}/kernel/drivers/cpufreq ] ; then
     ewarn "Skipping CPU detection as module dependencies are not fulfilled." ; eend 1
   else
   elif [ ! -e /lib/modules/${KERNEL}/kernel/arch/i386/kernel/cpu/cpufreq -o ! -e /lib/modules/${KERNEL}/kernel/drivers/cpufreq ] ; then
     ewarn "Skipping CPU detection as module dependencies are not fulfilled." ; eend 1
   else
-    einfo "Detecting CPU: `awk -F: '/^processor/{printf " Processor"$2" is"};/^model name/{printf $2};/^vendor_id/{printf vendor};/^cpu MHz/{printf " %dMHz",int($2)};/^cache size/{printf ","$2" Cache"};/^$/{print ""}' /proc/cpuinfo 2>>$DEBUG` " ; eend 0
+    if [[ `grep -c processor /proc/cpuinfo` -gt 1 ]] ; then
+      einfo "Detecting CPU:"
+      CPU=$(awk -F: '/^processor/{printf "     Processor"$2" is"};/^model name/{printf $2};/^vendor_id/{printf vendor};/^cpu MHz/{printf " %dMHz",int($2)};/^cache size/{printf ","$2" Cache"};/^$/{print ""}' /proc/cpuinfo 2>>$DEBUG)
+      echo $CPU | sed 's/ \{1,\}/ /g' 
+      eend 0
+    else
+      einfo "Detecting CPU: `awk -F: '/^processor/{printf " Processor"$2" is"};/^model name/{printf $2};/^vendor_id/{printf vendor};/^cpu MHz/{printf " %dMHz",int($2)};/^cache size/{printf ","$2" Cache"};/^$/{print ""}' /proc/cpuinfo 2>>$DEBUG` " ; eend 0
+    fi
     if /usr/sbin/laptop-detect ; then
     einfo "Detected Laptop - trying to use cpu frequency scaling:"
 #      loadcpumod() {
     if /usr/sbin/laptop-detect ; then
     einfo "Detected Laptop - trying to use cpu frequency scaling:"
 #      loadcpumod() {
index bfa2afb..9336e2d 100644 (file)
@@ -1,3 +1,9 @@
+grml-autoconfig (0.5-18) unstable; urgency=low
+
+  * config_cpu: beautify "Detecting CPU" for SMP systems.
+
+ -- Michael Prokop <mika@grml.org>  Tue, 31 Oct 2006 15:36:18 +0100
+
 grml-autoconfig (0.5-17) unstable; urgency=low
 
   * config_mixer: beautify error output of aumix.
 grml-autoconfig (0.5-17) unstable; urgency=low
 
   * config_mixer: beautify error output of aumix.