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 | c7ab698c786754b97acd7381b3dfec10d8359303 (patch) | |
tree | 7eb7b611b082f6582dc11d7d307617c127ca32e4 /sys-apps/microcode-ctl | |
parent | Pull old versions. (diff) | |
download | gentoo-2-c7ab698c786754b97acd7381b3dfec10d8359303.tar.gz gentoo-2-c7ab698c786754b97acd7381b3dfec10d8359303.tar.bz2 gentoo-2-c7ab698c786754b97acd7381b3dfec10d8359303.zip |
Add an option to unload the microcode kernel module after we are done using it #116790 by ilGino.
(Portage version: 2.1_pre2)
Diffstat (limited to 'sys-apps/microcode-ctl')
-rw-r--r-- | sys-apps/microcode-ctl/ChangeLog | 7 | ||||
-rw-r--r-- | sys-apps/microcode-ctl/files/microcode_ctl.conf.d | 12 | ||||
-rw-r--r-- | sys-apps/microcode-ctl/files/microcode_ctl.rc | 12 |
3 files changed, 25 insertions, 6 deletions
diff --git a/sys-apps/microcode-ctl/ChangeLog b/sys-apps/microcode-ctl/ChangeLog index 5c5187fc2212..2b3e172eee64 100644 --- a/sys-apps/microcode-ctl/ChangeLog +++ b/sys-apps/microcode-ctl/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-apps/microcode-ctl # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/microcode-ctl/ChangeLog,v 1.13 2005/09/15 00:45:07 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/microcode-ctl/ChangeLog,v 1.14 2005/12/26 21:01:37 vapier Exp $ + + 26 Dec 2005; Mike Frysinger <vapier@gentoo.org> + files/microcode_ctl.conf.d, files/microcode_ctl.rc: + Add an option to unload the microcode kernel module after we are done using + it #116790 by ilGino. *microcode-ctl-1.12 (15 Sep 2005) diff --git a/sys-apps/microcode-ctl/files/microcode_ctl.conf.d b/sys-apps/microcode-ctl/files/microcode_ctl.conf.d index 9e3e7c6cf6d5..0505a80ae92b 100644 --- a/sys-apps/microcode-ctl/files/microcode_ctl.conf.d +++ b/sys-apps/microcode-ctl/files/microcode_ctl.conf.d @@ -1,5 +1,11 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/microcode-ctl/files/microcode_ctl.conf.d,v 1.3 2005/01/08 01:17:49 vapier Exp $ +# /etc/conf.d/microcode_ctl + +# Device to pass to microcode_ctl MICROCODE_DEV="/dev/cpu/microcode" + + +# Should we try to unload the microcode module after we +# update the cpu microcode ? + +MICROCODE_UNLOAD="yes" 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} } |