[Midnightbsd-cvs] mports [23709] trunk/sysutils/devcpu-data: update devcpu-data microcode

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jul 26 23:37:30 EDT 2018


Revision: 23709
          http://svnweb.midnightbsd.org/mports/?rev=23709
Author:   laffer1
Date:     2018-07-26 23:37:29 -0400 (Thu, 26 Jul 2018)
Log Message:
-----------
update devcpu-data microcode

Modified Paths:
--------------
    trunk/sysutils/devcpu-data/Makefile
    trunk/sysutils/devcpu-data/distinfo
    trunk/sysutils/devcpu-data/files/Makefile
    trunk/sysutils/devcpu-data/files/microcode_update.in
    trunk/sysutils/devcpu-data/pkg-plist

Added Paths:
-----------
    trunk/sysutils/devcpu-data/files/ucode-split.c

Removed Paths:
-------------
    trunk/sysutils/devcpu-data/files/ucode-tool.c

Property Changed:
----------------
    trunk/sysutils/devcpu-data/files/microcode_update.in

Modified: trunk/sysutils/devcpu-data/Makefile
===================================================================
--- trunk/sysutils/devcpu-data/Makefile	2018-07-27 03:23:42 UTC (rev 23708)
+++ trunk/sysutils/devcpu-data/Makefile	2018-07-27 03:37:29 UTC (rev 23709)
@@ -1,12 +1,13 @@
 # $MidnightBSD$
 
 PORTNAME=	data
-PORTVERSION=	1.6
+PORTVERSION=	1.18
 CATEGORIES=	sysutils
-MASTER_SITES=	http://downloadmirror.intel.com/25512/eng/:intel \
-		http://www.amd64.org/microcode/:amd
+MASTER_SITES=	https://downloadmirror.intel.com/27945/eng/:intel \
+		FREEBSD_LOCAL/sbruno:amd
 PKGNAMEPREFIX=	devcpu-
-DISTFILES=	microcode-20151106.tgz:intel amd-ucode-2014-12-01.tar.bz2:amd
+DISTFILES=	microcode-20180703.tgz:intel \
+		amd64-microcode.20180525.tar.xz:amd
 
 MAINTAINER=	ports at MidnightBSD.org
 COMMENT=	Intel and AMD CPUs microcode updates
@@ -14,8 +15,10 @@
 LICENSE=	EULA
 LICENSE_NAME=	Intel Software License Agreement
 LICENSE_FILE=	${FILESDIR}/LICENSE
-LICENSE_PERMS=	dist-mirror no-dist-sell pkg-mirror no-pkg-sell
+LICENSE_PERMS=	dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
 
+ONLY_FOR_ARCHS=	amd64 i386
+NO_ARCH=	yes
 NO_WRKSUBDIR=	yes
 
 DATADIR=	${PREFIX}/share/cpucontrol
@@ -22,11 +25,21 @@
 
 USE_RC_SUBR=	microcode_update
 
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 10000
+IGNORE=		Most Update to MidnightBSD 1.0 to use this.
+.endif
+
 post-extract:
-	${CP} -p ${FILESDIR}/Makefile ${FILESDIR}/ucode-tool.c ${WRKSRC}
+	${CP} -p ${FILESDIR}/Makefile ${FILESDIR}/ucode-split.c ${WRKSRC}
 
 do-install:
 	${MKDIR} ${STAGEDIR}${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/microcode_amd.bin ${STAGEDIR}${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/microcode_amd_fam15h.bin ${STAGEDIR}${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/microcode_amd_fam16h.bin ${STAGEDIR}${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/microcode_amd_fam17h.bin ${STAGEDIR}${DATADIR}/
 	${INSTALL_DATA} ${WRKSRC}/mcodes/* ${STAGEDIR}${DATADIR}/
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Modified: trunk/sysutils/devcpu-data/distinfo
===================================================================
--- trunk/sysutils/devcpu-data/distinfo	2018-07-27 03:23:42 UTC (rev 23708)
+++ trunk/sysutils/devcpu-data/distinfo	2018-07-27 03:37:29 UTC (rev 23709)
@@ -1,4 +1,5 @@
-SHA256 (microcode-20151106.tgz) = 096e39489eef67666be652e81fa372a06b74f39ea3d565dc0287242c668717e7
-SIZE (microcode-20151106.tgz) = 892805
-SHA256 (amd-ucode-2014-12-01.tar.bz2) = e8f37ed12955585a625ee7cd48d89f9a04ceb2afa36081b52cc59d08a3bb8293
-SIZE (amd-ucode-2014-12-01.tar.bz2) = 20585
+TIMESTAMP = 1531252245
+SHA256 (microcode-20180703.tgz) = 4a1a346fdf48e1626d4c9d0d47bbbc6a4052f56e359c85a3dd2d10fd555e5938
+SIZE (microcode-20180703.tgz) = 1550181
+SHA256 (amd64-microcode.20180525.tar.xz) = ca2ff90c72e837c9408953edd147efee17a3c96e60ce42a2afa9f484ba5e3ae2
+SIZE (amd64-microcode.20180525.tar.xz) = 20476

Modified: trunk/sysutils/devcpu-data/files/Makefile
===================================================================
--- trunk/sysutils/devcpu-data/files/Makefile	2018-07-27 03:23:42 UTC (rev 23708)
+++ trunk/sysutils/devcpu-data/files/Makefile	2018-07-27 03:37:29 UTC (rev 23709)
@@ -1,18 +1,20 @@
-AMD_UCODE_DIR=	amd-ucode
-AMD_UCODE=	$(AMD_UCODE_DIR)/microcode_amd.bin \
-		$(AMD_UCODE_DIR)/microcode_amd_fam15h.bin \
-		$(AMD_UCODE_DIR)/microcode_amd_fam16h.bin
-INTEL_UCODE=	microcode.dat
+# $FreeBSD: head/sysutils/devcpu-data/files/Makefile 470620 2018-05-22 15:09:38Z sbruno $
+
+INTEL_UCODE=	intel-ucode
 OUTPUT_DIR=	mcodes
+
 all:	ucode
-ucode:	ucode-tool
+ucode:	ucode-split
 	mkdir -p $(OUTPUT_DIR)
-	./ucode-tool -o $(OUTPUT_DIR) -i $(INTEL_UCODE)
-	./ucode-tool -o $(OUTPUT_DIR) -a $(AMD_UCODE)
+	cd ${OUTPUT_DIR} && \
+	for file in \
+	  ../${INTEL_UCODE}/[0-9,a-f][0-9,a-f]-[0-9,a-f][0-9,a-f]-[0-9,a-f][0-9,a-f]; do \
+		../ucode-split $$file; \
+	done
 
-# Use the host cc to compile ucode-tool in case of cross-compile
-ucode-tool: ucode-tool.c
-	cc ucode-tool.c -o $@
+# Use the host cc to compile ucode-split in case of cross-compile
+ucode-split: ucode-split.c
+	cc ucode-split.c -o $@
 
 clean:
-	rm -rf $(OUTPUT_DIR) ucode-tool
+	rm -rf $(OUTPUT_DIR) ucode-split

Modified: trunk/sysutils/devcpu-data/files/microcode_update.in
===================================================================
--- trunk/sysutils/devcpu-data/files/microcode_update.in	2018-07-27 03:23:42 UTC (rev 23708)
+++ trunk/sysutils/devcpu-data/files/microcode_update.in	2018-07-27 03:37:29 UTC (rev 23709)
@@ -1,10 +1,12 @@
 #!/bin/sh
 #
-# $MidnightBSD$
+# $FreeBSD: head/sysutils/devcpu-data/files/microcode_update.in 459084 2018-01-15 17:05:37Z swills $
+#
 
 # PROVIDE:	microcode_update
 # REQUIRE:	root mountcritlocal
 # KEYWORD:	nojail
+# BEFORE:	SERVERS
 
 #
 # Add the following line to /etc/rc.conf to enable flow-capture:
@@ -15,6 +17,7 @@
 # microcode_update_cpus (str):		A list of cpus to update on startup, or "ALL" for all.
 #					Example: microcode_update_cpus_cpus="0 CPU0"
 #					Set to "ALL" by default. 
+# microcode_update_flags (str):		Flags for cpucontrol(8).
 
 . /etc/rc.subr
 
@@ -39,7 +42,7 @@
 
 microcode_update_start()
 {
-	echo "Updating cpucodes..."
+	echo "Updating CPU Microcode..."
 	if [ "${microcode_cpus}" = "ALL" ]; then
 		ncpu=`/sbin/sysctl -n hw.ncpu`
 		cpus=`jot ${ncpu} 0`;
@@ -47,9 +50,23 @@
 		cpus=${microcode_cpus}
 	fi
 	for i in ${cpus}; do
-		${CMT} -u -d "${microcode_update_datadir}" /dev/cpuctl${i} || \
-		    (echo "Failed." && exit 1)
+		${CMT} -u ${microcode_update_flags} \
+                    -d "${microcode_update_datadir}" /dev/cpuctl${i} 2>&1 | \
+                    logger -p daemon.notice -t microcode_update || \
+		    (echo "Microcode Update Failed." && exit 1)
 	done
+	if [ "${microcode_cpus}" = "ALL" ]; then
+                CPUCONTROL_UPDATED=$(cpucontrol -h 2>&1 | grep -q -- -e; echo $?)
+                if [ ${CPUCONTROL_UPDATED} -ne 0 ]; then
+                        echo "Please update your system in order to update CPU microcode."
+                else
+			${CMT} -e /dev/cpuctl0 >/dev/null 2>&1
+			if [ $? -ne 0 ]; then
+				echo "Re-evalulation of CPU flags Failed."
+				exit 1
+			fi
+                fi
+	fi
 	echo "Done."
 }
 
@@ -59,5 +76,6 @@
 : ${microcode_update_enable="NO"}
 : ${microcode_update_datadir="%%DATADIR%%"}
 : ${microcode_cpus="ALL"}
+: ${microcode_update_flags=""}
 
 run_rc_command "$1"


Property changes on: trunk/sysutils/devcpu-data/files/microcode_update.in
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Added: trunk/sysutils/devcpu-data/files/ucode-split.c
===================================================================
--- trunk/sysutils/devcpu-data/files/ucode-split.c	                        (rev 0)
+++ trunk/sysutils/devcpu-data/files/ucode-split.c	2018-07-27 03:37:29 UTC (rev 23709)
@@ -0,0 +1,205 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 The FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/sysutils/devcpu-data/files/ucode-split.c 470255 2018-05-18 01:28:23Z sbruno $
+ */
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static const size_t bufsize = 65536;
+
+/* SDM vol 3 9.11.1 Intel microcode header. */
+struct microcode_update_header {
+	uint32_t header_version;
+	uint32_t update_revision;
+	uint32_t date;			/* BCD mmddyyyy */
+	uint32_t processor_signature;
+	uint32_t checksum;		/* Over update data and header */
+	uint32_t loader_revision;
+	uint32_t processor_flags;
+	uint32_t data_size;
+	uint32_t total_size;
+	uint32_t reserved[3];
+};
+
+/*
+ * SDM vol 2A CPUID EAX = 01h Returns Model, Family, Stepping Information.
+ * Caller must free the returned string.
+ */
+
+static char *
+format_signature(uint32_t signature)
+{
+	char *buf;
+	unsigned family, model, stepping;
+
+	family = (signature & 0xf00) >> 8;
+	model = (signature & 0xf0) >> 4;
+	stepping = signature & 0xf;
+	if (family == 0x06 || family == 0x0f)
+		model += (signature & 0xf0000) >> 12;
+	if (family == 0x0f)
+		family += (signature & 0xff00000) >> 20;
+	asprintf(&buf, "%02x-%02x-%02x", family, model, stepping);
+	if (buf == NULL)
+		err(1, "asprintf");
+	return (buf);
+}
+
+static void
+dump_header(const struct microcode_update_header *hdr)
+{
+	char *sig_str;
+	int i;
+	bool platformid_printed;
+
+	sig_str = format_signature(hdr->processor_signature);
+	printf("header version\t0x%x\n", hdr->header_version);
+	printf("revision\t0x%x\n", hdr->update_revision);
+	printf("date\t\t0x%x\t%04x-%02x-%02x\n", hdr->date,
+	    hdr->date & 0xffff, (hdr->date & 0xff000000) >> 24,
+	    (hdr->date & 0xff0000) >> 16);
+	printf("signature\t0x%x\t\t%s\n", hdr->processor_signature, sig_str);
+	printf("checksum\t0x%x\n", hdr->checksum);
+	printf("loader revision\t0x%x\n", hdr->loader_revision);
+	printf("processor flags\t0x%x", hdr->processor_flags);
+	platformid_printed = false;
+	for (i = 0; i < 8; i++) {
+		if (hdr->processor_flags & 1 << i) {
+			printf("%s%d", platformid_printed ? ", " : "\t\t", i);
+			platformid_printed = true;
+		}
+	}
+	printf("\n");
+	printf("datasize\t0x%x\t\t0x%x\n", hdr->data_size,
+	    hdr->data_size != 0 ? hdr->data_size : 2000);
+	printf("size\t\t0x%x\t\t0x%x\n", hdr->total_size,
+	    hdr->total_size != 0 ? hdr->total_size : 2048);
+	free(sig_str);
+}
+
+static void
+usage(void)
+{
+
+	printf("ucode-split [-v] microcode_file\n");
+	exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+	struct microcode_update_header hdr;
+	char *buf, *output_file, *sig_str;
+	size_t len, resid;
+	ssize_t rv;
+	int c, ifd, ofd;
+	bool vflag;
+
+	vflag = false;
+	while ((c = getopt(argc, argv, "v")) != -1) {
+		switch (c) {
+		case 'v':
+			vflag = true;
+			break;
+		default:
+			usage();
+		}
+	}
+	argc -= optind;
+	argv += optind;
+
+	if (argc != 1)
+		usage();
+
+	ifd = open(argv[0], O_RDONLY);
+	if (ifd < 0)
+		err(1, "open");
+
+	buf = malloc(bufsize);
+	if (buf == NULL)
+		err(1, "malloc");
+
+	for (;;) {
+		/* Read header. */
+		rv = read(ifd, &hdr, sizeof(hdr));
+		if (rv < 0) {
+			err(1, "read");
+		} else if (rv == 0) {
+			break;
+		} else if (rv < (ssize_t)sizeof(hdr)) {
+			errx(1, "invalid microcode header");
+		}
+		if (hdr.header_version != 1)
+			errx(1, "invalid header version");
+
+		if (vflag)
+			dump_header(&hdr);
+
+		sig_str = format_signature(hdr.processor_signature);
+		asprintf(&output_file, "%s.%02x", sig_str,
+		    hdr.processor_flags & 0xff);
+		free(sig_str);
+		if (output_file == NULL)
+			err(1, "asprintf");
+		ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+		if (ofd < 0)
+			err(1, "open");
+
+		/* Write header. */
+		rv = write(ofd, &hdr, sizeof(hdr));
+		if (rv < (ssize_t)sizeof(hdr))
+			err(1, "write");
+
+		/* Copy data. */
+		resid = (hdr.total_size != 0 ? hdr.total_size : 2048) -
+		    sizeof(hdr);
+		if (resid > 1 << 24) /* Arbitrary chosen maximum size. */
+			errx(1, "header total_size too large");
+		while (resid > 0) {
+			len = resid < bufsize ? resid : bufsize;
+			rv = read(ifd, buf, len);
+			if (rv < 0)
+				err(1, "read");
+			else if (rv < (ssize_t)len)
+				errx(1, "truncated microcode data");
+			if (write(ofd, buf, len) < (ssize_t)len)
+				err(1, "write");
+			resid -= len;
+		}
+		if (vflag)
+			printf("written to %s\n\n", output_file);
+		close(ofd);
+		free(output_file);
+	}
+}


Property changes on: trunk/sysutils/devcpu-data/files/ucode-split.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: trunk/sysutils/devcpu-data/files/ucode-tool.c
===================================================================
--- trunk/sysutils/devcpu-data/files/ucode-tool.c	2018-07-27 03:23:42 UTC (rev 23708)
+++ trunk/sysutils/devcpu-data/files/ucode-tool.c	2018-07-27 03:37:29 UTC (rev 23709)
@@ -1,228 +0,0 @@
-/*-
- * Copyright (c) 2013 John Clark <clarkjc at runbox.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/endian.h>
-#include <unistd.h>
-
-#define BUFFER_SIZE	4096
-
-static void	error(const char *fmt, ...);
-static void	process_amd(const char *container, const char *outdir);
-static void	process_intel(const char *filename, const char *outdir);
-
-/*
- * This tool extracts microcode from container files provided by
- * Intel and AMD for their families of popular microprocessors.
- */
-int
-main(int argc, char *argv[])
-{
-	int ch, i, mode = -1;
-	char *outdir = ".";
-
-	/* Parse the command line arguments. */
-	while ((ch = getopt(argc, argv, "aio:")) != -1) {
-		switch (ch) {
-		case 'a':	/* Mode select */
-		case 'i':
-			mode = ch;
-			break;
-		case 'o':	/* Output directory */
-			outdir = optarg;
-			break;
-		default:	/* Unknown */
-			error("Error: Invalid argument\n");
-		}
-	}
-
-	if (mode == 'i') {
-		/* Process Intel microcode container files */
-		for (i = optind; i < argc; i++) {
-			process_intel(argv[i], outdir);
-		}
-	} else if (mode == 'a') {
-		/* Process AMD microcode container files */
-		for (i = optind; i < argc; i++) {
-			process_amd(argv[i], outdir);
-		}
-	} else {
-		error("Error: Invalid mode\n");
-	}
-
-	return 0;
-}
-
-/* Display an error message and exit with a status code of 1. */
-static void
-error(const char *fmt, ...)
-{
-	va_list args;
-
-	if (fmt == NULL) {
-		perror("Error");
-	} else {
-		va_start(args, fmt);
-		vfprintf(stderr, fmt, args);
-		va_end(args);
-	}
-	exit(1);
-}
-
-/* Process an AMD supplied microcode container file. */
-#define AMD_HEADER_LEN		12
-#define AMD_SKIP_OFFSET		8
-#define AMD_UCODE_HEADER_LEN	8
-#define AMD_UCODE_HEADER_TYPE	0x00000001
-#define AMD_UCODE_ID_OFFSET	4
-#define AMD_UCODE_SIG_OFFSET	24
-static void
-process_amd(const char *container, const char *outdir)
-{
-	char outname[FILENAME_MAX];
-	const uint8_t magic[] = {
-		0x44, 0x4d, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00
-	};
-	FILE *fin, *fout;
-	uint8_t *buf;
-	uint32_t id, len, sig;
-	int num;
-
-	if ((buf = malloc(BUFFER_SIZE)) == NULL)
-		error(NULL);
-
-	/* Open the container file and read the header. */
-	if ((fin = fopen(container, "rb")) == NULL)
-		error(NULL);
-	if (fread(buf, AMD_HEADER_LEN, 1, fin) != 1) {
-		error("Error: Truncated file: %s\n", container);
-	}
-
-	/* Check the magic numbers. */
-	if (memcmp(magic, buf, sizeof(magic)) != 0) {
-		error("Error: Invalid file: %s\n", container);
-	}
-
-	/* Seek to the first microcode image. */
-	if (fseek(fin, le32dec(buf + AMD_SKIP_OFFSET), SEEK_CUR) != 0)
-		error(NULL);
-
-	/* Read all microcode images. */
-	while ((num = fread(buf, 1, AMD_UCODE_HEADER_LEN, fin)) != 0) {
-		/* Read and validate the image. */
-		if (num != AMD_UCODE_HEADER_LEN) {
-			error("Error: Truncated file: %s\n", container);
-		}
-		if (le32dec(buf) != AMD_UCODE_HEADER_TYPE) {
-			error("Error: Invalid type: %s\n", container);
-		}
-		len = le32dec(buf + sizeof(uint32_t));
-		if (len > BUFFER_SIZE) {
-			if ((buf = realloc(buf, len)) == NULL)
-				error(NULL);
-		}
-		if (fread(buf, len, 1, fin) != 1) {
-			error("Error: Truncated file: %s\n", container);
-		}
-
-		/* Write the image to an output file. */
-		sig = le32dec(buf + AMD_UCODE_SIG_OFFSET);
-		id = le32dec(buf + AMD_UCODE_ID_OFFSET);
-		snprintf(outname, sizeof(outname), "%s/AMD-%08x-%08x.fw",
-		    outdir, sig, id);
-		if ((fout = fopen(outname, "wb")) == NULL)
-			error(NULL);
-		if (fwrite(buf, len, 1, fout) != 1)
-			error(NULL);
-		if (fclose(fout) != 0)
-			error(NULL);
-	}
-
-	if (fclose(fin) != 0)
-		error(NULL);
-	free(buf);
-}
-
-/* Process an Intel supplied microcode container file. */
-static void
-process_intel(const char *container, const char *outdir)
-{
-	char outname[FILENAME_MAX];
-	FILE *fin, *fout = NULL;
-	char *buf, *token;
-	const char * const sep = ",. \t\n";
-	uint32_t val;
-
-	if ((buf = malloc(BUFFER_SIZE)) == NULL)
-		error(NULL);
-	if ((fin = fopen(container, "r")) == NULL)
-		error(NULL);
-
-	/* Process the container file line by line. */
-	while (fgets(buf, BUFFER_SIZE, fin) != NULL) {
-		if ((token = strtok(buf, sep)) == NULL)
-			continue;
-
-		if (*token == '/') {
-			/* Process a comment line. */
-			if (fout != NULL) {
-				/* Close previous output file. */
-				if (fclose(fout) != 0)
-					error(NULL);
-				fout = NULL;
-			}
-			if ((token = strtok(NULL, sep)) != NULL) {
-				/* Construct next file name. */
-				snprintf(outname, sizeof(outname), "%s/%s.fw",
-				    outdir, token);
-			}
-		} else {
-			/* Process a data line. */
-			if ((fout == NULL) && (token != NULL)) {
-				if ((fout = fopen(outname, "wb")) == NULL)
-					error(NULL);
-			}
-			while (token != NULL) {
-				val = htole32(strtoul(token, NULL, 0));
-				if (fwrite(&val, sizeof(val), 1, fout) != 1)
-					error(NULL);
-				token = strtok(NULL, sep);
-			}
-		}
-	}
-
-	if (fout != NULL) {
-		if (fclose(fout) != 0)
-			error(NULL);
-	}
-	if (fclose(fin) != 0)
-		error(NULL);
-	free(buf);
-}

Modified: trunk/sysutils/devcpu-data/pkg-plist
===================================================================
--- trunk/sysutils/devcpu-data/pkg-plist	2018-07-27 03:23:42 UTC (rev 23708)
+++ trunk/sysutils/devcpu-data/pkg-plist	2018-07-27 03:37:29 UTC (rev 23709)
@@ -1,167 +1,169 @@
-%%DATADIR%%/2f0708.fw
-%%DATADIR%%/AMD-00001020-01000084.fw
-%%DATADIR%%/AMD-00001022-01000083.fw
-%%DATADIR%%/AMD-00001041-010000db.fw
-%%DATADIR%%/AMD-00001043-010000c8.fw
-%%DATADIR%%/AMD-00001062-010000c7.fw
-%%DATADIR%%/AMD-00001080-010000da.fw
-%%DATADIR%%/AMD-00001081-010000d9.fw
-%%DATADIR%%/AMD-000010a0-010000dc.fw
-%%DATADIR%%/AMD-00002031-02000032.fw
-%%DATADIR%%/AMD-00003010-03000027.fw
-%%DATADIR%%/AMD-00005010-05000029.fw
-%%DATADIR%%/AMD-00005020-05000119.fw
-%%DATADIR%%/AMD-00006012-0600063d.fw
-%%DATADIR%%/AMD-00006020-06000832.fw
-%%DATADIR%%/AMD-00006101-06001119.fw
-%%DATADIR%%/AMD-00007001-0700010f.fw
-%%DATADIR%%/M01106C2217.fw
-%%DATADIR%%/M01106CA107.fw
-%%DATADIR%%/M0120661104.fw
-%%DATADIR%%/M0220661105_CV.fw
-%%DATADIR%%/M04106C2218.fw
-%%DATADIR%%/M04106CA107.fw
-%%DATADIR%%/M08106C2219.fw
-%%DATADIR%%/M08106CA107.fw
-%%DATADIR%%/M10106CA107.fw
-%%DATADIR%%/MU163202.fw
-%%DATADIR%%/MU165040.fw
-%%DATADIR%%/MU165041.fw
-%%DATADIR%%/MU165045.fw
-%%DATADIR%%/MU165140.fw
-%%DATADIR%%/MU16522a.fw
-%%DATADIR%%/MU16522c.fw
-%%DATADIR%%/MU16530c.fw
-%%DATADIR%%/MU16530d.fw
-%%DATADIR%%/MU165310.fw
-%%DATADIR%%/MU16600a.fw
-%%DATADIR%%/MU166503.fw
-%%DATADIR%%/MU166a0b.fw
-%%DATADIR%%/MU166a0c.fw
-%%DATADIR%%/MU166a0d.fw
-%%DATADIR%%/MU166d05.fw
-%%DATADIR%%/MU166d06.fw
-%%DATADIR%%/MU166d07.fw
-%%DATADIR%%/MU16810d.fw
-%%DATADIR%%/MU16810e.fw
-%%DATADIR%%/MU16810f.fw
-%%DATADIR%%/MU168111.fw
-%%DATADIR%%/MU168307.fw
-%%DATADIR%%/MU168308.fw
-%%DATADIR%%/MU168607.fw
-%%DATADIR%%/MU168608.fw
-%%DATADIR%%/MU16860a.fw
-%%DATADIR%%/MU16860c.fw
-%%DATADIR%%/MU168a01.fw
-%%DATADIR%%/MU168a04.fw
-%%DATADIR%%/MU168a05.fw
-%%DATADIR%%/MU16b11c.fw
-%%DATADIR%%/MU16b11d.fw
-%%DATADIR%%/MU16b401.fw
-%%DATADIR%%/MU16b402.fw
-%%DATADIR%%/MU26522b.fw
-%%DATADIR%%/MU26530b.fw
-%%DATADIR%%/MU268110.fw
-%%DATADIR%%/MU268602.fw
-%%DATADIR%%/m011066143.fw
-%%DATADIR%%/m011067660F.fw
-%%DATADIR%%/m016fbBA.fw
-%%DATADIR%%/m01f0712.fw
-%%DATADIR%%/m01f0a13.fw
-%%DATADIR%%/m01f2529.fw
-%%DATADIR%%/m01f480c.fw
-%%DATADIR%%/m01f6402.fw
-%%DATADIR%%/m01f6508.fw
-%%DATADIR%%/m021066142.fw
-%%DATADIR%%/m02f0a15.fw
-%%DATADIR%%/m02f241f.fw
-%%DATADIR%%/m02f252a.fw
-%%DATADIR%%/m02f2610.fw
-%%DATADIR%%/m02f2738.fw
-%%DATADIR%%/m02f292d.fw
-%%DATADIR%%/m02f4116.fw
-%%DATADIR%%/m02f480e.fw
-%%DATADIR%%/m03106a4_00000012.fw
-%%DATADIR%%/m03106a5_00000019.fw
-%%DATADIR%%/m041067660F.fw
-%%DATADIR%%/m046fbBC.fw
-%%DATADIR%%/m04f0a14.fw
-%%DATADIR%%/m04f122e.fw
-%%DATADIR%%/m04f241e.fw
-%%DATADIR%%/m04f252b.fw
-%%DATADIR%%/m04f2737.fw
-%%DATADIR%%/m04f292e.fw
-%%DATADIR%%/m04f620f.fw
-%%DATADIR%%/m05206f2_00000037.fw
-%%DATADIR%%/m08106d129.fw
-%%DATADIR%%/m086fbBB.fw
-%%DATADIR%%/m08f2739.fw
-%%DATADIR%%/m08f292f.fw
-%%DATADIR%%/m09106e4_00000003.fw
-%%DATADIR%%/m0df320a.fw
-%%DATADIR%%/m0df330c.fw
-%%DATADIR%%/m101067660F.fw
-%%DATADIR%%/m101067770A.fw
-%%DATADIR%%/m1069507.fw
-%%DATADIR%%/m106f76a.fw
-%%DATADIR%%/m106fbBA.fw
-%%DATADIR%%/m10f2421.fw
-%%DATADIR%%/m10f252c.fw
-%%DATADIR%%/m111067AA0B.fw
-%%DATADIR%%/m1220652_0000000e.fw
-%%DATADIR%%/m12206a7_00000029.fw
-%%DATADIR%%/m12306a9_0000001c.fw
-%%DATADIR%%/m13106e5_00000007.fw
-%%DATADIR%%/m16f25d.fw
-%%DATADIR%%/m16f6d0.fw
-%%DATADIR%%/m16fda4.fw
-%%DATADIR%%/m1df3417.fw
-%%DATADIR%%/m2069507.fw
-%%DATADIR%%/m206d618.fw
-%%DATADIR%%/m206e839.fw
-%%DATADIR%%/m206ec54.fw
-%%DATADIR%%/m206f25c.fw
-%%DATADIR%%/m206f6d1.fw
-%%DATADIR%%/m206fbBA.fw
-%%DATADIR%%/m206fda4.fw
-%%DATADIR%%/m2240671_00000013.fw
-%%DATADIR%%/m22f6809.fw
-%%DATADIR%%/m32306c3_0000001e.fw
-%%DATADIR%%/m3240661_00000012.fw
-%%DATADIR%%/m34f6404.fw
-%%DATADIR%%/m401067660F.fw
-%%DATADIR%%/m406f76b.fw
-%%DATADIR%%/m406fbBC.fw
-%%DATADIR%%/m441067AA0B.fw
-%%DATADIR%%/m46f6d2.fw
-%%DATADIR%%/m5cf4a04.fw
-%%DATADIR%%/m5df4a02.fw
-%%DATADIR%%/m5ff4807.fw
-%%DATADIR%%/m6d206d6_00000619.fw
-%%DATADIR%%/m6d206d7_00000710.fw
-%%DATADIR%%/m6f306f2_00000036.fw
-%%DATADIR%%/m7240651_0000001d.fw
-%%DATADIR%%/m801066144.fw
-%%DATADIR%%/m801067660F.fw
-%%DATADIR%%/m80306f4_00000009.fw
-%%DATADIR%%/m8069547.fw
-%%DATADIR%%/m806ec59.fw
-%%DATADIR%%/m806fa95.fw
-%%DATADIR%%/m806fbBA.fw
-%%DATADIR%%/m806fda4.fw
-%%DATADIR%%/m9220655_00000004.fw
-%%DATADIR%%/m9df4305.fw
-%%DATADIR%%/m9df4406.fw
-%%DATADIR%%/m9df4703.fw
-%%DATADIR%%/mA01067AA0B.fw
-%%DATADIR%%/mbdf4117.fw
-%%DATADIR%%/mbdf4903.fw
-%%DATADIR%%/mc0306d4_00000022.fw
-%%DATADIR%%/med306e4_00000428.fw
-%%DATADIR%%/med306e6_00000600.fw
-%%DATADIR%%/med306e7_0000070d.fw
-%%DATADIR%%/mu267114.fw
-%%DATADIR%%/mu267238.fw
-%%DATADIR%%/mu26732e.fw
-%%DATADIR%%/mu26a003.fw
-%%DATADIR%%/mu26a101.fw
+%%DATADIR%%/06-03-02.00
+%%DATADIR%%/06-05-00.01
+%%DATADIR%%/06-05-00.02
+%%DATADIR%%/06-05-00.08
+%%DATADIR%%/06-05-01.01
+%%DATADIR%%/06-05-02.01
+%%DATADIR%%/06-05-02.02
+%%DATADIR%%/06-05-02.04
+%%DATADIR%%/06-05-03.01
+%%DATADIR%%/06-05-03.02
+%%DATADIR%%/06-05-03.04
+%%DATADIR%%/06-05-03.08
+%%DATADIR%%/06-06-00.01
+%%DATADIR%%/06-06-05.10
+%%DATADIR%%/06-06-0a.02
+%%DATADIR%%/06-06-0a.08
+%%DATADIR%%/06-06-0a.20
+%%DATADIR%%/06-06-0d.02
+%%DATADIR%%/06-06-0d.08
+%%DATADIR%%/06-06-0d.20
+%%DATADIR%%/06-07-01.04
+%%DATADIR%%/06-07-02.04
+%%DATADIR%%/06-07-03.04
+%%DATADIR%%/06-08-01.01
+%%DATADIR%%/06-08-01.04
+%%DATADIR%%/06-08-01.08
+%%DATADIR%%/06-08-01.10
+%%DATADIR%%/06-08-01.20
+%%DATADIR%%/06-08-03.08
+%%DATADIR%%/06-08-03.20
+%%DATADIR%%/06-08-06.01
+%%DATADIR%%/06-08-06.02
+%%DATADIR%%/06-08-06.04
+%%DATADIR%%/06-08-06.10
+%%DATADIR%%/06-08-06.80
+%%DATADIR%%/06-08-0a.10
+%%DATADIR%%/06-08-0a.20
+%%DATADIR%%/06-08-0a.80
+%%DATADIR%%/06-09-05.10
+%%DATADIR%%/06-09-05.20
+%%DATADIR%%/06-09-05.80
+%%DATADIR%%/06-0a-00.04
+%%DATADIR%%/06-0a-01.04
+%%DATADIR%%/06-0b-01.10
+%%DATADIR%%/06-0b-01.20
+%%DATADIR%%/06-0b-04.10
+%%DATADIR%%/06-0b-04.20
+%%DATADIR%%/06-0d-06.20
+%%DATADIR%%/06-0e-08.20
+%%DATADIR%%/06-0e-0c.20
+%%DATADIR%%/06-0e-0c.80
+%%DATADIR%%/06-0f-02.01
+%%DATADIR%%/06-0f-02.20
+%%DATADIR%%/06-0f-06.01
+%%DATADIR%%/06-0f-06.04
+%%DATADIR%%/06-0f-06.20
+%%DATADIR%%/06-0f-07.10
+%%DATADIR%%/06-0f-07.40
+%%DATADIR%%/06-0f-0a.80
+%%DATADIR%%/06-0f-0b.01
+%%DATADIR%%/06-0f-0b.04
+%%DATADIR%%/06-0f-0b.08
+%%DATADIR%%/06-0f-0b.10
+%%DATADIR%%/06-0f-0b.20
+%%DATADIR%%/06-0f-0b.40
+%%DATADIR%%/06-0f-0b.80
+%%DATADIR%%/06-0f-0d.01
+%%DATADIR%%/06-0f-0d.20
+%%DATADIR%%/06-0f-0d.80
+%%DATADIR%%/06-16-01.01
+%%DATADIR%%/06-16-01.02
+%%DATADIR%%/06-16-01.80
+%%DATADIR%%/06-17-06.01
+%%DATADIR%%/06-17-06.04
+%%DATADIR%%/06-17-06.10
+%%DATADIR%%/06-17-06.40
+%%DATADIR%%/06-17-06.80
+%%DATADIR%%/06-17-07.10
+%%DATADIR%%/06-17-0a.11
+%%DATADIR%%/06-17-0a.44
+%%DATADIR%%/06-17-0a.a0
+%%DATADIR%%/06-1a-04.03
+%%DATADIR%%/06-1a-05.03
+%%DATADIR%%/06-1c-02.01
+%%DATADIR%%/06-1c-02.04
+%%DATADIR%%/06-1c-02.08
+%%DATADIR%%/06-1c-0a.01
+%%DATADIR%%/06-1c-0a.04
+%%DATADIR%%/06-1c-0a.08
+%%DATADIR%%/06-1c-0a.10
+%%DATADIR%%/06-1d-01.08
+%%DATADIR%%/06-1e-05.13
+%%DATADIR%%/06-25-02.12
+%%DATADIR%%/06-25-05.92
+%%DATADIR%%/06-26-01.01
+%%DATADIR%%/06-26-01.02
+%%DATADIR%%/06-2a-07.12
+%%DATADIR%%/06-2d-06.6d
+%%DATADIR%%/06-2d-07.6d
+%%DATADIR%%/06-2f-02.05
+%%DATADIR%%/06-3a-09.12
+%%DATADIR%%/06-3c-03.32
+%%DATADIR%%/06-3d-04.c0
+%%DATADIR%%/06-3e-04.ed
+%%DATADIR%%/06-3e-06.ed
+%%DATADIR%%/06-3e-07.ed
+%%DATADIR%%/06-3f-02.6f
+%%DATADIR%%/06-3f-04.80
+%%DATADIR%%/06-45-01.72
+%%DATADIR%%/06-46-01.32
+%%DATADIR%%/06-47-01.22
+%%DATADIR%%/06-4e-03.c0
+%%DATADIR%%/06-55-03.97
+%%DATADIR%%/06-55-04.b7
+%%DATADIR%%/06-56-02.10
+%%DATADIR%%/06-56-03.10
+%%DATADIR%%/06-56-04.10
+%%DATADIR%%/06-56-05.10
+%%DATADIR%%/06-5c-09.03
+%%DATADIR%%/06-5e-03.36
+%%DATADIR%%/06-7a-01.01
+%%DATADIR%%/06-8e-09.c0
+%%DATADIR%%/06-8e-0a.c0
+%%DATADIR%%/06-9e-09.2a
+%%DATADIR%%/06-9e-0a.22
+%%DATADIR%%/06-9e-0b.02
+%%DATADIR%%/0f-00-07.01
+%%DATADIR%%/0f-00-07.02
+%%DATADIR%%/0f-00-0a.01
+%%DATADIR%%/0f-00-0a.02
+%%DATADIR%%/0f-00-0a.04
+%%DATADIR%%/0f-01-02.04
+%%DATADIR%%/0f-02-04.02
+%%DATADIR%%/0f-02-04.04
+%%DATADIR%%/0f-02-04.10
+%%DATADIR%%/0f-02-05.01
+%%DATADIR%%/0f-02-05.02
+%%DATADIR%%/0f-02-05.04
+%%DATADIR%%/0f-02-05.10
+%%DATADIR%%/0f-02-06.02
+%%DATADIR%%/0f-02-07.02
+%%DATADIR%%/0f-02-07.04
+%%DATADIR%%/0f-02-07.08
+%%DATADIR%%/0f-02-09.02
+%%DATADIR%%/0f-02-09.04
+%%DATADIR%%/0f-02-09.08
+%%DATADIR%%/0f-03-02.0d
+%%DATADIR%%/0f-03-03.0d
+%%DATADIR%%/0f-03-04.1d
+%%DATADIR%%/0f-04-01.02
+%%DATADIR%%/0f-04-01.bd
+%%DATADIR%%/0f-04-03.9d
+%%DATADIR%%/0f-04-04.9d
+%%DATADIR%%/0f-04-07.9d
+%%DATADIR%%/0f-04-08.01
+%%DATADIR%%/0f-04-08.02
+%%DATADIR%%/0f-04-08.5f
+%%DATADIR%%/0f-04-09.bd
+%%DATADIR%%/0f-04-0a.5c
+%%DATADIR%%/0f-04-0a.5d
+%%DATADIR%%/0f-06-02.04
+%%DATADIR%%/0f-06-04.01
+%%DATADIR%%/0f-06-04.34
+%%DATADIR%%/0f-06-05.01
+%%DATADIR%%/0f-06-08.22
+%%DATADIR%%/microcode_amd.bin
+%%DATADIR%%/microcode_amd_fam15h.bin
+%%DATADIR%%/microcode_amd_fam16h.bin
+%%DATADIR%%/microcode_amd_fam17h.bin



More information about the Midnightbsd-cvs mailing list