From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 24 09:50:08 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2169106568D for ; Sun, 24 May 2009 09:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6BC8FC08 for ; Sun, 24 May 2009 09:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4O9o7w4005370 for ; Sun, 24 May 2009 09:50:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4O9o76u005369; Sun, 24 May 2009 09:50:07 GMT (envelope-from gnats) Resent-Date: Sun, 24 May 2009 09:50:07 GMT Resent-Message-Id: <200905240950.n4O9o76u005369@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Hajimu UMEMOTO Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18EE21065670 for ; Sun, 24 May 2009 09:46:48 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (unknown [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id C913F8FC1E for ; Sun, 24 May 2009 09:46:47 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id n4O9jmcJ098783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 May 2009 18:45:52 +0900 (JST) (envelope-from ume@mahoroba.org) Message-Id: Date: Sun, 24 May 2009 18:45:48 +0900 From: Hajimu UMEMOTO To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: decke@bluelife.at Subject: ports/134902: cpupowerd doesn't need to depend upon devcpu on 7.2-RELEASE X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Hajimu UMEMOTO List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2009 09:50:09 -0000 >Number: 134902 >Category: ports >Synopsis: cpupowerd doesn't need to depend upon devcpu on 7.2-RELEASE >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun May 24 09:50:07 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Hajimu UMEMOTO >Release: FreeBSD 7.2-STABLE i386 >Organization: Internet Mutual Aid Society Yokohama, Japan >Environment: System: FreeBSD asuka.mahoroba.org 7.2-STABLE FreeBSD 7.2-STABLE #0: Thu May 21 21:27:10 JST 2009 root@asuka.mahoroba.org:/usr/obj/usr/src/sys/ASUKA amd64 >Description: Since cpuctl(4) was MFC'ed, sysutils/cpupowerd doesn't need to depend upon sysutils/devcpu on 7.2-RELEASE and later. >How-To-Repeat: Try `kldload cpuctl' on 7.2-RELEASE and later. >Fix: Please apply the attched patch to sysutils/cpupowerd. --Multipart_Sun_May_24_18:45:48_2009-1 Content-Type: text/x-patch; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="cpupowerd-use_cpuctl.diff" Content-Transfer-Encoding: 7bit Index: cpupowerd/Makefile diff -u cpupowerd/Makefile.orig cpupowerd/Makefile --- cpupowerd/Makefile.orig 2009-01-10 03:52:52.000000000 +0900 +++ cpupowerd/Makefile 2009-05-24 16:30:34.817720205 +0900 @@ -23,8 +23,11 @@ .include -.if ${OSVERSION} < 800042 +.if (${OSVERSION} < 800042 && ${OSVERSION} >= 800000) || ${OSVERSION} < 701102 BUILD_DEPENDS+= ${LOCALBASE}/include/cpu.h:${PORTSDIR}/sysutils/devcpu +SUB_LIST+= CPUCTL="cpu" +.else +SUB_LIST+= CPUCTL="cpuctl" .endif .if defined(WITH_CREATELOAD) Index: cpupowerd/files/cpupowerd.in diff -u cpupowerd/files/cpupowerd.in.orig cpupowerd/files/cpupowerd.in --- cpupowerd/files/cpupowerd.in.orig 2008-11-23 22:43:09.000000000 +0900 +++ cpupowerd/files/cpupowerd.in 2009-05-24 16:40:30.567642929 +0900 @@ -20,13 +20,10 @@ name="cpupowerd" rcvar=`set_rcvar` command=%%PREFIX%%/sbin/${name} +start_precmd="${name}_precmd" load_rc_config $name -if [ ! -c "/dev/cpu0" -a ! -c "/dev/cpuctl0" ]; then - kldload cpu -fi - # set default : ${cpupowerd_enable="NO"} : ${cpupowerd_config="%%PREFIX%%/etc/cpupowerd.conf"} @@ -34,4 +31,11 @@ command_args="-d -c ${cpupowerd_config} ${cpupowerd_flags}" +cpupowerd_precmd() +{ + if [ ! -c "/dev/%%CPUCTL%%0" ]; then + kldload %%CPUCTL%% + fi +} + run_rc_command "$1" Index: cpupowerd/files/patch-libcpupowerd.c diff -u -p /dev/null cpupowerd/files/patch-libcpupowerd.c --- /dev/null 2009-05-24 16:44:18.000000000 +0900 +++ cpupowerd/files/patch-libcpupowerd.c 2009-05-24 16:17:09.828029912 +0900 @@ -0,0 +1,44 @@ +Index: libcpupowerd.c +diff -u -p libcpupowerd.c.orig libcpupowerd.c +--- libcpupowerd.c.orig 2009-01-01 22:05:10.000000000 +0900 ++++ libcpupowerd.c 2009-05-24 16:16:35.182882907 +0900 +@@ -34,7 +34,8 @@ + #include + #ifdef __FreeBSD__ + #include +-#if __FreeBSD_version < 800042 ++#if (__FreeBSD_version < 800042 && __FreeBSD_version >= 800000) || \ ++ __FreeBSD_version < 701102 + #include + #define RDMSR CPU_RDMSR + #define WRMSR CPU_WRMSR +@@ -627,7 +628,8 @@ static int libcpupowerd_get_interfacefil + static int libcpupowerd_read_msr_ioctl(char *msrfile, unsigned long index, unsigned long long *msrvalue) + { + int fd; +- #if __FreeBSD_version < 800042 ++ #if (__FreeBSD_version < 800042 && __FreeBSD_version >= 800000) || \ ++ __FreeBSD_version < 701102 + cpu_msr_args_t args; + #else + cpuctl_msr_args_t args; +@@ -663,7 +665,8 @@ static int libcpupowerd_read_msr_ioctl(c + static int libcpupowerd_write_msr_ioctl(char *msrfile, unsigned long index, unsigned long long *msrvalue) + { + int fd; +- #if __FreeBSD_version < 800042 ++ #if (__FreeBSD_version < 800042 && __FreeBSD_version >= 800000) || \ ++ __FreeBSD_version < 701102 + cpu_msr_args_t args; + #else + cpuctl_msr_args_t args; +@@ -698,7 +701,8 @@ static int libcpupowerd_write_msr_ioctl( + static int libcpupowerd_read_cpuid_ioctl(char *cpuidfile, unsigned long index, unsigned long *eax, unsigned long *ebx, unsigned long *ecx, unsigned long *edx) + { + int fd; +- #if __FreeBSD_version < 800042 ++ #if (__FreeBSD_version < 800042 && __FreeBSD_version >= 800000) || \ ++ __FreeBSD_version < 701102 + cpu_cpuid_args_t args; + #else + cpuctl_cpuid_args_t args; --Multipart_Sun_May_24_18:45:48_2009-1-- >Release-Note: >Audit-Trail: >Unformatted: --Multipart_Sun_May_24_18:45:48_2009-1 Content-Type: text/plain; charset=US-ASCII