From ume@mahoroba.org  Sun May 24 09:46:51 2009
Return-Path: <ume@mahoroba.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 18EE21065670
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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: <ygeljom7s1f.wl%ume@mahoroba.org>
Date: Sun, 24 May 2009 18:45:48 +0900
From: Hajimu UMEMOTO <ume@mahoroba.org>
Reply-To: Hajimu UMEMOTO <ume@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: decke@bluelife.at
Subject: cpupowerd doesn't need to depend upon devcpu on 7.2-RELEASE
X-Send-Pr-Version: 3.113

>Number:         134902
>Category:       ports
>Synopsis:       sysutils/cpupowerd doesn't need to depend upon devcpu on 7.2-RELEASE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 24 09:50:07 UTC 2009
>Closed-Date:    Mon May 25 17:23:36 UTC 2009
>Last-Modified:  Mon May 25 17:30:01 UTC 2009
>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 <bsd.port.pre.mk>
 
-.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 <sys/sysctl.h>
+ #ifdef __FreeBSD__
+ #include <sys/param.h>
+-#if __FreeBSD_version < 800042
++#if (__FreeBSD_version < 800042 && __FreeBSD_version >= 800000) ||	\
++	__FreeBSD_version < 701102
+ #include <cpu.h>
+ #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:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sun May 24 11:36:42 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134902 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: decke@bluelife.at
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/134902: sysutils/cpupowerd doesn't need to depend upon devcpu on 7.2-RELEASE
Date: Sun, 24 May 2009 11:36:40 UT

 Maintainer of sysutils/cpupowerd,
 
 Please note that PR ports/134902 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/134902
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Bernhard =?iso-8859-1?Q?Fr=F6hlich?= <decke@bluelife.at>
To: bug-followup@FreeBSD.org
Cc: decke@bluelife.at
Subject: Re: ports/134902: sysutils/cpupowerd doesn't need to depend upon 
     devcpu on 7.2-RELEASE
Date: Sun, 24 May 2009 17:47:44 +0200 (CEST)

 On Sun, May 24, 2009 1:36 pm, Edwin Groothuis wrote:
 > Maintainer of sysutils/cpupowerd,
 >
 > Please note that PR ports/134902 has just been submitted.
 >
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 >
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/134902
 >
 > --
 > Edwin Groothuis via the GNATS Auto Assign Tool
 > edwin@FreeBSD.org
 >
 
 Patch looks fine so I'm okay with the update.
 
 -- 
 Bernhard Frhlich
 http://www.bluelife.at/
 
State-Changed-From-To: feedback->open 
State-Changed-By: linimon 
State-Changed-When: Sun May 24 23:11:00 UTC 2009 
State-Changed-Why:  
Maintainer approved. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134902 
State-Changed-From-To: open->closed 
State-Changed-By: ume 
State-Changed-When: Mon May 25 17:22:44 UTC 2009 
State-Changed-Why:  
Committed. 


Responsible-Changed-From-To: freebsd-ports-bugs->ume 
Responsible-Changed-By: ume 
Responsible-Changed-When: Mon May 25 17:22:44 UTC 2009 
Responsible-Changed-Why:  
Committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134902 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/134902: commit references a PR
Date: Mon, 25 May 2009 17:21:59 +0000 (UTC)

 ume         2009-05-25 17:21:49 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/cpupowerd   Makefile 
     sysutils/cpupowerd/files cpupowerd.in 
   Added files:
     sysutils/cpupowerd/files patch-libcpupowerd.c 
   Log:
   Since cpuctl(4) was MFC'ed, sysutils/cpupowerd doesn't need to depend
   upon sysutils/devcpu on 7.2-RELEASE and later.
   
   PR:             ports/134902
   Approved by:    decke__at__bluelife.at (maintainer)
   
   Revision  Changes    Path
   1.3       +5 -1      ports/sysutils/cpupowerd/Makefile
   1.2       +8 -4      ports/sysutils/cpupowerd/files/cpupowerd.in
   1.3       +44 -0     ports/sysutils/cpupowerd/files/patch-libcpupowerd.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
