void-packages/srcpkgs/microcode_ctl/files/microcode_ctl.rc
2011-02-27 16:47:49 +01:00

32 lines
557 B
Text

#!/sbin/runscript
: ${MICROCODE_DEVICE:=/dev/cpu/microcode}
: ${MICROCODE_FILE:=/lib/firmware/intel-microcode.dat}
depend()
{
need localmount
before *
}
start()
{
local modloaded
einfo "Applying Intel CPU microcode update"
if [ ! -c ${MICROCODE_DEVICE} ]; then
modprobe -q microcode
if [ $? -ne 0 ]; then
eerror "failed to load microcode module"
fi
fi
if [ ! -f ${MICROCODE_FILE} ]; then
eerror "cannot find microcode file"
fi
microcode_ctl -Q -f ${MICROCODE_FILE}
if [ $? -eq 0 ]; then
modprobe -q -r microcode
fi
eend $?
}