From 90db39236d58db3e4fddc69eec252d1859811618 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 15 Nov 2005 04:06:33 +0000 Subject: [PATCH] initscript tweaks --- microcode_ctl.init | 15 ++++++++------- microcode_ctl.spec | 3 +++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/microcode_ctl.init b/microcode_ctl.init index 9787d62..6b90714 100755 --- a/microcode_ctl.init +++ b/microcode_ctl.init @@ -16,6 +16,7 @@ DEVICE=/dev/cpu/microcode ARGUMENTS=-Qu RETVAL=0 PROGRAM=/sbin/microcode_ctl +DATAFILE=/etc/firmware/microcode.dat . /etc/init.d/functions @@ -25,18 +26,18 @@ RETVAL=0 function start () { RETVAL=1 - # Make sure we are on an intel machine - vendor=`cat /proc/cpuinfo | grep "^vendor_id" | sort -u | awk -F ": " '{ print $2 }'` + # Make sure we are on an Intel machine + vendor=`grep "^vendor_id" /proc/cpuinfo | head -n1 | awk -F ": " '{ print $2 }'` [ "$vendor" != "GenuineIntel" ] && return # Microcode wasn't available until 686's. - family=`cat /proc/cpuinfo | grep "^cpu family" | sort -u | awk -F ": " '{ print $2 }'` + family=`grep "^cpu family" /proc/cpuinfo | head -n1 | awk -F ": " '{ print $2 }'` [ $family -lt 6 ] && return - echo -n $"Applying Intel Microcode update: " + echo -n $"Applying Intel CPU microcode update: " - if [ ! -e /etc/firmware/microcode.dat ]; then - echo $"$0: microcode datafile not present (/etc/firmware/microcode.dat)" + if [ ! -e $DATAFILE ]; then + echo $"$0: CPU microcode data file not present ($DATAFILE)" exit 1 fi @@ -63,7 +64,7 @@ function start () # trap the most common case, errno 19 = no device if [ $RETVAL -eq 19 ]; then - echo $"$0: kernel does not have microcode device support" + echo $"$0: kernel does not have CPU microcode device support" fi /sbin/rmmod microcode echo diff --git a/microcode_ctl.spec b/microcode_ctl.spec index 07c1382..26997cc 100644 --- a/microcode_ctl.spec +++ b/microcode_ctl.spec @@ -82,6 +82,9 @@ family=`cat /proc/cpuinfo | grep "^cpu family" | sort -u | awk -F ": " '{ print exit 0 %changelog +* Mon Nov 14 2005 Dave Jones +- initscript tweaks. + * Tue Sep 13 2005 Dave Jones - Update to upstream 1.12