Date: Sun, 24 May 2009 18:45:48 +0900 From: Hajimu UMEMOTO <ume@mahoroba.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: decke@bluelife.at Subject: ports/134902: cpupowerd doesn't need to depend upon devcpu on 7.2-RELEASE Message-ID: <ygeljom7s1f.wl%ume@mahoroba.org> Resent-Message-ID: <200905240950.n4O9o76u005369@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <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: >Unformatted: --Multipart_Sun_May_24_18:45:48_2009-1 Content-Type: text/plain; charset=US-ASCII
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygeljom7s1f.wl%ume>