1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

- Update to 0.8

- Add rcNG startup script that allows update cpucodes on startup
- Add utility to extract cpucodes from Award BIOS update images
- Add additional amd microcode upodate extracted from update images,
  provided by pav@

Thanks to netchild@ and pav@ for suggestions and information regarding
BIOS updates.
This commit is contained in:
Stanislav Sedov 2007-02-01 21:52:14 +00:00
parent 6e321a8d10
commit cef4580bcf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=183891
5 changed files with 88 additions and 5 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= devcpu
PORTVERSION= 0.7
PORTVERSION= 0.8
PORTREVISION= 0
CATEGORIES= sysutils
MASTER_SITES= http://mbsd.msk.ru/dist/
@ -15,6 +15,11 @@ MAINTAINER= stas@FreeBSD.org
COMMENT= Kernel module that provides access to i386 MSRs and cpuid info
USE_BZIP2= yes
USE_RC_SUBR= devcpu
USE_RUBY= yes
RUBY_NO_BUILD_DEPENDS= yes
RUBY_NO_RUN_DEPENDS= yes
RUBY_SHEBANG_FILES= tools/extract_mcodes.rb
ONLY_FOR_ARCHS= i386 amd64
NO_PACKAGE= depends on kernel
@ -23,6 +28,8 @@ PLIST_SUB= KMODDIR="${KMODDIR:C,^/,,}"
KMODDIR= /boot/modules
MAKE_ENV+= KMODDIR="${KMODDIR}"
OPTIONS= EXTRACTOR "Install Award Bios microcode extracting utility" off
MAN4= cpu.4
MAN8= cpu_microcode_tool.8
@ -32,6 +39,14 @@ MAN8= cpu_microcode_tool.8
IGNORE= not supported
.endif
.if defined(WITH_EXTRACTOR)
RUN_DEPENDS+= ${RUBY_SITEARCHLIBDIR}/mmap.so:${PORTSDIR}/devel/ruby-mmap \
${RUBY_SITEARCHLIBDIR}/lhalib.so:${PORTSDIR}/archivers/ruby-lha
PLIST_SUB+= EXTRACTOR=""
.else
PLIST_SUB+= EXTRACTOR="@comment "
.endif
MAKE_ENV+= KMODDIR="${KMODDIR}" \
BINDIR="${PREFIX}/bin"
@ -57,6 +72,10 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/
.endif
.if defined(WITH_EXTRACTOR)
${INSTALL_SCRIPT} ${WRKSRC}/tools/extract_mcodes.rb ${PREFIX}/libexec/
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

View File

@ -1,3 +1,3 @@
MD5 (devcpu-0.7.tar.bz2) = 351f21ce145d77218ced07ba7f3c98fe
SHA256 (devcpu-0.7.tar.bz2) = 1f0f6a1f5eebe920c5ad15261d08d6f5f4d09243e8d5fbba7f14e5014bb3627a
SIZE (devcpu-0.7.tar.bz2) = 424032
MD5 (devcpu-0.8.tar.bz2) = ff996a41ab326a0f3186e6dca95993b9
SHA256 (devcpu-0.8.tar.bz2) = 01c94462decb99be37e6ddd1ec81782fde4c242b1304a49ab8fa064a67bfb2e6
SIZE (devcpu-0.8.tar.bz2) = 427743

View File

@ -0,0 +1,54 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: devcpu
# REQUIRE: root mountcritlocal
# KEYWORD: nojail
#
# Add the following line to /etc/rc.conf to enable flow-capture:
# devcpu_enable (bool): Set it to "YES" to update cpucodes on startup
# Set to "NO" by default.
# devcpu_datadir (str): Directory, cpucode updates stored in.
# Default is "%%DATADIR%%"
# devcpu_cpus (str): A list of cpus to update on startup, or "-a" for all.
# Example: devcpu_cpus="cpu0 /dev/cpu1"
# Set to "-a" by default.
. /etc/rc.subr
name="devcpu"
rcvar=`set_rcvar`
stop_cmd=":"
start_precmd="devcpu_prepare"
start_cmd="devcpu_start"
requires_modules="cpu"
CMT="%%PREFIX%%/bin/cpu_microcode_tool"
devcpu_prepare()
{
if ! kldstat -q -m cpu; then
if ! kldload cpu > /dev/null 2>&1; then
warn "Can't load cpu module."
return 1
fi
fi
}
devcpu_start()
{
echo "Updating cpucodes."
${CMT} -I "${devcpu_datadir}" ${devcpu_cpus}
}
load_rc_config $name
# Set default values
: ${devcpu_enable="NO"}
: ${devcpu_datadir="%%DATADIR%%"}
: ${devcpu_cpus="-a"}
run_rc_command "$1"

View File

@ -9,9 +9,17 @@ To load it, issue
Then you can access MSR registers or cpuid info via /dev/cpu%d or using
3d-party programs, e.g. x86info.
For information regarding microcode update feature refer to
For information regarding microcode update features refer to
cpu_mictocode_tool(4) manpage.
You might be interested in enabling automatic microcode update on startup.
This can be achieved by adding the line devcpu_enable="YES" to /etc/rc.conf.
Refer to rcNG devcpu script for additional info.
You can also use extract_mcodes.rb utility to extract cpucode updates
from vendor-supplied BIOS updates. The utility currently supports only
Award/Phoenix-compatible BIOS images.
Please, report any problems to maintainer. Thanks!
=============================================================================

View File

@ -57,6 +57,7 @@ include/cpu.h
%%DATADIR%%/MU268310.fw
%%DATADIR%%/MU268602.fw
%%DATADIR%%/MU26a401.fw
%%DATADIR%%/amd4.fw
%%DATADIR%%/bu27_fb.fw
%%DATADIR%%/d2_619.fw
%%DATADIR%%/k8_ucode_0f48.fw
@ -115,6 +116,7 @@ include/cpu.h
%%DATADIR%%/mu26732e.fw
%%DATADIR%%/mu26a003.fw
%%DATADIR%%/mu26a101.fw
%%EXTRACTOR%%libexec/extract_mcodes.rb
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm %%DATADIR%%