Index: head/sysutils/cpupdate/Makefile =================================================================== --- head/sysutils/cpupdate/Makefile (revision 465087) +++ head/sysutils/cpupdate/Makefile (revision 465088) @@ -1,48 +1,53 @@ # Created by: Eugene Grosbein # $FreeBSD$ PORTNAME= cpupdate -DISTVERSION= g20180302 +DISTVERSION= g20180320 CATEGORIES= sysutils MAINTAINER= eugen@FreeBSD.org COMMENT= CPU microcode update utility for x86 LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE +USE_RC_SUBR= ${PORTNAME} + ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON= specific to x86 processors SUB_FILES= pkg-message SUB_LIST= CPM_DIR=${CPM_DIR} INTEL_DIR=${INTEL_DIR} USE_GITHUB= yes GH_ACCOUNT= kernschmelze GH_PROJECT= ${PORTNAME} -GH_TAGNAME= 58bc0ca +GH_TAGNAME= b0df539 -PLIST_FILES= bin/${PORTNAME} man/man8/${PORTNAME}.8.gz +PLIST_FILES= sbin/${PORTNAME} man/man8/${PORTNAME}.8.gz CPM_ACCOUNT= platomav CPM_PROJECT= CPUMicrocodes CPM_TAGNAME= 2ece631 OPTIONS_DEFINE= CPM INTEL CPM_DESC= Download platomav/CPUMicrocodes collection CPM_GH_ACCOUNT= ${CPM_ACCOUNT}:cpm CPM_GH_PROJECT= ${CPM_PROJECT}:cpm CPM_GH_TAGNAME= ${CPM_TAGNAME}:cpm CPM_DIR=${WRKDIR}/${CPM_PROJECT}-${CPM_TAGNAME} INTEL_PACK= microcode-20180312.tgz INTEL_DESC= Download Intel microcode pack ${INTEL_PACK} INTEL_MASTER_SITES= https://downloadmirror.intel.com/27591/eng/:intel INTEL_DISTFILES= ${INTEL_PACK}:intel INTEL_DIR= ${WRKDIR}/intel-ucode +post-patch: + ${REINPLACE_CMD} -e "s,/usr/local/share/cpupdate,${DATADIR},g" ${WRKSRC}/cpupdate.h + do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MANPREFIX}/man/man8 .include Index: head/sysutils/cpupdate/distinfo =================================================================== --- head/sysutils/cpupdate/distinfo (revision 465087) +++ head/sysutils/cpupdate/distinfo (revision 465088) @@ -1,7 +1,7 @@ -TIMESTAMP = 1521367334 +TIMESTAMP = 1521545124 SHA256 (microcode-20180312.tgz) = 0b381face2df1b0a829dc4fa8fa93f47f39e11b1c9c22ebd44f8614657c1e779 SIZE (microcode-20180312.tgz) = 3789662 -SHA256 (kernschmelze-cpupdate-g20180302-58bc0ca_GH0.tar.gz) = a44ff576290051b68241cb8e5af8874db8dbdb1d728a349d9ba1a174a5fc2483 -SIZE (kernschmelze-cpupdate-g20180302-58bc0ca_GH0.tar.gz) = 12574 +SHA256 (kernschmelze-cpupdate-g20180320-b0df539_GH0.tar.gz) = 5edb60b1ce5534f85c83676dc475e44800f4e5a2d4df7376ba0187e9b5cc17e9 +SIZE (kernschmelze-cpupdate-g20180320-b0df539_GH0.tar.gz) = 4566043 SHA256 (platomav-CPUMicrocodes-2ece631_GH0.tar.gz) = bc45bad50b1c2bf86e0a4810d98d8e84328e84dd506d45774079bc87cfb01e15 SIZE (platomav-CPUMicrocodes-2ece631_GH0.tar.gz) = 4577042 Index: head/sysutils/cpupdate/files/cpupdate.in =================================================================== --- head/sysutils/cpupdate/files/cpupdate.in (nonexistent) +++ head/sysutils/cpupdate/files/cpupdate.in (revision 465088) @@ -0,0 +1,29 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: cpupdate +# REQUIRE: FILESYSTEMS kldxref +# BEFORE: netif +# KEYWORD: nojail + +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# cpupdate_enable (bool): Set to NO by default. +# Set it to YES to enable cpupdate. +# cpupdate_flags (string): Command line flags for cpupdate. +# Default is "". + +. /etc/rc.subr + +name=cpupdate +rcvar=cpupdate_enable + +load_rc_config $name + +: ${cpupdate_enable:="NO"} +: ${cpupdate_flags="-w -u"} +command=%%PREFIX%%/sbin/${name} + +run_rc_command "$1" Property changes on: head/sysutils/cpupdate/files/cpupdate.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/cpupdate/files/patch-cpupdate.c =================================================================== --- head/sysutils/cpupdate/files/patch-cpupdate.c (nonexistent) +++ head/sysutils/cpupdate/files/patch-cpupdate.c (revision 465088) @@ -0,0 +1,45 @@ +--- cpupdate.c.orig 2018-03-20 04:24:53 UTC ++++ cpupdate.c +@@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); + + #include + #include ++#include ++#include + #include + #include + #include +@@ -99,6 +101,16 @@ usage( void) + exit(EX_USAGE); + } + ++static int ++modload( const char *name) ++{ ++ if (modfind(name) < 0) ++ if (kldload(name) < 0 || modfind(name) < 0) { ++ warn("%s: module not found", name); ++ return 0; ++ } ++ return 1; ++} + + static int + cpu_getCoreNum( void) +@@ -111,6 +123,7 @@ cpu_getCoreNum( void) + if (dirp == NULL) { + r = -1; + } else { ++ modload("cpuctl"); + while ((direntry = readdir(dirp)) != NULL) { + if (direntry->d_namlen == 0) + continue; +@@ -466,7 +479,7 @@ main( int argc, char *argv[]) + #else + if (!r) { + INFO( 10, "No updating error.\n"); +- INFO( 10, "NOTICE: This FreeBSD version does not support registering new CPU features!\n", numCores); ++ INFO( 10, "NOTICE: This FreeBSD version does not support registering new CPU features!\n"); + handler->freeucodeinfo( &cpupbuf); + } + #endif Property changes on: head/sysutils/cpupdate/files/patch-cpupdate.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ 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 Index: head/sysutils/cpupdate/pkg-descr =================================================================== --- head/sysutils/cpupdate/pkg-descr (revision 465087) +++ head/sysutils/cpupdate/pkg-descr (revision 465088) @@ -1,6 +1,10 @@ x86 CPU microcode utility for BSD. As of March 2018, it is still work in progress but should do its job for most cases already. +Note: update FreeBSD to version level 1101507 for 11.x or 1200055 for 12.0 +before building/using this utility if your microcode update brings +new CPU features like Indirect Branch Restricted Speculation (IBRS). + WWW: https://github.com/kernschmelze/cpupdate