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 4blQKZ1Zg1z333y for ; Sun, 20 Jul 2025 14:05:38 +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) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4blQKV59pDz2yWW for ; Sun, 20 Jul 2025 14:05:34 +0000 (UTC) Received: from sonic311-23.consmr.mail.ne1.yahoo.com (sonic311-23.consmr.mail.ne1.yahoo.com [66.163.188.204]) (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 4blQKT1DQzzd8 for ; Sun, 20 Jul 2025 14:05:33 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=fwLaDI87; spf=pass (mail01.ipfire.org: domain of cab_77573@yahoo.com designates 66.163.188.204 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=1753020333; a=rsa-sha256; cv=none; b=rn/3Do819l25t+WmWSVsKjdWhI7WXmONFBLzOOgFazBYOkk4/xzX1YXnbARgjc0/q7f1G9 iwFYC5Ru+2b48PQ3l/RtW57FP/OePvaXl+kowsryADDZ1GAfMQs7Z91181E0iDKctemlfk BSJ2mXTWkdal7yELz52hllMaKNOe6NUAi+roV9evLK2rZS6MQYRpTr85fjaqfvYCRrjk0U t5xK9F09mSFsHgp6bx9eMsdr/hn7eUlemURGXUr8cjIn8kuSn47isiHW/Zw3ime9cqxBZE 1KgtrJDSI+f1kM63b4SOUpUJ73BG0xIsXPl5VzrJm/HWpTlr3nSwGpVEcmK3ww== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=fwLaDI87; spf=pass (mail01.ipfire.org: domain of cab_77573@yahoo.com designates 66.163.188.204 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=1753020333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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=xY8WW0yX99HXVrPHOI/1W/iMiizXMQe+gvPJZgH81+s=; b=MzrqSeVh7bfrLtlkHrnNbQrFF3Vafg9ATMLOdp0R79ytgwlrdRTzmLG3+F9qJb1tiFEm/2 nvjZzqKWbWzJCBKiXniviIUZQmDlYhTzD7CqxO5S5uwwQfE3wGOtjy8juJ9NjsR1tyQyxW reU/73wGickXm0CKL6uXoGlvG8QBWTyWP5zFVkHBghUFr92uwinfWIqAOabSNds16Mny4w 2v57WjnHKpYpqUHzgLExgA/ZuBOWvyQDduL8mNVLPwioGOBdA5lbdPIxcYySkEptLz+sk9 NvGeRy+41ng4W5+FR96gdrvAuE8I8+r6Fpf+1NIE+JB48R1dqbsg0L0MJ/Vvbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1753020330; bh=xY8WW0yX99HXVrPHOI/1W/iMiizXMQe+gvPJZgH81+s=; h=Date:Subject:To:References:From:In-Reply-To:From:Subject:Reply-To; b=fwLaDI87ogRjE0xmYKLC572joET2TntvpWhFr9A9b4hWeJ1ZhSe7oeuEsnSbpvpcCLA4AUGhUYIdN9lcL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J19Ltz1N7tUN95Sv6ZlGhK7ywHdKSiTfstux0A hyXw4CpzRVzZmGmrpV9edP8mCZa60uTNHHxQ2KQAsy81c8YPMA0ux3jYY_rjdbHI3XIuIDjnThGX tGgOL2PAQ.EZeWYTGZWXuWAvgcBSlLQmN8hj9tYcNEGCwXl5v4_aH.PD6uAZ7kfpHe66F5sd0wcA dCQTQOE5l1v2pXhOYv5vxghk_WELD9pn7LUaUr4KbCwgmVt7vn3gdF0KZm0qguTxnKQh0GVV0uw3 Whddl2mDzcyRwpJip_t6qkls2W902pmiOrWjBlHbbOnrq3AZF9NIT_9I.5TQFvTCmvlEF8vUM5AF cMudJ4YEQFfxXNEBDaU0S5RRqy3zH8HSoQW8Ek_WYWnWPWiegtNx3ckyKcRcWvNl6z.IrU1ImvNS S0MipWO3ksPt.tilh46pe8Hgqw4w8dHu22zndsjsAdqgQBu.d3U_b5u3SHmJBwtPqqrlCGE3_BDF eo2FaeLhyB2029fGPpkh9nZNsXXYohBr4uPIa6rIR7Iq2HWU7B6sY0LTwoDVr80P66bvHuLi2PiT 2y7q8ubZlULB3UtwcTbAM7q2B7sr.coOLfu8Mcb.IFUQcDqk_L5KWDxyB1ZyRVWVAnDF70qt3zb_ E2yaJ.fgtbDwyzHnf4I3ACwSIQ6kgcQeGWLg1RGALtwFapc0R8kqdtH0uwpIw5eyyS_L2xsWUZJo ko0g8OSYqey4n3WEVuEUtMZfiKA_mHmev.gejIW4WbJ1KabZ40mObLYx9Vn21uk_mOTga1SpI2fH DHr6Py_KQj4cvWICwRRJbjl2_WTmZAa6JlXRpy0mm814z7e.qNj.kGbxXequMoqf7yuN2M1OmA0x kUPD7ahNgCWC99A6vmO7462V8QUGO1GCKZBKwzhf1DQlMlazARA-- X-Sonic-MF: X-Sonic-ID: 1eb4358b-1bc9-4aa9-b7ae-2566d946e71e Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Sun, 20 Jul 2025 14:05:30 +0000 Received: by hermes--production-ne1-9495dc4d7-6gzfg (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 66b7618ce8045efe5e77be2b3aaa3337; Sun, 20 Jul 2025 14:05:25 +0000 (UTC) Message-ID: <3bf7411d-ad0b-43af-97c8-ab70342d9a46@yahoo.com> Date: Sun, 20 Jul 2025 09:05:25 -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: development@lists.ipfire.org References: <20250717173032.3442618-1-michael.tremer@ipfire.org> Content-Language: en-US From: Charles Brown In-Reply-To: <20250717173032.3442618-1-michael.tremer@ipfire.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.70 / 11.00]; R_DKIM_ALLOW(-1.65)[yahoo.com:s=s2048]; NEURAL_HAM(-1.00)[-1.000]; DKIM_REPUTATION(-0.92)[-0.91754036949095]; SPF_REPUTATION_HAM(-0.92)[-0.91754034457224]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; IP_REPUTATION_HAM(-0.38)[asn: 36646(-0.37), country: US(-0.01), ip: 66.163.188.204(0.00)]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; BAYES_HAM(-0.03)[56.14%]; MX_GOOD(-0.01)[]; FROM_HAS_DN(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCVD_IN_DNSWL_NONE(0.00)[66.163.188.204:from]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.188.204: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: 4blQKT1DQzzd8 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