diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-12-26 21:01:37 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-12-26 21:01:37 +0000 |
commit | 39b0a1bfc2bdbe13e006e9d5da519ae9c791a66e (patch) | |
tree | 0ae70d15b843dc096a4a3b2d0dd261648dfddbae /sys-apps/microcode-ctl/files/microcode_ctl.rc | |
parent | Pull old versions. (diff) | |
download | historical-39b0a1bfc2bdbe13e006e9d5da519ae9c791a66e.tar.gz historical-39b0a1bfc2bdbe13e006e9d5da519ae9c791a66e.tar.bz2 historical-39b0a1bfc2bdbe13e006e9d5da519ae9c791a66e.zip |
Add an option to unload the microcode kernel module after we are done using it #116790 by ilGino.
Package-Manager: portage-2.1_pre2
Diffstat (limited to 'sys-apps/microcode-ctl/files/microcode_ctl.rc')
-rw-r--r-- | sys-apps/microcode-ctl/files/microcode_ctl.rc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys-apps/microcode-ctl/files/microcode_ctl.rc b/sys-apps/microcode-ctl/files/microcode_ctl.rc index fe60aa9995ff..f71e17d26b1a 100644 --- a/sys-apps/microcode-ctl/files/microcode_ctl.rc +++ b/sys-apps/microcode-ctl/files/microcode_ctl.rc @@ -1,18 +1,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.3 2005/01/08 01:17:49 vapier Exp $ +# $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} - eend $? "Failed to update microcode via '${MICROCODE_DEV}'" + ret=$? + eend ${ret} "Failed to update microcode via '${MICROCODE_DEV}'" + + [[ ${MICROCODE_UNLOAD} == "1" || ${MICROCODE_UNLOAD} == "yes" ]] \ + && rmmod microcode >& /dev/null + + return ${ret} } |