| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/amd-ucode/amd-ucode-2012.01.17.ebuild,v 1.1 2012/01/17 18:54:13 flameeyes Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit versionator linux-info
|
| 8 |
|
| 9 |
MY_P="${PN}-$(replace_all_version_separators -)"
|
| 10 |
|
| 11 |
DESCRIPTION="AMD Family 10h, 11h and 14h microcode patch data"
|
| 12 |
HOMEPAGE="http://www.amd64.org/support/microcode.html"
|
| 13 |
SRC_URI="http://www.amd64.org/pub/microcode/${MY_P}.tar"
|
| 14 |
|
| 15 |
LICENSE="amd-ucode"
|
| 16 |
SLOT="0"
|
| 17 |
IUSE=""
|
| 18 |
|
| 19 |
# only meaningful for x86 and x86-64
|
| 20 |
KEYWORDS="-* ~amd64 ~x86"
|
| 21 |
|
| 22 |
# The license does not allow us to mirror the content.
|
| 23 |
RESTRICT="mirror"
|
| 24 |
|
| 25 |
S="${WORKDIR}/${MY_P}"
|
| 26 |
|
| 27 |
CONFIG_CHECK="~MICROCODE_AMD"
|
| 28 |
ERROR_MICROCODE_AMD="Your kernel needs to support AMD microcode loading. You're suggested to build it as a module as it doesn't require a reboot to reload the microcode, that way."
|
| 29 |
|
| 30 |
src_install() {
|
| 31 |
insinto /lib/firmware/amd-ucode
|
| 32 |
doins microcode_amd.bin microcode_amd_fam15h.bin
|
| 33 |
|
| 34 |
# INSTALL file also has instructions to load it, so install it as
|
| 35 |
# part of the documentation.
|
| 36 |
dodoc README INSTALL
|
| 37 |
}
|
| 38 |
|
| 39 |
pkg_postinst() {
|
| 40 |
local show_modules_info=yes
|
| 41 |
local show_builtin_info=yes
|
| 42 |
|
| 43 |
if linux_config_exists; then
|
| 44 |
if linux_chkconfig_builtin MICROCODE; then
|
| 45 |
show_modules_info=no
|
| 46 |
elif linux_chkconfig_module MICROCODE; then
|
| 47 |
show_builtin_info=no
|
| 48 |
fi
|
| 49 |
fi
|
| 50 |
|
| 51 |
elog "You have installed the microcode for AMD CPUs. The kernel will load"
|
| 52 |
elog "it the next time the microcode driver will be executed."
|
| 53 |
elog ""
|
| 54 |
|
| 55 |
if test $show_modules_info = yes; then
|
| 56 |
elog "If you built the microcode driver as a module, you can issue the"
|
| 57 |
elog "following command to force a reload:"
|
| 58 |
elog ""
|
| 59 |
elog " modprobe -r microcode && modprobe microcode"
|
| 60 |
elog ""
|
| 61 |
fi
|
| 62 |
|
| 63 |
if test $show_builtin_info = yes; then
|
| 64 |
elog "If you built the microcode driver in the kernel, it won't load"
|
| 65 |
elog "the file as is. To update the microcode you'll have to set the"
|
| 66 |
elog "following configuration in the kernel:"
|
| 67 |
elog ""
|
| 68 |
elog " CONFIG_EXTRA_FIRMWARE=\"amd-ucode/microcode_amd.bin amd-ucode/microcode_amd_fam15h.bin\""
|
| 69 |
elog " CONFIG_EXTRA_FIRMWARE_DIR=/lib/firmware"
|
| 70 |
elog ""
|
| 71 |
elog "Please note that this will build the firmware within the kernel"
|
| 72 |
elog "image, so you'll have to rebuild the kernel after an upgrade"
|
| 73 |
elog "of the ${CATEGORY}/${PN} package."
|
| 74 |
elog ""
|
| 75 |
fi
|
| 76 |
}
|