From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4bmBrw2BCsz334m for ; Mon, 21 Jul 2025 20:32:00 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4bmBrr5X5Cz2xh0 for ; Mon, 21 Jul 2025 20:31:56 +0000 (UTC) Received: from sonic316-21.consmr.mail.ne1.yahoo.com (sonic316-21.consmr.mail.ne1.yahoo.com [66.163.187.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4bmBrp707gz1XS for ; Mon, 21 Jul 2025 20:31:54 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=HwxHUcix; spf=pass (mail01.ipfire.org: domain of cab_77573@yahoo.com designates 66.163.187.147 as permitted sender) smtp.mailfrom=cab_77573@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1753129915; a=rsa-sha256; cv=none; b=QalvMhKFw1+/wB0eYqfzIgl6r4lAeiz6JSw8kplvFdiY0IhWJH38tgU5x109ZUFj44Nl4t trcCUkfRUSgPWCGB/AHSIZ3WZ/wBpWC/ygjeDSwszIlfEPXtSKnx2aUwCeuBXnn5u+Ias3 VNVPo9L2IyeatTOixkDNHQhCu1R1R0HDuh7FusGUDjG7ympii+JFjEiarhaaQ/JYKDHxyG 3uAFP+llHVTZZB05ZXw6r3NBGq6nDu1lJUziuknKkHg9AjNN3UUIyLTg4kE1tg8VGFuxLu a67/ntku9eib+HHsXlByk//yWmxomfpp6bpqvlIic8O6/pREH/T2dLcZhehpjg== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=HwxHUcix; spf=pass (mail01.ipfire.org: domain of cab_77573@yahoo.com designates 66.163.187.147 as permitted sender) smtp.mailfrom=cab_77573@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1753129915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OPKPm1xSxyO9UVLOP0OhwHwc/Wf3xRHRBWdVYIY5zts=; b=Zsjk79sR3+R65JJRaNNyTSCoa6Hk73s9JbHI1EtfsTZKz5mMFImLDFWTvfeg5OYA7EPfMR h1hJGvpUddWy0/rlVM1N3lnAgqRC5xISMm39ffnHZNU7DWMhH1OXXLJ2QJvpfnlQVAJFZ7 NYO4qFQJpjaX0gu+zawVBnYsFyvBrls+FcIj2sxt20Wfvfv6jJnDpYZcbQtw852iMQfb2u CV03eaEXRnPFj49ejh6WDKdfcLCKrnwMmJngK8UAvHBqeMg/JU49p5mIO1LRygpx2sMQAa EZ4/FdNKXFdnGYnChvz78vmJDH+hkK+einiaXK9fhwFwIQlDMgiEWIryNa4yDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1753129912; bh=OPKPm1xSxyO9UVLOP0OhwHwc/Wf3xRHRBWdVYIY5zts=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=HwxHUcix6cI90NiYsbQrx+7yK99C3tzJ2uIubM9Le+bsXFAyuGweHOoktory6eB5gKuIsUB2XDYgmQJ4/MuDd4MuNb3R0klVOwg51wy2trO+cTIL1alKpECourPPbn621EzFoTWu0gZCNtMIobr3Sv0hc/K3wfruo8LCdV0/JbHKxpljHjuQVNRt3zr1fFtP6Yq4Y6bwU97lifQtUkEE93a2y8uPKAr09svSo04ukvqAalKdqtBPlQXWgHYdDKuyYmFBdA8oFONFYFjmZva7OX5y1tJaN3cBWS/FTT4+CGNiA5jeXRBfh58avKe6qQYBQU0EwkgvRxRcQ7C80IZSzg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1753129912; bh=l6r6aJDcTO0jPU8a/pfFsoYE1rQECkRqjzlozPMuF97=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=f1CTeqiDMCOPsW4q2i/pa9mahuccXVFv+5KP1i9ktiduCceX30415x6rJ2/GOEwt1gNaIox1weuS/Eoz3UyPCVIFASqpFbLqfi57Joe1dJRRbAGZQ9zg9QJ4t0oCl/8ZHvCg4ootRUCMj1Se0ob7upMAS72mAXB1Lw0kQn8MsCKTjs1pJ85hEQMnOnMmAZu3+SEhef0KR2br3BrqebnGB4QbCtPTrIWOrhKUL0tVm2HB7HkMGqH8JUiIQBQzt62VzAFttTi3vkN27tUmwouTDm/me3Nc+z/aKhqlIPPTyezgzlYDOcZ0CzZi99lrl0ME0iHs1jbRLcm0AN54ZA0YOw== X-YMail-OSG: bL1LBsQVM1nnkovaqLvTXuyQAhWHNjn2d9Pzvo0PCbd.6XF93x7uB_Xx44YCZiQ oafDwJjXK8cZNFc.ba705i5atvUjBY57XRdgaATMJQzwZbfUA0TrJpB3MJzJyRgpNQ3N9O1Wbt_k Hi.O0Zvq8WYeEXv6KP884Oc59cmahYj8SsU526pg3_PhVXoUKCb11__IbmMO0vJqaYcdRsrLRsEw HJK6Xnp.2qM1P5Qzh6XGfrLHLMStDwqBn.D5wkDx_XTz41H0EYxMXoiQ4D.eRkQ9nZr_s1tMMdCf 2tvsE8lvNdjwLAsiOX26YbfZyMSxtK0B_ytTkclD2.0TVJsZ5LRVi4B0G6ByjwaIi6XeMfo4egHq Rm8UvgefZJYL7j01y4.nlwOCx0vPqYSTj2BnFwW5UMyW9qR0r.4ETxXdEp.Ra8jzu3EnKPWGpRzL O.vniw1Kx9_I3O1favMpFNxovOlgh9pGg7ecNr3fi0UYB6P2vknUopnQHwgn7HnYWpF9OpOBwiub OBJU7VC6iyXh2L2tDIH71QiPJikJJbaF6o0rFJeNcYQGJ2PT_WRLtgfsjMlAzTQEtegPfzIsjLiq lTMrUST2WiW4a8e4kp4o.WQPHUMuiwNwJeuFYQ731IH7JAmnBM2wrQbvcy0VgR19T4rBx.xjizWY 5Kb5IvuoI_QyLmaLg7EDDdrd1O.C0i6NW0qFvlBfFo6O2W_2cJxrsPa7zy46ZvLd0KTFoQvofDcz Y2HYS_jRf0u9i1ZXUXemNsd6eAjhhcX1hcIFlKmA9hP9fZDnRDktxVbs_HX4v.efbdTjcb.PTJqJ UxJ_O3FykfTYVZcVOZEjiXII6.UehxEiEeNP6uoXBJTb6jGEfARUWz4f0Dr9NwQ3sAAl1m8ifEeT a1bx3PgCkrxjjFeBDwpc1EKgY4qax_bi1taeooa7pOKCm7i4AKwGxFJ4OYOTpC_sZ9e0g2mxzG5g xof0mR9UKMiDLmTZRFQfnKfeNwc_8H3d6bqtYUe.LyA0TGvOdzCr7B1FpLLlDvpSVfegvtme_eRp zAAj9hNqckwGLP7BhbSK3oQc1glJGNNaVsLyW.xJFs0rCO9U2L5vchma8vxH0dIDQwIOZvv9Hzhi 03261MCEdcefx48CrpXmgz12tZp.ZDWc1qjDkkCqDOs9RDtVz4tjTvumHfDgutdnZ28V1Nn4yafh TdBG2se.smONHwruDItCm8BstfTGEE11XJS.mMVZg6Zvdo3F1rQahmWd3HEzCT7QKN455XGn3032 oKD3hHLP6b_tD8_bx9hmZdQPb5iSjd3mYntv0E2X3MdGm5gQep9G7hvY5DbFjvBQ5EUiLmWHee6E TbJmpYCpFylC3KVkha_4ChcEBm9K3.WukSqmL9dK_uxyR98jWOXUxAFXF.UaPc7xyVJsgxA53Nhc jRB1Y2_hLOWH45vFNidKgAexzczlobfKaQsaCn5p3iUbux3sAGEunl_ZfH6cKw8FxBaf8IZxS1gD qSSqbZi_..8ygFb_uWtKq3P_NxP9xz0c2kFQwG2j_eQlxzazGBKy.TdgPhPW7.alCojRbdroR1BE zNEZwCQlelDYlqddyoasC82aQV_jX5jKqeRwrKYHVP4Q2KkO_aAX.GIDc3.mF1c97_y8lFTf2o5F udBwYPmbmaLE51xSN6UtIKT6zYfda8b20LMpJaf6TgWLDbUbaOqfYjI256qjWTWVCf9Gc6K8e_d9 O0A_Pd.aNNrmTgdg2FOen9uNbI_lvWsdNBDU3aWoJIUsxUFPKKUz53EK7Zf597FdSGhCgOhO.FKL URf9sK_RczGAZ1Abp9OZMH3dLlEe8kjQYiSdAqLaAJFUbbFUdmHgF88m3ERMAgUjaEw3bD0q1gbd qDxAvq8qrbi0.wVLYNsJ0NbuqGBekoDBbajIfsl7CSCdRFj81b9HCS89qoFE2suv_Nhfa2SAD3AY f2qdd4gopVCKnwNibjPK9QJZqU_.mJ6UrAvjLbkR08CAka7RU3zUrVBqu13WmBce72Je6lUvqVjN GogsJWnXFzWXxOarL8wDKni80yXs3Y7KPS8bz19PuLEDqqnWNt9ZsPOM4btw3FgSQqiQopfuRNJ3 U43cNwoEVZtLf4gSi28vPCYw7ZgutVQDHYcRzjhYNDczN4T8HXdNi_ulO9Wo8JjCdSzImJ90smHU NzlCAqg7JiSEz_XQrhIE6.dgBfggfoQP101xcyzs5tUTRpBUZWUROIWr4j9AcfiHdCLHLFn6WbAH X9cajP8haMYVkXFF2spIaB8tdpKKQ0NjLFoEUbC4poPWSYOfayqY0IdD1oE06Qaa5_g-- X-Sonic-MF: X-Sonic-ID: 13030b49-951a-4476-80a4-6d4b8680db4b Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Mon, 21 Jul 2025 20:31:52 +0000 Received: by hermes--production-ne1-9495dc4d7-mqk7g (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d835687f37b1ae17924246eb18cfcd56; Mon, 21 Jul 2025 20:31:51 +0000 (UTC) Message-ID: <508a03f7-2a59-4769-a029-875eedaed62c@yahoo.com> Date: Mon, 21 Jul 2025 15:31:50 -0500 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] initscripts: Automatically enable CPU power saving features To: murphy.jon@me.com Cc: development@lists.ipfire.org, Michael Tremer References: <20250717173032.3442618-1-michael.tremer@ipfire.org> <3bf7411d-ad0b-43af-97c8-ab70342d9a46@yahoo.com> <49E27F13-2E7D-40C4-9C8D-5BB066BCFA85@ipfire.org> Content-Language: en-US From: Charles Brown In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.24187 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spamd-Result: default: False [-5.72 / 11.00]; R_DKIM_ALLOW(-1.65)[yahoo.com:s=s2048]; NEURAL_HAM(-1.00)[-1.000]; DKIM_REPUTATION(-0.92)[-0.91651698030117]; SPF_REPUTATION_HAM(-0.92)[-0.91651695584882]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; IP_REPUTATION_HAM(-0.38)[asn: 36646(-0.37), country: US(-0.01), ip: 66.163.187.147(0.00)]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; BAYES_HAM(-0.05)[60.38%]; MX_GOOD(-0.01)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[me.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_NONE(0.00)[66.163.187.147:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.187.147:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1] X-Rspamd-Action: no action X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Queue-Id: 4bmBrp707gz1XS Hi Jon,  I am perfectly satisfied with Michael's default implementation in  src/initscripts/system/cpupower. I see no personal need to override that in |/etc/sysconfig/cpupower.| -cab On 7/21/2025 2:15 PM, murphy.jon@me.com wrote: > I added a wiki page:   > >>> Just curious about find_governor() ... how/where would the variable >>> "GOVERNOR" be getting configured? > > Charles - If/when you make a change, please add your changes to the > above Wiki page as an example. > > > Jon > > >> On Jul 21, 2025, at 4:10 AM, Michael Tremer >> wrote: >> >> Hello Charles, >> >> Thanks for your question. >> >> The variable is by default not set. But at the top of the file, we >> optionally load a configuration file. So if someone wants to >> hard-code a custom governor (even if it is just for testing), they >> can set the variable in /etc/sysconfig/cpupower. >> >> -Michael >> >>> On 20 Jul 2025, at 15:05, Charles Brown wrote: >>> >>> Just curious about find_governor() ... how/where would the variable >>> "GOVERNOR" be getting configured? >>> >>> On 7/17/2025 12:30 PM, Michael Tremer wrote: >>>> This is a cleaned up implementation of the script that was previously >>>> packaged in the cpufrequtils package. >>>> >>>> Signed-off-by: Michael Tremer >>>> --- >>>> config/rootfiles/common/aarch64/initscripts |  2 + >>>> config/rootfiles/common/riscv64/initscripts |  2 + >>>> config/rootfiles/common/x86_64/initscripts  |  2 + >>>> lfs/initscripts                             |  1 + >>>> src/initscripts/system/cpupower             | 89 +++++++++++++++++++++ >>>> 5 files changed, 96 insertions(+) >>>> create mode 100644 src/initscripts/system/cpupower >>>> >>>> diff --git a/config/rootfiles/common/aarch64/initscripts >>>> b/config/rootfiles/common/aarch64/initscripts >>>> index 1fd1f076f..fa43d4fe1 100644 >>>> --- a/config/rootfiles/common/aarch64/initscripts >>>> +++ b/config/rootfiles/common/aarch64/initscripts >>>> @@ -18,6 +18,7 @@ etc/rc.d/init.d/collectd >>>> etc/rc.d/init.d/connectd >>>> etc/rc.d/init.d/conntrackd >>>> etc/rc.d/init.d/console >>>> +etc/rc.d/init.d/cpupower >>>> etc/rc.d/init.d/dhcp >>>> etc/rc.d/init.d/dhcrelay >>>> etc/rc.d/init.d/fcron >>>> @@ -183,6 +184,7 @@ etc/rc.d/rcsysinit.d/S42fsresize >>>> etc/rc.d/rcsysinit.d/S43mounttmpfs >>>> etc/rc.d/rcsysinit.d/S44smt >>>> etc/rc.d/rcsysinit.d/S45udev_retry >>>> +etc/rc.d/rcsysinit.d/S46cpupower >>>> etc/rc.d/rcsysinit.d/S50cleanfs >>>> etc/rc.d/rcsysinit.d/S60setclock >>>> etc/rc.d/rcsysinit.d/S70console >>>> diff --git a/config/rootfiles/common/riscv64/initscripts >>>> b/config/rootfiles/common/riscv64/initscripts >>>> index 694207257..a31359134 100644 >>>> --- a/config/rootfiles/common/riscv64/initscripts >>>> +++ b/config/rootfiles/common/riscv64/initscripts >>>> @@ -18,6 +18,7 @@ etc/rc.d/init.d/collectd >>>> etc/rc.d/init.d/connectd >>>> etc/rc.d/init.d/conntrackd >>>> etc/rc.d/init.d/console >>>> +etc/rc.d/init.d/cpupower >>>> etc/rc.d/init.d/dhcp >>>> etc/rc.d/init.d/dhcrelay >>>> etc/rc.d/init.d/fcron >>>> @@ -182,6 +183,7 @@ etc/rc.d/rcsysinit.d/S42fsresize >>>> etc/rc.d/rcsysinit.d/S43mounttmpfs >>>> etc/rc.d/rcsysinit.d/S44smt >>>> etc/rc.d/rcsysinit.d/S45udev_retry >>>> +etc/rc.d/rcsysinit.d/S46cpupower >>>> etc/rc.d/rcsysinit.d/S50cleanfs >>>> etc/rc.d/rcsysinit.d/S60setclock >>>> etc/rc.d/rcsysinit.d/S70console >>>> diff --git a/config/rootfiles/common/x86_64/initscripts >>>> b/config/rootfiles/common/x86_64/initscripts >>>> index 694207257..a31359134 100644 >>>> --- a/config/rootfiles/common/x86_64/initscripts >>>> +++ b/config/rootfiles/common/x86_64/initscripts >>>> @@ -18,6 +18,7 @@ etc/rc.d/init.d/collectd >>>> etc/rc.d/init.d/connectd >>>> etc/rc.d/init.d/conntrackd >>>> etc/rc.d/init.d/console >>>> +etc/rc.d/init.d/cpupower >>>> etc/rc.d/init.d/dhcp >>>> etc/rc.d/init.d/dhcrelay >>>> etc/rc.d/init.d/fcron >>>> @@ -182,6 +183,7 @@ etc/rc.d/rcsysinit.d/S42fsresize >>>> etc/rc.d/rcsysinit.d/S43mounttmpfs >>>> etc/rc.d/rcsysinit.d/S44smt >>>> etc/rc.d/rcsysinit.d/S45udev_retry >>>> +etc/rc.d/rcsysinit.d/S46cpupower >>>> etc/rc.d/rcsysinit.d/S50cleanfs >>>> etc/rc.d/rcsysinit.d/S60setclock >>>> etc/rc.d/rcsysinit.d/S70console >>>> diff --git a/lfs/initscripts b/lfs/initscripts >>>> index 99fe2f1be..49215c0ae 100644 >>>> --- a/lfs/initscripts >>>> +++ b/lfs/initscripts >>>> @@ -176,6 +176,7 @@ $(TARGET) : >>>>  ln -sf ../init.d/mounttmpfs /etc/rc.d/rcsysinit.d/S43mounttmpfs >>>>  ln -sf ../init.d/smt /etc/rc.d/rcsysinit.d/S44smt >>>>  ln -sf ../init.d/udev_retry /etc/rc.d/rcsysinit.d/S45udev_retry >>>> + ln -sf ../init.d/cpupower /etc/rc.d/rcsysinit.d/S46cpupower >>>>  ln -sf ../init.d/cleanfs /etc/rc.d/rcsysinit.d/S50cleanfs >>>>  ln -sf ../init.d/setclock /etc/rc.d/rcsysinit.d/S60setclock >>>>  ln -sf ../init.d/console /etc/rc.d/rcsysinit.d/S70console >>>> diff --git a/src/initscripts/system/cpupower >>>> b/src/initscripts/system/cpupower >>>> new file mode 100644 >>>> index 000000000..82b62a89b >>>> --- /dev/null >>>> +++ b/src/initscripts/system/cpupower >>>> @@ -0,0 +1,89 @@ >>>> +#!/bin/sh >>>> +############################################################################### >>>> +# >>>>                                                                             # >>>> +# IPFire.org - A linux based firewall >>>>                                         # >>>> +# Copyright (C) 2025 IPFire Team   >>>>                           # >>>> +# >>>>                                                                             # >>>> +# This program is free software: you can redistribute it and/or >>>> modify        # >>>> +# it under the terms of the GNU General Public License as >>>> published by        # >>>> +# the Free Software Foundation, either version 3 of the License, >>>> or           # >>>> +# (at your option) any later version. >>>>                                         # >>>> +# >>>>                                                                             # >>>> +# This program is distributed in the hope that it will be useful, >>>>             # >>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >>>>              # >>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the >>>>               # >>>> +# GNU General Public License for more details. >>>>                                # >>>> +# >>>>                                                                             # >>>> +# You should have received a copy of the GNU General Public >>>> License           # >>>> +# along with this program.  If not, see >>>> .       # >>>> +# >>>>                                                                             # >>>> +############################################################################### >>>> + >>>> +. /etc/sysconfig/rc >>>> +. ${rc_functions} >>>> + >>>> +# Load the configuration if it exists >>>> +if [ -r "/etc/sysconfig/cpupower" ]; then >>>> + . /etc/sysconfig/cpupower >>>> +fi >>>> + >>>> +# This function returns which governor to use >>>> +find_governor() { >>>> + local driver >>>> + >>>> + # If a governor has been configured, we just use that one >>>> + if [ -n "${GOVERNOR}" ]; then >>>> + echo "${GOVERNOR}" >>>> + return 0 >>>> + fi >>>> + >>>> + # Determine the driver >>>> + if [ -r "/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver" ]; then >>>> + driver="$(>>> + fi >>>> + >>>> + # Decide which governor to use based on the driver >>>> + case "${driver}" in >>>> + # If the driver could not be detected, we won't use anything >>>> + "") >>>> + ;; >>>> + >>>> + # Intel P-State only supports performace and powersave. The latter >>>> + # is rather implemented like ondemand in other cases. >>>> + intel_pstate) >>>> + echo "powersave" >>>> + ;; >>>> + >>>> + # For everything else use schedutil >>>> + *) >>>> + echo "schedutil" >>>> + ;; >>>> + esac >>>> + >>>> + return 0 >>>> +} >>>> + >>>> +set_governor() { >>>> + # Find the governor to use >>>> + local governor="$(find_governor)" >>>> + >>>> + # If we could not detect a governor we don't have anything to do >>>> + if [ -z "${governor}" ]; then >>>> + return 0 >>>> + fi >>>> + >>>> + # Set the governor >>>> + cpupower frequency-set --governor "${governor}" >/dev/null >>>> +} >>>> + >>>> +case "${1}" in >>>> + start) >>>> + boot_mesg "Enabling CPU Power Saving Features..." >>>> + set_governor >>>> + evaluate_retval >>>> + ;; >>>> + *) >>>> + echo "Usage: ${0} {start}" >>>> + exit 1 >>>> + ;; >>>> +esac >>> >> >> > > Jon > > > -- > Jon Murphy > murphy.jon@me.com >