#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/cpufreq
-#
-# Description : Initalisize and startup cpufreq and set a governor
-#
-# Authors : Arne Fitzenreiter - arne_f@ipfire.org
-#
-# Version : 01.01
-#
-# Notes :
-#
-########################################################################
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# #
+# 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 <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
# try cpufreq hardware depend modules
for i in $(find /lib/modules/$(uname -r)/kernel/drivers/cpufreq \
- ! -name speedstep-lib.ko ! -name p4-clockmod.ko ! -name "cpufreq_*" ! -name mperf.ko | sort -d -r); do
+ ! -name speedstep-lib.ko.xz ! -name p4-clockmod.ko.xz ! -name "cpufreq_*" ! -name mperf.ko.xz | sort -d -r); do
module=$(basename $i | cut -d. -f1);
modprobe $module > /dev/null 2>&1;
if [ ${?} = 0 ]; then
case "$driver" in
intel_pstate)
# pstate use internal gov so skip this setting
- # activate cpufreq collectd module
- sed -i -e "s|^#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc/collectd.conf
echo_ok;
;;
*)
# Set the governor to ondemand to test if it works
cpufreq-set -g ondemand
if [ ${?} = 0 ]; then
- # activate cpufreq collectd module
- sed -i -e "s|^#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc/collectd.conf
-
# Set the governor to ondemand for all cpus
for i in `seq 0 $CPUCOUNT`;
do
exit 1
;;
esac
-
-# End $rc_base/init.d/cpufreq
-
-