Files
ports/sysutils/cpu-microcode-intel/Makefile
T
Joseph Mingrone d4b93e8846 sysutils/cpu-microcode-intel: Handle extended signature tables
Intel microcode files can contain an extended signature table after the
main payload, listing additional processor signatures and platform flag
combinations that are covered by the same microcode blob.

ucode-split was only reading the primary header signature when naming
output files and ignored the extended table entirely.  As a result,
processors whose signature appeared only in an extended table entry had
no matching split file in ${DATADIR} and therefore no microcode via
cpucontrol(8).

This affected a number of CPU families in the current release, including
Raptor Lake (06-bf-02/05/06/07, Core Gen13/Gen14), Sapphire Rapids
steppings E0-E3 (06-8f-04 through 06-8f-07), Arrow Lake-H (06-c5-02),
Panther Lake (06-cc-02/03), and others.

Extend ucode-split to read the extended signature table and write an
additional output file for each entry.

PR:		295351
Reported by:	fastboot <255.255.255.255@web.de>
Reviewed by:	markj, sbruno
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57046
2026-05-25 23:10:18 -03:00

65 lines
1.7 KiB
Makefile

PORTNAME= microcode
DISTVERSIONPREFIX= microcode-
DISTVERSION= 20260512
PORTREVISION= 1
CATEGORIES= sysutils
PKGNAMEPREFIX= cpu-
PKGNAMESUFFIX= -intel
MAINTAINER= jrm@FreeBSD.org
COMMENT= Intel CPU microcode updates
WWW= https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files
LICENSE= EULA
LICENSE_NAME= Intel Software License Agreement
LICENSE_FILE= ${FILESDIR}/LICENSE
LICENSE_PERMS= dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
ONLY_FOR_ARCHS= amd64 i386
USES= cpe
CPE_PART= o
CPE_VENDOR= intel
CPE_PRODUCT= microcode
USE_GITHUB= yes
GH_ACCOUNT= intel
GH_PROJECT= Intel-Linux-Processor-Microcode-Data-Files
DATADIR= ${PREFIX}/share/cpucontrol
FWDIR= /boot/firmware
NO_ARCH= yes
NO_WRKSUBDIR= yes
OPTIONS_DEFINE= RC SPLIT
OPTIONS_DEFAULT= SPLIT
OPTIONS_SUB= yes
RC_DESC= Depend on RC script port (automatic update method two)
SPLIT_DESC= Install split files (for cpucontrol(8) and RC script)
RC_IMPLIES= SPLIT
RC_RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/microcode_update:sysutils/cpu-microcode-rc
SPLIT_VARS_OFF= NO_BUILD=yes
post-extract:
${CAT} ${WRKSRC}/Intel-Linux-Processor-Microcode-Data-Files-${GH_TAGNAME}/intel-ucode/* \
${WRKSRC}/Intel-Linux-Processor-Microcode-Data-Files-${GH_TAGNAME}/intel-ucode-with-caveats/* \
> ${WRKSRC}/intel-ucode.bin
post-extract-SPLIT-on:
${CP} -p ${FILESDIR}/Makefile ${FILESDIR}/ucode-split.c ${WRKSRC}
${REINPLACE_CMD} 's|%%GH_TAGNAME%%|${GH_TAGNAME}|g' ${WRKSRC}/Makefile
do-install:
${MKDIR} ${STAGEDIR}${FWDIR}
${INSTALL_DATA} ${WRKSRC}/intel-ucode.bin ${STAGEDIR}${FWDIR}/
do-install-SPLIT-on:
${MKDIR} ${STAGEDIR}${DATADIR}/
${INSTALL_DATA} ${WRKSRC}/mcodes/* ${STAGEDIR}${DATADIR}/
.include <bsd.port.mk>