# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header$ EAPI=4 inherit linux-info toolchain-funcs NUM="21385" DESCRIPTION="Intel IA32 microcode update data" HOMEPAGE="http://urbanmyth.org/microcode/" SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz" LICENSE="intel-ucode" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" RDEPEND="!sys-apps/microcode-data" S="${WORKDIR}" CONFIG_CHECK="~MICROCODE_INTEL" ERROR_MICROCODE_INTEL="Your kernel needs to support Intel microcode loading. You're suggested to build it as a module as it doesn't require a reboot to reload the microcode, that way." src_unpack() { unpack ${A} cp "${FILESDIR}"/intel-microcode2ucode.c ./ || die } src_compile() { tc-env_build emake intel-microcode2ucode ./intel-microcode2ucode microcode.dat || die } src_install() { insinto /lib/firmware doins -r intel-ucode } pkg_postinst() { local show_modules_info=yes local show_builtin_info=yes if linux_config_exists; then if linux_chkconfig_builtin MICROCODE; then show_modules_info=no elif linux_chkconfig_module MICROCODE; then show_builtin_info=no fi fi elog "You have installed the microcode for Intel CPUs. The kernel will load" elog "it the next time the microcode driver will be executed." elog "" if test $show_modules_info = yes; then elog "If you built the microcode driver as a module, you can issue the" elog "following command to force a reload:" elog "" elog " modprobe -r microcode && modprobe microcode" elog "" fi if test $show_builtin_info = yes; then elog "If you built the microcode driver in the kernel, it won't load" elog "the file as is. To update the microcode you'll have to set the" elog "following configuration in the kernel:" elog "" elog " CONFIG_EXTRA_FIRMWARE=\"intel-ucode/THE-APPROPRIATE-FILE-FOR-YOUR-CPU\"" elog " CONFIG_EXTRA_FIRMWARE_DIR=/lib/firmware" elog "" elog "Please note that this will build the firmware within the kernel" elog "image, so you'll have to rebuild the kernel after an upgrade" elog "of the ${CATEGORY}/${PN} package." elog "" fi }