From owner-svn-ports-all@freebsd.org Tue Mar 20 14:56:16 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 918EAF53B51; Tue, 20 Mar 2018 14:56:16 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB8D76547; Tue, 20 Mar 2018 14:56:16 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 362E21E419; Tue, 20 Mar 2018 14:56:16 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2KEuGEU069358; Tue, 20 Mar 2018 14:56:16 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2KEuFpa069353; Tue, 20 Mar 2018 14:56:15 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201803201456.w2KEuFpa069353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 20 Mar 2018 14:56:15 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r465088 - in head/sysutils/cpupdate: . files X-SVN-Group: ports-head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head/sysutils/cpupdate: . files X-SVN-Commit-Revision: 465088 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2018 14:56:16 -0000 Author: eugen Date: Tue Mar 20 14:56:15 2018 New Revision: 465088 URL: https://svnweb.freebsd.org/changeset/ports/465088 Log: sysutils/cpupdate: update to g20180320 Additional port changes: - move binary from /bin/ to /sbin/ as this is sysadmin's utility; - supply startup script for boot time updates started as early as possible, before configuration of network interfaces; - make code respect PREFIX; - patch source to kldload("cpuctl") automatically, if needed; - fix some compiler warning; - update pkg-descr to mention that CPU microcode updates bringing new features like IBRS require recent FreeBSD version for sake of CPUCTL_EVAL_CPU_FEATURES support. Added: head/sysutils/cpupdate/files/cpupdate.in (contents, props changed) head/sysutils/cpupdate/files/patch-cpupdate.c (contents, props changed) Modified: head/sysutils/cpupdate/Makefile head/sysutils/cpupdate/distinfo head/sysutils/cpupdate/pkg-descr Modified: head/sysutils/cpupdate/Makefile ============================================================================== --- head/sysutils/cpupdate/Makefile Tue Mar 20 13:41:32 2018 (r465087) +++ head/sysutils/cpupdate/Makefile Tue Mar 20 14:56:15 2018 (r465088) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= cpupdate -DISTVERSION= g20180302 +DISTVERSION= g20180320 CATEGORIES= sysutils MAINTAINER= eugen@FreeBSD.org @@ -11,6 +11,8 @@ 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 @@ -20,9 +22,9 @@ 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 @@ -41,8 +43,11 @@ INTEL_MASTER_SITES= https://downloadmirror.intel.com/2 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 Modified: head/sysutils/cpupdate/distinfo ============================================================================== --- head/sysutils/cpupdate/distinfo Tue Mar 20 13:41:32 2018 (r465087) +++ head/sysutils/cpupdate/distinfo Tue Mar 20 14:56:15 2018 (r465088) @@ -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 Added: head/sysutils/cpupdate/files/cpupdate.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cpupdate/files/cpupdate.in Tue Mar 20 14:56:15 2018 (r465088) @@ -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" Added: head/sysutils/cpupdate/files/patch-cpupdate.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cpupdate/files/patch-cpupdate.c Tue Mar 20 14:56:15 2018 (r465088) @@ -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 Modified: head/sysutils/cpupdate/pkg-descr ============================================================================== --- head/sysutils/cpupdate/pkg-descr Tue Mar 20 13:41:32 2018 (r465087) +++ head/sysutils/cpupdate/pkg-descr Tue Mar 20 14:56:15 2018 (r465088) @@ -3,4 +3,8 @@ 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