From debbugs-submit-bounces@debbugs.gnu.org Sat May 13 21:05:23 2017 Received: (at submit) by debbugs.gnu.org; 14 May 2017 01:05:23 +0000 Received: from localhost ([127.0.0.1]:43416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9hyF-0002wY-48 for submit@debbugs.gnu.org; Sat, 13 May 2017 21:05:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9hyB-0002wA-7G for submit@debbugs.gnu.org; Sat, 13 May 2017 21:05:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9hy4-0008VO-4J for submit@debbugs.gnu.org; Sat, 13 May 2017 21:05:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9hy4-0008VG-0D for submit@debbugs.gnu.org; Sat, 13 May 2017 21:05:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9hy2-00076o-11 for bug-guix@gnu.org; Sat, 13 May 2017 21:05:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9hxy-0008Tb-Ph for bug-guix@gnu.org; Sat, 13 May 2017 21:05:02 -0400 Received: from dustycloud.org ([50.116.34.160]:39130) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9hxy-0008TT-JT for bug-guix@gnu.org; Sat, 13 May 2017 21:04:58 -0400 Received: from oolong (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id 96FA1265D4 for ; Sat, 13 May 2017 21:04:51 -0400 (EDT) User-agent: mu4e 0.9.18; emacs 25.2.1 From: Christopher Allan Webber To: bug-guix@gnu.org Subject: [PATCH] Add thermald and thermald-service-type (for cpu frequency scaling) Date: Sat, 13 May 2017 20:04:51 -0500 Message-ID: <8737c89rkc.fsf@dustycloud.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain Hello! I got tired of my laptop crashing so much due to overheating, so here's a package for thermald as well as a service type. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-thermald.patch Content-Transfer-Encoding: quoted-printable >From 56c7019d58d4a064fe44e626a1396b62cbf808b0 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 13 May 2017 19:36:01 -0500 Subject: [PATCH 1/2] gnu: Add thermald. * gnu/packages/admin.scm (thermald): New variable. --- gnu/packages/admin.scm | 54 ++++++++++++++++++++++++++++++++++++++++++++= +++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index ff0431999..20cb8f180 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -17,6 +17,7 @@ ;;; Copyright =C2=A9 2016 John Darrington ;;; Copyright =C2=A9 2017 Ben Sturmfels ;;; Copyright =C2=A9 2017 Ethan R. Jones +;;; Copyright =C2=A9 2017 Christopher Allan Webber ;;; ;;; This file is part of GNU Guix. ;;; @@ -80,7 +81,8 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages gnome) #:use-module (gnu packages kerberos) - #:use-module (gnu packages gtk)) + #:use-module (gnu packages gtk) + #:use-module (gnu packages xml)) =20 (define-public aide (package @@ -2130,3 +2132,53 @@ logo, or any ASCII file of your choice. The main = purpose of Neofetch is to be used in screenshots to show other users what operating system or distrib= ution you are running, what theme or icon set you are using, etc.") (license license:expat))) + +(define-public thermald + (package + (name "thermald") + (version "1.6") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/01org/thermal_daemon/archi= ve/v" + version ".tar.gz")) + (sha256 (base32 + "14klz9fnvi9jdlaqwrp61xa5nh051n8ykrs1fh1wxd7j66qf2fn6")))= ) + (build-system gnu-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (add-after + 'unpack 'autogen.sh-and-fix-paths + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; upstartconfir is hardcoded to /etc/init and th= e build + ;; system tries to mkdir that. We don't even nee= d upstart + ;; files at all; this is a fast and kludgy workar= ound + (substitute* "data/Makefile.am" + (("upstartconfdir =3D /etc/init") + (string-append "upstartconfdir =3D " + out "/etc/init"))) + ;; Now run autogen + (zero? (system* "sh" "autogen.sh")))))) + #:configure-flags + (let ((out (assoc-ref %outputs "out"))) + (list (string-append "--sysconfdir=3D" + out "/etc") + (string-append "--with-udev-dir=3D" + out "/lib/udev") + (string-append "--with-dbus-sys-dir=3D" + out "/etc/dbus-1/system.d") + "--localstatedir=3D/var")))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("glib" ,glib "bin") ; for glib-genmarshal, etc. + ("pkg-config" ,pkg-config))) + (inputs + `(("dbus-glib" ,dbus-glib) + ("libxml2" ,libxml2))) + (home-page "https://01.org/linux-thermal-daemon/") + (synopsis "CPU scaling for thermal management") + (description "The Linux Thermal Daemon helps monitor and control tem= perature +on systems running the Linux kernel.") + (license license:gpl2+))) --=20 2.12.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-services-Add-thermald-service-type.patch >From de2045cdc81ddef7b01b3445fb731a3252f5b4a8 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 13 May 2017 19:37:02 -0500 Subject: [PATCH 2/2] services: Add 'thermald-service-type'. * gnu/services/admin.scm (): New record type. (thermald-shepherd-service, thermald-service-type): New variables. * doc/guix.texi (Thermal Management): New section documenting thermald. --- doc/guix.texi | 23 ++++++++++++++++++++++- gnu/services/admin.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 22dc8b3f9..1fee7616c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35,7 +35,8 @@ Copyright @copyright{} 2017 Mathieu Othacehe@* Copyright @copyright{} 2017 Federico Beffa@* Copyright @copyright{} 2017 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* -Copyright @copyright{} 2017 humanitiesNerd +Copyright @copyright{} 2017 humanitiesNerd@* +Copyright @copyright{} 2017 Christopher Allan Webber Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -14746,6 +14747,26 @@ The following is an example @code{dicod-service} configuration. %dicod-database:gcide)))) @end example +@subsection Thermal Management + +The @code{(gnu services admin)} module provides an interface to +thermald, a cpu frequency scaling service which helps prevent overheating. + +@defvr {Scheme Variable} thermald-service-type +This is the service type for thermald. +@end defvr + +@deftp {Data Type} thermald-configuration +Data type representing the configuration of THERMALD-SERVICE. + +@table @asis +@item @code{ignore-cpuid-check?} {default: @code{#f}} +Ignore cpuid check for supported CPU models. + +@end table +@end deftp + + @subsubsection Version Control The @code{(gnu services version-control)} module provides the following services: diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 6ac24e32b..ec274b416 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -32,17 +32,27 @@ rottlog-configuration rottlog-configuration? rottlog-service - rottlog-service-type)) + rottlog-service-type + + thermald-configuration + thermald-service-type)) ;;; Commentary: ;;; -;;; This module implements configuration of rottlog by writing +;;; Various administration services. +;;; +;;; Code: + + + +;;; +;;; Rotlog +;;; +;;; This service implements configuration of rottlog by writing ;;; /etc/rottlog/{rc,hourly|daily|weekly}. Example usage ;;; ;;; (mcron-service) ;;; (service rottlog-service-type (rottlog-configuration)) -;;; -;;; Code: (define %rotated-files ;; Syslog files subject to rotation. @@ -118,4 +128,37 @@ (compose list rottlog-rottlog)))) (default-value (rottlog-configuration)))) + + +;;; +;;; thermald +;;; +;;; This service implements cpu scaling. Helps prevent overheating! + +(define-record-type* + thermald-configuration make-thermald-configuration + thermald-configuration? + (ignore-cpuid-check? thermald-ignore-cpuid-check? + (default #f))) + +(define (thermald-shepherd-service config) + (list + (shepherd-service + (provision '(thermald)) + (documentation "Run thermald cpu frequency scaling.") + (start #~(make-forkexec-constructor + '(#$(file-append thermald "/sbin/thermald") + "--no-daemon" + #$@(if (thermald-ignore-cpuid-check? config) + '("--ignore-cpuid-check") + '())))) + (stop #~(make-kill-destructor))))) + +(define thermald-service-type + (service-type + (name 'thermald) + (extensions (list (service-extension shepherd-root-service-type + thermald-shepherd-service))) + (default-value (thermald-configuration)))) + ;;; admin.scm ends here -- 2.12.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 14 01:28:48 2017 Received: (at 26917-done) by debbugs.gnu.org; 14 May 2017 05:28:48 +0000 Received: from localhost ([127.0.0.1]:43470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9m5B-0000S8-Mi for submit@debbugs.gnu.org; Sun, 14 May 2017 01:28:48 -0400 Received: from dustycloud.org ([50.116.34.160]:50700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9m56-0000Rv-Pa for 26917-done@debbugs.gnu.org; Sun, 14 May 2017 01:28:40 -0400 Received: from oolong (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id E6036265D4 for <26917-done@debbugs.gnu.org>; Sun, 14 May 2017 01:28:34 -0400 (EDT) References: <8737c89rkc.fsf@dustycloud.org> User-agent: mu4e 0.9.18; emacs 25.2.1 From: Christopher Allan Webber To: 26917-done@debbugs.gnu.org Subject: Re: bug#26917: [PATCH] Add thermald and thermald-service-type (for cpu frequency scaling) In-reply-to: <8737c89rkc.fsf@dustycloud.org> Date: Sun, 14 May 2017 00:28:34 -0500 Message-ID: <87zieg80sd.fsf@dustycloud.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 26917-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Bah, this should have been sent to guix-patches. Christopher Allan Webber writes: > Hello! I got tired of my laptop crashing so much due to overheating, so > here's a package for thermald as well as a service type. > >>>From 56c7019d58d4a064fe44e626a1396b62cbf808b0 Mon Sep 17 00:00:00 2001 > From: Christopher Allan Webber > Date: Sat, 13 May 2017 19:36:01 -0500 > Subject: [PATCH 1/2] gnu: Add thermald. > > * gnu/packages/admin.scm (thermald): New variable. > --- > gnu/packages/admin.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 53 insertions(+), 1 deletion(-) > > diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm > index ff0431999..20cb8f180 100644 > --- a/gnu/packages/admin.scm > +++ b/gnu/packages/admin.scm > @@ -17,6 +17,7 @@ > ;;; Copyright © 2016 John Darrington > ;;; Copyright © 2017 Ben Sturmfels > ;;; Copyright © 2017 Ethan R. Jones > +;;; Copyright © 2017 Christopher Allan Webber > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -80,7 +81,8 @@ > #:use-module (gnu packages autotools) > #:use-module (gnu packages gnome) > #:use-module (gnu packages kerberos) > - #:use-module (gnu packages gtk)) > + #:use-module (gnu packages gtk) > + #:use-module (gnu packages xml)) > > (define-public aide > (package > @@ -2130,3 +2132,53 @@ logo, or any ASCII file of your choice. The main purpose of Neofetch is to be > used in screenshots to show other users what operating system or distribution > you are running, what theme or icon set you are using, etc.") > (license license:expat))) > + > +(define-public thermald > + (package > + (name "thermald") > + (version "1.6") > + (source > + (origin > + (method url-fetch) > + (uri (string-append "https://github.com/01org/thermal_daemon/archive/v" > + version ".tar.gz")) > + (sha256 (base32 > + "14klz9fnvi9jdlaqwrp61xa5nh051n8ykrs1fh1wxd7j66qf2fn6")))) > + (build-system gnu-build-system) > + (arguments > + `(#:phases (modify-phases %standard-phases > + (add-after > + 'unpack 'autogen.sh-and-fix-paths > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((out (assoc-ref outputs "out"))) > + ;; upstartconfir is hardcoded to /etc/init and the build > + ;; system tries to mkdir that. We don't even need upstart > + ;; files at all; this is a fast and kludgy workaround > + (substitute* "data/Makefile.am" > + (("upstartconfdir = /etc/init") > + (string-append "upstartconfdir = " > + out "/etc/init"))) > + ;; Now run autogen > + (zero? (system* "sh" "autogen.sh")))))) > + #:configure-flags > + (let ((out (assoc-ref %outputs "out"))) > + (list (string-append "--sysconfdir=" > + out "/etc") > + (string-append "--with-udev-dir=" > + out "/lib/udev") > + (string-append "--with-dbus-sys-dir=" > + out "/etc/dbus-1/system.d") > + "--localstatedir=/var")))) > + (native-inputs > + `(("autoconf" ,autoconf) > + ("automake" ,automake) > + ("glib" ,glib "bin") ; for glib-genmarshal, etc. > + ("pkg-config" ,pkg-config))) > + (inputs > + `(("dbus-glib" ,dbus-glib) > + ("libxml2" ,libxml2))) > + (home-page "https://01.org/linux-thermal-daemon/") > + (synopsis "CPU scaling for thermal management") > + (description "The Linux Thermal Daemon helps monitor and control temperature > +on systems running the Linux kernel.") > + (license license:gpl2+))) > -- > 2.12.2 > >>>From de2045cdc81ddef7b01b3445fb731a3252f5b4a8 Mon Sep 17 00:00:00 2001 > From: Christopher Allan Webber > Date: Sat, 13 May 2017 19:37:02 -0500 > Subject: [PATCH 2/2] services: Add 'thermald-service-type'. > > * gnu/services/admin.scm (): New record type. > (thermald-shepherd-service, thermald-service-type): New variables. > * doc/guix.texi (Thermal Management): New section documenting thermald. > --- > doc/guix.texi | 23 ++++++++++++++++++++++- > gnu/services/admin.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++++---- > 2 files changed, 69 insertions(+), 5 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 22dc8b3f9..1fee7616c 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -35,7 +35,8 @@ Copyright @copyright{} 2017 Mathieu Othacehe@* > Copyright @copyright{} 2017 Federico Beffa@* > Copyright @copyright{} 2017 Carlo Zancanaro@* > Copyright @copyright{} 2017 Thomas Danckaert@* > -Copyright @copyright{} 2017 humanitiesNerd > +Copyright @copyright{} 2017 humanitiesNerd@* > +Copyright @copyright{} 2017 Christopher Allan Webber > > Permission is granted to copy, distribute and/or modify this document > under the terms of the GNU Free Documentation License, Version 1.3 or > @@ -14746,6 +14747,26 @@ The following is an example @code{dicod-service} configuration. > %dicod-database:gcide)))) > @end example > > +@subsection Thermal Management > + > +The @code{(gnu services admin)} module provides an interface to > +thermald, a cpu frequency scaling service which helps prevent overheating. > + > +@defvr {Scheme Variable} thermald-service-type > +This is the service type for thermald. > +@end defvr > + > +@deftp {Data Type} thermald-configuration > +Data type representing the configuration of THERMALD-SERVICE. > + > +@table @asis > +@item @code{ignore-cpuid-check?} {default: @code{#f}} > +Ignore cpuid check for supported CPU models. > + > +@end table > +@end deftp > + > + > @subsubsection Version Control > > The @code{(gnu services version-control)} module provides the following services: > diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm > index 6ac24e32b..ec274b416 100644 > --- a/gnu/services/admin.scm > +++ b/gnu/services/admin.scm > @@ -32,17 +32,27 @@ > rottlog-configuration > rottlog-configuration? > rottlog-service > - rottlog-service-type)) > + rottlog-service-type > + > + thermald-configuration > + thermald-service-type)) > > ;;; Commentary: > ;;; > -;;; This module implements configuration of rottlog by writing > +;;; Various administration services. > +;;; > +;;; Code: > + > + > + > +;;; > +;;; Rotlog > +;;; > +;;; This service implements configuration of rottlog by writing > ;;; /etc/rottlog/{rc,hourly|daily|weekly}. Example usage > ;;; > ;;; (mcron-service) > ;;; (service rottlog-service-type (rottlog-configuration)) > -;;; > -;;; Code: > > (define %rotated-files > ;; Syslog files subject to rotation. > @@ -118,4 +128,37 @@ > (compose list rottlog-rottlog)))) > (default-value (rottlog-configuration)))) > > + > + > +;;; > +;;; thermald > +;;; > +;;; This service implements cpu scaling. Helps prevent overheating! > + > +(define-record-type* > + thermald-configuration make-thermald-configuration > + thermald-configuration? > + (ignore-cpuid-check? thermald-ignore-cpuid-check? > + (default #f))) > + > +(define (thermald-shepherd-service config) > + (list > + (shepherd-service > + (provision '(thermald)) > + (documentation "Run thermald cpu frequency scaling.") > + (start #~(make-forkexec-constructor > + '(#$(file-append thermald "/sbin/thermald") > + "--no-daemon" > + #$@(if (thermald-ignore-cpuid-check? config) > + '("--ignore-cpuid-check") > + '())))) > + (stop #~(make-kill-destructor))))) > + > +(define thermald-service-type > + (service-type > + (name 'thermald) > + (extensions (list (service-extension shepherd-root-service-type > + thermald-shepherd-service))) > + (default-value (thermald-configuration)))) > + > ;;; admin.scm ends here From unknown Sun Sep 07 16:50:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 11 Jun 2017 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator