]> git.ipfire.org Git - people/jschlag/ipfire-2.x.git/commitdiff
cpufreq: change initscript for intel pstate driver.
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 2 Dec 2015 13:17:34 +0000 (14:17 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 2 Dec 2015 13:17:34 +0000 (14:17 +0100)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/cpufrequtils
src/initscripts/init.d/cpufreq

index c0eb002fa93fff1437dc1975243648239f38cdee..5a82c33a59dd901521a06bee9404b003eaca63a8 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2010  IPFire Team  <info@ipfire.org                           #
+# Copyright (C) 2007-2015  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        #
@@ -33,7 +33,7 @@ DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 SUP_ARCH   = x86_64 i586
 PROG       = cpufrequtils
-PAK_VER    = 6
+PAK_VER    = 7
 
 DEPS       = ""
 
index 0d4cdb95b1010d286157996151d90537e7d023db..6a89414b2d690e3dc80414e8b2d3940b55c352ad 100644 (file)
@@ -36,23 +36,35 @@ case "${1}" in
                modprobe cpufreq_powersave
                modprobe cpufreq_userspace
 
-               CPUCOUNT=`ls /sys/devices/system/cpu/cpu*/cpufreq/affected_cpus 2> /dev/null | wc -l `;
-               let CPUCOUNT-=1
-               # 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
+               driver=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver 2>/dev/null`
 
-                   # Set the governor to ondemand for all cpus 
-                   for i in `seq 0 $CPUCOUNT`;
-                   do
-                       cpufreq-set -c $i -g ondemand
-                   done
-                   echo_ok;
-               else
-                   echo_failure;
-               fi
+               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;
+                       ;;
+                   *)
+                       CPUCOUNT=`ls /sys/devices/system/cpu/cpu*/cpufreq/affected_cpus 2> /dev/null | wc -l `;
+                       let CPUCOUNT-=1
+                       # 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
+                                       cpufreq-set -c $i -g ondemand
+                               done
+                               echo_ok;
+                       else
+                               echo_failure;
+                       fi
+                       ;;
+                   esac
                exit 0;
                ;;
        *)