]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
collectd: move cpufreq plugin init because arm has no cpufrequtils
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 30 May 2018 09:30:01 +0000 (11:30 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 30 May 2018 09:30:01 +0000 (11:30 +0200)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/cpufrequtils
src/initscripts/packages/cpufreq
src/initscripts/system/collectd

index d558efa6124519cf3f4d41487fa71a675f6e122f..54d9347ef59c4bbb44663dfe6936af78681200b6 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 008
+VER        = 009
 
 THISAPP    = cpufrequtils-$(VER)
 DL_FILE    = $(THISAPP).tar.bz2
index 6a89414b2d690e3dc80414e8b2d3940b55c352ad..a295c2eb220460f8b0068898c6c3db32d339acc4 100644 (file)
@@ -41,8 +41,6 @@ case "${1}" in
                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;
                        ;;
                    *)
@@ -51,9 +49,6 @@ case "${1}" in
                        # 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
index 761e9c3f862e23860f599ce1b1af764eed028812..cf5b897e39ee9928fa6ef67e1b4592c080e98149 100644 (file)
@@ -88,6 +88,13 @@ case "$1" in
                        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