From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9tFl-0005It-UB for guix-patches@gnu.org; Sun, 14 May 2017 09:08:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9tFi-0006fg-PB for guix-patches@gnu.org; Sun, 14 May 2017 09:08:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9tFi-0006fP-L6 for guix-patches@gnu.org; Sun, 14 May 2017 09:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d9tFi-0006Xo-Fz for guix-patches@gnu.org; Sun, 14 May 2017 09:08:02 -0400 Subject: bug#26919: [PATCH] Add thermald and thermald-service-type (for cpu frequency scaling) Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87y3u080qn.fsf@dustycloud.org> Date: Sun, 14 May 2017 15:07:17 +0200 In-Reply-To: <87y3u080qn.fsf@dustycloud.org> (Christopher Allan Webber's message of "Sun, 14 May 2017 00:29:36 -0500") Message-ID: <87bmqvy4ca.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Allan Webber Cc: 26919@debbugs.gnu.org Hi! Christopher Allan Webber skribis: > Trying again, since last time I accidentally sent to bug-guix... oops. > > 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. Heheh. :-) > 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. LGTM! > 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. [...] > +@subsection Thermal Management Would it make sense to move it under =E2=80=9CPower Management Services=E2= =80=9D rather than =E2=80=9CMiscellaneous Services=E2=80=9D? > +The @code{(gnu services admin)} module provides an interface to > +thermald, a cpu frequency scaling service which helps prevent overheatin= g. s/cpu/CPU/ :-) > +@defvr {Scheme Variable} thermald-service-type > +This is the service type for thermald. What about something like this, to give more context: =E2=80=A6 for @uref{https://01.org/linux-thermal-daemon/, thermald}, the = Linux Thermal Daemon, which is responsible for controlling the thermal state of Intel processors and preventing overheating. ? > +@deftp {Data Type} thermald-configuration > +Data type representing the configuration of THERMALD-SERVICE. s/THERMALD-SERVICE/@code{thermald-service-type}/ > +(define-record-type* > + thermald-configuration make-thermald-configuration > + thermald-configuration? > + (ignore-cpuid-check? thermald-ignore-cpuid-check? > + (default #f))) Could you add a =E2=80=98thermald=E2=80=99 field, defaulting to =E2=80=98th= ermald=E2=80=99 (the package)=E2=80=A6 > +(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") =E2=80=A6 and honor it here, and add it to guix.texi? OK with these changes, thank you! Do you think it=E2=80=99s something we should add to =E2=80=98%base-service= s=E2=80=99, or is it too hardware-dependent? Ludo=E2=80=99.