diff options
Diffstat (limited to 'sys-apps/microcode-ctl/files/microcode_ctl.rc-r1')
-rw-r--r-- | sys-apps/microcode-ctl/files/microcode_ctl.rc-r1 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys-apps/microcode-ctl/files/microcode_ctl.rc-r1 b/sys-apps/microcode-ctl/files/microcode_ctl.rc-r1 new file mode 100644 index 000000000000..e23347fb1df8 --- /dev/null +++ b/sys-apps/microcode-ctl/files/microcode_ctl.rc-r1 @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +depend() { + need localmount +} + +start() { + local ret + + # Make sure the kernel supports the microcode device ... + # if it doesnt, try to modprobe the kernel module + grep -qs ' microcode$' /proc/misc || modprobe -q microcode + + ebegin "Updating microcode" + microcode_ctl -qu -f /lib/firmware/microcode.dat -d ${MICROCODE_DEV} + ret=$? + eend ${ret} "Failed to update microcode via '${MICROCODE_DEV}'" + + [ "${MICROCODE_UNLOAD}" = "yes" ] && rmmod microcode >/dev/null 2>&1 + + return ${ret} +} |