###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2018 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 #
include Config
-VER = 008
+VER = 009
THISAPP = cpufrequtils-$(VER)
DL_FILE = $(THISAPP).tar.bz2
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
sed -i -e 's|^#include "/etc/collectd.thermal"$|include "/etc/collectd.thermal"|g' /etc/collectd.conf
fi
+ # Enable cpufreq plugin if cpufreq found
+ if [ ! -e /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq ]; then
+ sed -i -e "s|^LoadPlugin cpufreq|#LoadPlugin cpufreq|g" /etc/collectd.conf
+ else
+ sed -i -e "s|^#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc/collectd.conf
+ fi
+
# Enable swap plugin if swap found
if [ "$(swapon -s | wc -l)" == "0" ]; then
sed -i -e "s|^LoadPlugin swap|#LoadPlugin swap|g" /etc/collectd.conf