]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Add cpufrequtils
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 2 Aug 2008 07:27:36 +0000 (09:27 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 2 Aug 2008 07:27:36 +0000 (09:27 +0200)
Disabled collectd wireless plugin as default, (enabling by hostapd initskript)

config/collectd/collectd.conf
config/rootfiles/packages/cpufrequtils [new file with mode: 0644]
doc/packages-list.txt
lfs/collectd
lfs/cpufrequtils [new file with mode: 0644]
lfs/initscripts
make.sh
src/initscripts/init.d/cpufreq [new file with mode: 0644]
src/initscripts/init.d/hostapd

index 9c5ba2946d8dd340c5865dfd3bddb41a6ca93539..f92ecf2c8ac64e5d0f9d3f3b57149ffc2a4ca894 100644 (file)
@@ -13,6 +13,7 @@ Interval     30
 ReadThreads  3
 
 LoadPlugin cpu
+#LoadPlugin cpufreq
 LoadPlugin disk
 LoadPlugin interface
 LoadPlugin iptables
@@ -26,7 +27,7 @@ LoadPlugin rrdtool
 LoadPlugin sensors
 LoadPlugin swap
 LoadPlugin syslog
-LoadPlugin wireless
+#LoadPlugin wireless
 
 <Plugin interface>
        Interface "lo"
diff --git a/config/rootfiles/packages/cpufrequtils b/config/rootfiles/packages/cpufrequtils
new file mode 100644 (file)
index 0000000..de10206
--- /dev/null
@@ -0,0 +1,17 @@
+usr/bin/cpufreq-info
+usr/bin/cpufreq-set
+#usr/include/cpufreq.h
+#usr/lib/libcpufreq.a
+#usr/lib/libcpufreq.la
+usr/lib/libcpufreq.so
+usr/lib/libcpufreq.so.0
+usr/lib/libcpufreq.so.0.0.0
+#usr/man/man1/cpufreq-info.1
+#usr/man/man1/cpufreq-set.1
+#usr/share/locale/cs/LC_MESSAGES/cpufrequtils.mo
+usr/share/locale/de/LC_MESSAGES/cpufrequtils.mo
+#usr/share/locale/fr/LC_MESSAGES/cpufrequtils.mo
+#usr/share/locale/it/LC_MESSAGES/cpufrequtils.mo
+#usr/share/locale/pt/LC_MESSAGES/cpufrequtils.mo
+etc/rc.d/init.d/cpufreq
+etc/rc.d/rc3.d/S18cpufreq
index 70d564b085e8d58c403ca26a7e6279dc2f9d0d1c..398a6abd568849eb652ddd94ba5256c72b91cc29 100644 (file)
@@ -64,6 +64,7 @@
 * collectd-4.4.1
 * coreutils-5.96
 * cpio-2.6
+* cpufrequtils-004
 * cups-1.3.7
 * curl-7.15.3
 * cyrus-imapd-2.2.12
index 57061089d390112b730d43cf775958d97e734375..8eb4b4dc96a3eb77e66c21b3132a0368eeb8e1da 100644 (file)
@@ -79,7 +79,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && ./configure --prefix=/usr --localstatedir=/var \
                --disable-{apple_sensors,csv,ipvs,mbmon,memcached,mysql} \
-               --disable-{netlink,nginx,nut,perl,serial,snmp,tape,vserver,wireless,xmms} \
+               --disable-{netlink,nginx,nut,perl,serial,snmp,tape,vserver,xmms} \
                --disable-{perl,serial,snmp,tape,vserver,xmms} \
                --enable-{apcups,battery,cpu{,freq},df,disk,dns,email,entropy,exec,hddtemp} \
                --enable-{interface,iptables,irq,load,logfile,memory,multimeter} \
diff --git a/lfs/cpufrequtils b/lfs/cpufrequtils
new file mode 100644 (file)
index 0000000..b799b6f
--- /dev/null
@@ -0,0 +1,83 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# 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/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 004
+
+THISAPP    = cpufrequtils-$(VER)
+DL_FILE    = $(THISAPP).tar.bz2
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = cpufrequtils
+PAK_VER    = 1
+
+DEPS       = ""
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = f868b9b6642c6c16b36cfd3eb627506a
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && make
+       cd $(DIR_APP) && make install
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
index fff10c1a35c966028a53e7ba32b5bc0390a9e9cd..8de4269abb1e69a4ca27e8ed402d4abf7f2fc7f8 100644 (file)
@@ -97,6 +97,7 @@ $(TARGET) :
        ln -sf ../init.d/halt        /etc/rc.d/rc0.d/S99halt
        ln -sf ../init.d/sysklogd    /etc/rc.d/rc3.d/S10sysklogd
        ln -sf ../init.d/smartenabler /etc/rc.d/rc3.d/S19smartenabler
+       ln -sf ../init.d/cpufreq     /etc/rc.d/rc3.d/S18cpufreq
        ln -sf ../init.d/sysklogd    /etc/rc.d/rc6.d/K90sysklogd
        ln -sf ../init.d/sendsignals /etc/rc.d/rc6.d/S60sendsignals
        ln -sf ../init.d/mountfs     /etc/rc.d/rc6.d/S70mountfs
diff --git a/make.sh b/make.sh
index 973b4d59f27b086708f07a401c063d5a0a9dcbb1..4ae3d116a615162e804b0a32136de2490d18850a 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -586,6 +586,7 @@ buildipfire() {
   ipfiremake urlgrabber
   ipfiremake syslinux
   ipfiremake tftp-hpa
+  ipfiremake cpufrequtils
   echo Build on $HOSTNAME > $BASEDIR/build/var/ipfire/firebuild
   cat /proc/version >> $BASEDIR/build/var/ipfire/firebuild
   echo >> $BASEDIR/build/var/ipfire/firebuild
diff --git a/src/initscripts/init.d/cpufreq b/src/initscripts/init.d/cpufreq
new file mode 100644 (file)
index 0000000..e15037c
--- /dev/null
@@ -0,0 +1,59 @@
+#!/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     : 00.00
+#
+# Notes       :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+       start)
+               boot_mesg "Starting cpufreq ..."
+               # Chose your cpufreq module, acpi-cpufreq should work with
+               # newer hardware
+               modprobe acpi-cpufreq
+               # modprobe cpufreq-nforce2
+               # modprobe e-powersaver
+               # modprobe gx-suspmod
+               # modprobe longhaul
+               # modprobe longrun
+               # modprobe p4-clockmod
+               # modprobe powernow-k6
+               # modprobe powernow-k7
+               # modprobe powernow-k8
+               # modprobe speedstep-centrino
+               # modprobe speedstep-ich
+               # modprobe speedstep-lib
+               # modprobe speedstep-smi
+               
+               # load cqufreq governors
+               modprobe cpufreq_conservative
+               modprobe cpufreq_ondemand
+               modprobe cpufreq_powersave
+               modprobe cpufreq_userspace
+
+               # Set the governor to ondemand 
+               cpufreq-set -g ondemand
+               evaluate_retval;
+               
+               # activate cpufreq collectd module
+               sed -i -e "s|#LoadPlugin cpufreq|LoadPlugin cpufreq|g" /etc/collectd.conf
+
+               exit 0;
+               ;;
+       *)
+               echo "Usage: ${0} {start}"
+               exit 1
+               ;;
+esac
+
+# End $rc_base/init.d/cpufreq
index 87b08bb8ad1b576137e464cddfc9768f431ae220..6fa326e82eef7879936303f9da0acbacd935d261 100644 (file)
@@ -4,6 +4,8 @@
 
 case "${1}" in
         start)
+               # enable wlan module of collectd
+               sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf
                 /usr/local/bin/wlanconfig ath0 destroy
                 /usr/local/bin/wlanconfig blue0 create wlandev wifi0 wlanmode ap
                 /usr/sbin/iwconfig blue0 channel 05
@@ -12,8 +14,8 @@ case "${1}" in
                 ;;
 
         stop)
-                # Just make shure when going down the first time blue0 nw values are ignored
-                                                               sed -i -e 's/^ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="*", NAME="blue0"*/#ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="*", NAME="blue0"*/' /etc/udev/rules.d/30-persistent-network.rules
+                # Just make sure when going down the first time blue0 nw values are ignored
+               sed -i -e 's/^ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="*", NAME="blue0"*/#ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="*", NAME="blue0"*/' /etc/udev/rules.d/30-persistent-network.rules
                 /usr/local/bin/wlanconfig blue0 destroy
                 killproc /usr/bin/hostapd
                 evaluate_retval