diff --git a/sysutils/cpu-microcode-amd/Makefile b/sysutils/cpu-microcode-amd/Makefile --- a/sysutils/cpu-microcode-amd/Makefile +++ b/sysutils/cpu-microcode-amd/Makefile @@ -1,5 +1,6 @@ PORTNAME= microcode PORTVERSION= 20231019 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/amd-ucode/ PKGNAMEPREFIX= cpu- @@ -24,6 +25,8 @@ RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/microcode_update:sysutils/cpu-microcode-rc DATADIR= ${PREFIX}/share/cpucontrol +FWDIR= /boot/firmware + EXTRACT_CMD= ${CP} EXTRACT_BEFORE_ARGS= # empty EXTRACT_AFTER_ARGS= . @@ -31,12 +34,18 @@ NO_BUILD= yes NO_WRKSUBDIR= yes -PLIST_FILES= ${DISTFILES:S/^/${DATADIR}\//g:C/\?.*//} +PLIST_FILES= ${DISTFILES:S/^/${DATADIR}\//g:C/\?.*//} \ + ${FWDIR}/amd-ucode.bin _REV= 06afd7f939c5b245b2af9e0fee13026f2aaf77fa +post-extract: + ${CAT} ${WRKSRC}/microcode_amd* > ${WRKSRC}/amd-ucode.bin + do-install: ${MKDIR} ${STAGEDIR}${DATADIR}/ + ${MKDIR} ${STAGEDIR}${FWDIR} + ${INSTALL_DATA} ${WRKSRC}/amd-ucode.bin ${STAGEDIR}${FWDIR}/ .for f in ${DISTFILES} ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DATADIR}/${f:C/\?.*//} .endfor diff --git a/sysutils/cpu-microcode-rc/files/pkg-message.in b/sysutils/cpu-microcode-rc/files/pkg-message.in --- a/sysutils/cpu-microcode-rc/files/pkg-message.in +++ b/sysutils/cpu-microcode-rc/files/pkg-message.in @@ -4,23 +4,28 @@ This port includes an RC script, which is one of two methods to update the CPU microcode on a FreeBSD system. -1. The first method does not require the RC script included here and is - only supported with Intel processors. It is the preferred method, - because it ensures that any CPU features introduced by a microcode - update are visible to the kernel by applying the update before the - kernel performs CPU feature detection. +1. Early loading. + This method does not use the RC script included here. + This is the preferred method, because it ensures that any CPU features + added or removed by a microcode update are visible to the kernel by + applying the update before the kernel performs CPU feature detection. - To enable updates using the first method, add the following lines to + To enable updates using early loading, add the following lines to /boot/loader.conf: cpu_microcode_load="YES" + + and the appropriate one of these lines: + cpu_microcode_name="/boot/firmware/intel-ucode.bin" + cpu_microcode_name="/boot/firmware/amd-ucode.bin" The microcode update will be loaded when the system is rebooted. -2. The second method, which uses the RC script included here, can be - enabled by adding the following line to /etc/rc.conf: +2. Late loading. + This method, which does use the RC script included here, is enabled by + adding the following line to /etc/rc.conf: microcode_update_enable="YES" diff --git a/sysutils/cpu-microcode/Makefile b/sysutils/cpu-microcode/Makefile --- a/sysutils/cpu-microcode/Makefile +++ b/sysutils/cpu-microcode/Makefile @@ -1,5 +1,6 @@ PORTNAME= microcode PORTVERSION= 1.0 +PORTREVISION= 1 CATEGORIES= sysutils PKGNAMEPREFIX= cpu- @@ -8,7 +9,7 @@ ONLY_FOR_ARCHS= amd64 i386 -RUN_DEPENDS= ${LOCALBASE}/share/cpucontrol/microcode_amd.bin:sysutils/cpu-microcode-amd \ +RUN_DEPENDS= /boot/firmware/amd-ucode.bin:sysutils/cpu-microcode-amd \ /boot/firmware/intel-ucode.bin:sysutils/cpu-microcode-intel USES= metaport