Index: head/sysutils/devcpu-data/Makefile =================================================================== --- head/sysutils/devcpu-data/Makefile (revision 458663) +++ head/sysutils/devcpu-data/Makefile (revision 458664) @@ -1,35 +1,36 @@ # Created by: stas # $FreeBSD$ PORTNAME= data PORTVERSION= 1.13 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= https://downloadmirror.intel.com/27431/eng/:intel \ LOCAL/sbruno:amd PKGNAMEPREFIX= devcpu- DISTFILES= microcode-20180108.tgz:intel amd-ucode-2014-12-01.tar.bz2:amd MAINTAINER= clarkjc@runbox.com COMMENT= Intel and AMD CPUs microcode updates 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 NO_ARCH= yes NO_WRKSUBDIR= yes DATADIR= ${PREFIX}/share/cpucontrol USE_RC_SUBR= microcode_update post-extract: ${CP} -p ${FILESDIR}/Makefile ${FILESDIR}/ucode-tool.c ${WRKSRC} do-install: ${MKDIR} ${STAGEDIR}${DATADIR}/ ${INSTALL_DATA} ${WRKSRC}/mcodes/* ${STAGEDIR}${DATADIR}/ .include Index: head/sysutils/devcpu-data/files/microcode_update.in =================================================================== --- head/sysutils/devcpu-data/files/microcode_update.in (revision 458663) +++ head/sysutils/devcpu-data/files/microcode_update.in (revision 458664) @@ -1,68 +1,78 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: microcode_update # REQUIRE: root mountcritlocal # KEYWORD: nojail # BEFORE: SERVERS # # Add the following line to /etc/rc.conf to enable flow-capture: # microcode_update_enable (bool): Set it to "YES" to update microcode on startup # Set to "NO" by default. # microcode_update_datadir (str): Directory, microcode updates stored in. # Default is "%%DATADIR%%" # 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 name="microcode_update" rcvar=microcode_update_enable stop_cmd=":" start_precmd="microcode_update_prepare" start_cmd="microcode_update_start" requires_modules="cpuctl" CMT="/usr/sbin/cpucontrol" microcode_update_prepare() { if ! kldstat -q -m cpuctl; then if ! kldload cpuctl > /dev/null 2>&1; then warn "Can't load cpuctl module." return 1 fi fi } 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`; else cpus=${microcode_cpus} fi for i in ${cpus}; do ${CMT} -u ${microcode_update_flags} \ - -d "${microcode_update_datadir}" /dev/cpuctl${i} || \ - (echo "Failed." && exit 1) + -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 + for i in ${cpus}; do + ${CMT} -e /dev/cpuctl${i} >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Re-evalutation of CPU flags Failed." + exit 1 + fi + done + fi echo "Done." } load_rc_config $name # Set default values : ${microcode_update_enable="NO"} : ${microcode_update_datadir="%%DATADIR%%"} : ${microcode_cpus="ALL"} : ${microcode_update_flags=""} run_rc_command "$1" Index: head/sysutils/devcpu-data/pkg-message =================================================================== --- head/sysutils/devcpu-data/pkg-message (nonexistent) +++ head/sysutils/devcpu-data/pkg-message (revision 458664) @@ -0,0 +1,20 @@ +Installing this port will allow host startup to update the CPU microcode on +a FreeBSD system automatically. In order to enable this feature, add the +following to the system's /etc/rc.conf: + +microcode_update_enable="YES" + +To ensure the update is applied, reboot the system or start the microcode update +service via: + +# service microcode_update start + +If the CPU requires a microcode update, a console message such as the following +will appear: + +Updating CPU Microcode... +/usr/local/share/cpucontrol/m32306c3_00000022.fw: updating cpu /dev/cpuctl0 from rev 0x17 to rev 0x22... done. +/usr/local/share/cpucontrol/m32306c3_00000022.fw: updating cpu /dev/cpuctl2 from rev 0x17 to rev 0x22... done. +/usr/local/share/cpucontrol/m32306c3_00000022.fw: updating cpu /dev/cpuctl4 from rev 0x17 to rev 0x22... done. +/usr/local/share/cpucontrol/m32306c3_00000022.fw: updating cpu /dev/cpuctl6 from rev 0x17 to rev 0x22... done. +Done. Property changes on: head/sysutils/devcpu-data/pkg-message ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1,2 ## +yes +\ No newline at end of property \ No newline at end of property 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