summaryrefslogtreecommitdiff
blob: f71e17d26b1a9443692af62a367a2584aaf15923 (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
26
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/sys-apps/microcode-ctl/files/microcode_ctl.rc,v 1.4 2005/12/26 21:01:37 vapier Exp $

depend() {
	need localmount
}

start() {
	local ret

	# Make sure the kernel supports the microcode device ...
	# if it doesnt, try to modprobe the kernel module
	grep -qo ' microcode$' /proc/misc || modprobe microcode >& /dev/null

	ebegin "Updating microcode"
	/usr/sbin/microcode_ctl -qu -d ${MICROCODE_DEV}
	ret=$?
	eend ${ret} "Failed to update microcode via '${MICROCODE_DEV}'"

	[[ ${MICROCODE_UNLOAD} == "1" || ${MICROCODE_UNLOAD} == "yes" ]] \
		&& rmmod microcode >& /dev/null

	return ${ret}
}