summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2016-06-24 12:14:52 -0500
committerDoug Goldstein <cardoe@gentoo.org>2016-06-24 12:16:54 -0500
commit13655cd05b4c1177b76921d9944a7aa6de3002c2 (patch)
tree5c38a4e3eb1453754f0232662ee7b4486410c6cb /sys-firmware
parentapp-emulation/containerd: temporary 0.2.2 snapshot release (diff)
downloadgentoo-13655cd05b4c1177b76921d9944a7aa6de3002c2.tar.gz
gentoo-13655cd05b4c1177b76921d9944a7aa6de3002c2.tar.bz2
gentoo-13655cd05b4c1177b76921d9944a7aa6de3002c2.zip
rename sys-apps/microcode-data -> sys-firmware/intel-microcode
Diffstat (limited to 'sys-firmware')
-rw-r--r--sys-firmware/intel-microcode/Manifest5
-rw-r--r--sys-firmware/intel-microcode/files/intel-microcode2ucode.c163
-rw-r--r--sys-firmware/intel-microcode/intel-microcode-20140430.ebuild45
-rw-r--r--sys-firmware/intel-microcode/intel-microcode-20140624.ebuild45
-rw-r--r--sys-firmware/intel-microcode/intel-microcode-20140913.ebuild45
-rw-r--r--sys-firmware/intel-microcode/intel-microcode-20150121-r1.ebuild49
-rw-r--r--sys-firmware/intel-microcode/intel-microcode-20150121.ebuild45
-rw-r--r--sys-firmware/intel-microcode/intel-microcode-20151106.ebuild49
-rw-r--r--sys-firmware/intel-microcode/metadata.xml13
9 files changed, 459 insertions, 0 deletions
diff --git a/sys-firmware/intel-microcode/Manifest b/sys-firmware/intel-microcode/Manifest
new file mode 100644
index 000000000000..c1074e6a8061
--- /dev/null
+++ b/sys-firmware/intel-microcode/Manifest
@@ -0,0 +1,5 @@
+DIST microcode-20140430.tgz 785594 SHA256 2e67767fd561164a2b09831020c2d36600ad336a9c0c117f1964edef284e4351 SHA512 12954522629ce15c4b95c158b6288b3877a3d1f87bea838f8138e53987ef1b6c0edc7a8cbb802a981ccca178b70b4323907aafa7479c0c2fed4497f6fb7bbc1c WHIRLPOOL 92bb063bc14308568ef8a872de54ad99946eb9ec42ac890b11b6cf1f8c07667d386f030a7459cd168652044d87686b61e06ff5a2bcd582c704de6b3b621dbaa2
+DIST microcode-20140624.tgz 787237 SHA256 b4662ac780438a7b2d87e6d26a7066feb807f37c6e5b6fa147089f4edb02ea37 SHA512 c774006aae639e7fae90bc1f5d8308b407e7cd3b7d0da6e35577560bf6201c2b15f7d7b6b0cd727c50be1e9d508b484b067856631fa2598498982109bff0e44c WHIRLPOOL 6051d4a7547e6f74c653d332c54a4711838b670d2707408de7dccddb5d1409994417bae26ce5ec2f72d91b613e14a3381ded301027995bca1fb746baf85000c4
+DIST microcode-20140913.tgz 830537 SHA256 ea6c0ee21d1fbf261f093176a78089c21411e5fe0e2c35b258cedf2b39987e15 SHA512 e179fe0001b1157cc95aee39185f51fd182d53c1bdb30bfc95bc3a70795c32012050f3a4adf06735a77d8ef9c703a330c6a2610b73b70f09f5760e31d39cb89c WHIRLPOOL de56d52d184dd2f21e0ca41dca0bb5b539758de614f4e0eb8e7c8281e97ea6dfcc33c50a3fec7262112dc11e8a78b458b3d7ef8c8b5579d500d358393911565d
+DIST microcode-20150121.tgz 850761 SHA256 23353b93bb421971496cea5e9f9d390ce0ed22580a8cc45ae7b3b322dcd8f6b3 SHA512 f62edd1b666cf381605613766d7e123f0c6debee4448c0ff0882d33c144ad2174656d2501a449f24eb3e4708259e7ec0ff42810739b7d1f34a6a1d9950d17bc4 WHIRLPOOL 573368845333aee9ca23a98cc6711cc22da5b5893a3c29df292df281a024ad9b50ab4893cc0a44b65e86f388fc55e2c53cd0f99a619c3315dd4db5e090b91319
+DIST microcode-20151106.tgz 892805 SHA256 096e39489eef67666be652e81fa372a06b74f39ea3d565dc0287242c668717e7 SHA512 606ce97f0fe76f6a34a857923d3432d8e2368e8a5c504ffa0313f9f016d61b0a5dea26e67662ce1283c1f772ace7318e96a34ebeeeff50b25deb3005ccc6978e WHIRLPOOL 0c73429977e31b8f6230b21889480eda79ecc3feb64a8e6e5a1cebc124a98300f887789650e480611a183237461517aba51b3b31a8450bc5a2e01c5955e7b534
diff --git a/sys-firmware/intel-microcode/files/intel-microcode2ucode.c b/sys-firmware/intel-microcode/files/intel-microcode2ucode.c
new file mode 100644
index 000000000000..caad0323e805
--- /dev/null
+++ b/sys-firmware/intel-microcode/files/intel-microcode2ucode.c
@@ -0,0 +1,163 @@
+/*
+ * Convert Intel microcode.dat into individual ucode files
+ * named: intel-ucode/$family-$model-$stepping
+ *
+ * The subdir intel-ucode/ is created in the current working
+ * directory. We get multiple ucodes in the same file, so they
+ * are appended to an existing file. Make sure the directory
+ * is empty before every run of the converter.
+ *
+ * Kay Sievers <kay.sievers@vrfy.org>
+ */
+
+
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <inttypes.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+struct microcode_header_intel {
+ unsigned int hdrver;
+ unsigned int rev;
+ unsigned int date;
+ unsigned int sig;
+ unsigned int cksum;
+ unsigned int ldrver;
+ unsigned int pf;
+ unsigned int datasize;
+ unsigned int totalsize;
+ unsigned int reserved[3];
+};
+
+union mcbuf {
+ struct microcode_header_intel hdr;
+ unsigned int i[0];
+ char c[0];
+};
+
+int main(int argc, char *argv[])
+{
+ char *filename = "/lib/firmware/microcode.dat";
+ FILE *f;
+ char line[LINE_MAX];
+ char buf[4000000];
+ union mcbuf *mc;
+ size_t bufsize, count, start;
+ int rc = EXIT_SUCCESS;
+
+ if (argv[1] != NULL)
+ filename = argv[1];
+
+ count = 0;
+ mc = (union mcbuf *) buf;
+ f = fopen(filename, "re");
+ if (f == NULL) {
+ printf("open %s: %m\n", filename);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+
+ while (fgets(line, sizeof(line), f) != NULL) {
+ if (sscanf(line, "%x, %x, %x, %x",
+ &mc->i[count],
+ &mc->i[count + 1],
+ &mc->i[count + 2],
+ &mc->i[count + 3]) != 4)
+ continue;
+ count += 4;
+ }
+ fclose(f);
+
+ bufsize = count * sizeof(int);
+ printf("%s: %lu(%luk) bytes, %zu integers\n",
+ filename,
+ bufsize,
+ bufsize / 1024,
+ count);
+
+ if (bufsize < sizeof(struct microcode_header_intel))
+ goto out;
+
+ mkdir("intel-ucode", 0750);
+
+ start = 0;
+ for (;;) {
+ size_t size;
+ unsigned int family, model, stepping;
+ unsigned int year, month, day;
+
+ mc = (union mcbuf *) &buf[start];
+
+ if (mc->hdr.totalsize)
+ size = mc->hdr.totalsize;
+ else
+ size = 2000 + sizeof(struct microcode_header_intel);
+
+ if (mc->hdr.ldrver != 1 || mc->hdr.hdrver != 1) {
+ printf("unknown version/format:\n");
+ rc = EXIT_FAILURE;
+ break;
+ }
+
+ /*
+ * 0- 3 stepping
+ * 4- 7 model
+ * 8-11 family
+ * 12-13 type
+ * 16-19 extended model
+ * 20-27 extended family
+ */
+ family = (mc->hdr.sig >> 8) & 0xf;
+ if (family == 0xf)
+ family += (mc->hdr.sig >> 20) & 0xff;
+ model = (mc->hdr.sig >> 4) & 0x0f;
+ if (family == 0x06)
+ model += ((mc->hdr.sig >> 16) & 0x0f) << 4;
+ stepping = mc->hdr.sig & 0x0f;
+
+ year = mc->hdr.date & 0xffff;
+ month = mc->hdr.date >> 24;
+ day = (mc->hdr.date >> 16) & 0xff;
+
+ asprintf(&filename, "intel-ucode/%02x-%02x-%02x", family, model, stepping);
+ printf("\n");
+ printf("%s\n", filename);
+ printf("signature: 0x%02x\n", mc->hdr.sig);
+ printf("flags: 0x%02x\n", mc->hdr.pf);
+ printf("revision: 0x%02x\n", mc->hdr.rev);
+ printf("date: %04x-%02x-%02x\n", year, month, day);
+ printf("size: %zu\n", size);
+
+ f = fopen(filename, "ae");
+ if (f == NULL) {
+ printf("open %s: %m\n", filename);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+ if (fwrite(mc, size, 1, f) != 1) {
+ printf("write %s: %m\n", filename);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+ fclose(f);
+ free(filename);
+
+ start += size;
+ if (start >= bufsize)
+ break;
+ }
+ printf("\n");
+out:
+ return rc;
+}
diff --git a/sys-firmware/intel-microcode/intel-microcode-20140430.ebuild b/sys-firmware/intel-microcode/intel-microcode-20140430.ebuild
new file mode 100644
index 000000000000..f1ab23ccac05
--- /dev/null
+++ b/sys-firmware/intel-microcode/intel-microcode-20140430.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="23829"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ 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 microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-firmware/intel-microcode/intel-microcode-20140624.ebuild b/sys-firmware/intel-microcode/intel-microcode-20140624.ebuild
new file mode 100644
index 000000000000..d4244ae50ecb
--- /dev/null
+++ b/sys-firmware/intel-microcode/intel-microcode-20140624.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="23984"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ 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 microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-firmware/intel-microcode/intel-microcode-20140913.ebuild b/sys-firmware/intel-microcode/intel-microcode-20140913.ebuild
new file mode 100644
index 000000000000..66a3907c115a
--- /dev/null
+++ b/sys-firmware/intel-microcode/intel-microcode-20140913.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="24290"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ 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 microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-firmware/intel-microcode/intel-microcode-20150121-r1.ebuild b/sys-firmware/intel-microcode/intel-microcode-20150121-r1.ebuild
new file mode 100644
index 000000000000..18647feb8461
--- /dev/null
+++ b/sys-firmware/intel-microcode/intel-microcode-20150121-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="24661"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="initramfs monolithic +split-ucode"
+REQUIRED_USE="|| ( initramfs monolithic split-ucode )"
+
+DEPEND="initramfs? ( sys-apps/iucode_tool )"
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ cp "${FILESDIR}"/intel-microcode2ucode.c ./ || die
+}
+
+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
+ fi
+}
+
+src_install() {
+ insinto /lib/firmware
+ use initramfs && doins microcode.cpio
+ use monolithic && doins microcode.dat
+ use split-ucode && doins -r intel-ucode
+}
diff --git a/sys-firmware/intel-microcode/intel-microcode-20150121.ebuild b/sys-firmware/intel-microcode/intel-microcode-20150121.ebuild
new file mode 100644
index 000000000000..6100e6e56464
--- /dev/null
+++ b/sys-firmware/intel-microcode/intel-microcode-20150121.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="24661"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ 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 microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-firmware/intel-microcode/intel-microcode-20151106.ebuild b/sys-firmware/intel-microcode/intel-microcode-20151106.ebuild
new file mode 100644
index 000000000000..f224706c3458
--- /dev/null
+++ b/sys-firmware/intel-microcode/intel-microcode-20151106.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="25512"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="initramfs monolithic +split-ucode"
+REQUIRED_USE="|| ( initramfs monolithic split-ucode )"
+
+DEPEND="initramfs? ( sys-apps/iucode_tool )"
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ cp "${FILESDIR}"/intel-microcode2ucode.c ./ || die
+}
+
+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
+ fi
+}
+
+src_install() {
+ insinto /lib/firmware
+ use initramfs && doins microcode.cpio
+ use monolithic && doins microcode.dat
+ use split-ucode && doins -r intel-ucode
+}
diff --git a/sys-firmware/intel-microcode/metadata.xml b/sys-firmware/intel-microcode/metadata.xml
new file mode 100644
index 000000000000..f8bcf6658dd3
--- /dev/null
+++ b/sys-firmware/intel-microcode/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<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>
+</pkgmetadata>