commit:     9a1061d10668da791a31a0c79b0c352eccfc3da3
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 11 06:06:23 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 06:18:13 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a1061d1

microcode-data: add USE=initramfs #528712

This flag quickly generates a small initramfs that the kernel needs to
load the microcode at boot time.  This way people don't have to figure
out the right incantations themselves.

 sys-apps/microcode-data/metadata.xml                      | 1 +
 sys-apps/microcode-data/microcode-data-20150121-r1.ebuild | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/sys-apps/microcode-data/metadata.xml 
b/sys-apps/microcode-data/metadata.xml
index 09a573a..4cf0268 100644
--- a/sys-apps/microcode-data/metadata.xml
+++ b/sys-apps/microcode-data/metadata.xml
@@ -3,6 +3,7 @@
 <pkgmetadata>
 <herd>base-system</herd>
 <use>
+       <flag name='initramfs'>install a small initramfs for use with 
CONFIG_MICROCODE_EARLY</flag>
        <flag name='monolithic'>install the large text microcode.dat (used by 
older kernels via microcode_ctl)</flag>
        <flag name='split-ucode'>install the split binary ucode files (used by 
the kernel directly)</flag>
 </use>

diff --git a/sys-apps/microcode-data/microcode-data-20150121-r1.ebuild 
b/sys-apps/microcode-data/microcode-data-20150121-r1.ebuild
index ca78889..70a89d7 100644
--- a/sys-apps/microcode-data/microcode-data-20150121-r1.ebuild
+++ b/sys-apps/microcode-data/microcode-data-20150121-r1.ebuild
@@ -17,8 +17,8 @@ 
SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz";
 LICENSE="intel-ucode"
 SLOT="0"
 KEYWORDS="-* ~amd64 ~x86"
-IUSE="monolithic +split-ucode"
-REQUIRED_USE="|| ( monolithic split-ucode )"
+IUSE="initramfs monolithic +split-ucode"
+REQUIRED_USE="|| ( initramfs monolithic split-ucode )"
 
 RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
 
@@ -30,6 +30,10 @@ src_unpack() {
 }
 
 src_compile() {
+       if use initramfs ; then
+               iucode_tool --write-earlyfw=microcode.cpio microcode.dat || die
+       fi
+
        if use split-ucode ; then
                tc-env_build emake intel-microcode2ucode
                ./intel-microcode2ucode microcode.dat || die
@@ -38,6 +42,7 @@ src_compile() {
 
 src_install() {
        insinto /lib/firmware
+       use initramfs && doins microcode.cpio
        use monolithic && doins microcode.dat
        use split-ucode && doins -r intel-ucode
 }

Reply via email to