summaryrefslogtreecommitdiff
blob: ea00d2ae8409e781651f40d03b4902dd221784d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/sbin/openrc-run
# 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}
}