Remove some unnecessary code from the init script.

This commit is contained in:
Dave Jones 2009-09-11 18:36:23 +00:00
parent 896cb9fc88
commit 17c6453e8c
2 changed files with 7 additions and 31 deletions

View File

@ -2,20 +2,9 @@
# chkconfig: 2345 0 99 # chkconfig: 2345 0 99
# description: script to apply cpu microcode # description: script to apply cpu microcode
# vars:
#
# START distribution specific way of kicking programs
# END distribution specific way of checking return status
# PROGRAM the executable to run
# ARGUMENTS the argument we're going to call PROGRAM with
# Check that we're a priviledged user # Check that we're a priviledged user
[ `id -u` = 0 ] || exit 0 [ `id -u` = 0 ] || exit 0
DEVICE=/dev/cpu/microcode
ARGUMENTS=-Qu
RETVAL=0
PROGRAM=/sbin/microcode_ctl
DATAFILE=/lib/firmware/microcode.dat DATAFILE=/lib/firmware/microcode.dat
. /etc/init.d/functions . /etc/init.d/functions
@ -44,38 +33,22 @@ function start ()
/sbin/modprobe microcode /sbin/modprobe microcode
lt=0 lt=0
while [ ! -c $DEVICE ]; do while [ ! -c /dev/cpu/microcode ]; do
lt=$[lt+1]; lt=$[lt+1];
[ $lt -gt 5 ] && break; [ $lt -gt 5 ] && break;
sleep 0.1; sleep 0.1;
done done
# Lets just be sure we have a device file... /sbin/microcode_ctl -Qu
if [ ! -e $DEVICE ]; then
echo $"$0: microcode device $DEVICE doesn't exist?"
exit 1
elif [ ! -c $DEVICE ]; then
echo $"$0: $DEVICE not a character device?"
exit 1
fi
daemon $PROGRAM $ARGUMENTS
RETVAL=$? RETVAL=$?
# trap the most common case, errno 19 = no device
if [ $RETVAL -eq 19 ]; then
echo $"$0: kernel does not have CPU microcode device support"
fi
/sbin/rmmod microcode /sbin/rmmod microcode
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/microcode_ctl
return $RETVAL return $RETVAL
} }
stop() stop()
{ {
rm -f /var/lock/subsys/microcode_ctl
} }
case "$1" in case "$1" in

View File

@ -1,7 +1,7 @@
Summary: Tool to update x86/x86-64 CPU microcode. Summary: Tool to update x86/x86-64 CPU microcode.
Name: microcode_ctl Name: microcode_ctl
Version: 1.17 Version: 1.17
Release: %(R="$Revision$"; RR="${R##: }"; echo ${RR%%?})%{?dist}.1 Release: %(R="$Revision$"; RR="${R##: }"; echo ${RR%%?})%{?dist}
Epoch: 1 Epoch: 1
Group: System Environment/Base Group: System Environment/Base
License: GPLv2+ License: GPLv2+
@ -78,6 +78,9 @@ family=`cat /proc/cpuinfo | grep "^cpu family" | sort -u | awk -F ": " '{ print
exit 0 exit 0
%changelog %changelog
* Fri Sep 11 2009 Dave Jones <davej@redhat.com>
- Remove some unnecessary code from the init script.
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-1.52.1 * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-1.52.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild