initscript tweaks

This commit is contained in:
Dave Jones 2005-11-15 04:06:33 +00:00
parent 8d588a81ec
commit 90db39236d
2 changed files with 11 additions and 7 deletions

View File

@ -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

View File

@ -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 <davej@redhat.com>
- initscript tweaks.
* Tue Sep 13 2005 Dave Jones <davej@redhat.com>
- Update to upstream 1.12