--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/01_minimum/old/cpufreqd-20160717/PlamoBuild.cpufreqd-2.4.2 2016-07-17 12:54:50.000000000 +0900 @@ -1,15 +1,15 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="http://downloads.sourceforge.net/cpufreqd/cpufreqd-2.4.2.tar.bz2" +pkgbase=cpufreqd +vers=2.4.2 arch=`uname -m` -build=P1 +build=P5 src=$pkgbase-$vers patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="COPYING NEWS ChangeLog AUTHORS INSTALL README TODO" ###################################################################### fscheck() { @@ -233,6 +233,12 @@ esac done done + cd $B + cp -p src/Makefile.in{,.orig} + sed -i 's@\@$(libdir)@g' src/Makefile.in + cp -p cpufreqd.conf{,.orig} + sed -i -e 's@^#\(enable_remote\)@\1@' \ + -e 's@^#\(remote_group\)@\1@' cpufreqd.conf for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then @@ -272,6 +278,128 @@ make install DESTDIR=$P fi done + mv $P/etc/cpufreqd.conf $C + mv $C/cpufreqd.conf $P/etc/cpufreqd.conf.new + cat <<- "EOF" > $P/etc/cpufreqd.conf.sample + [General] + pidfile=/var/run/cpufreqd.pid + poll_interval=2 + verbosity=4 + enable_remote=1 + remote_group=root + [/General] + + [sensors_plugin] + sensors_conf=/etc/sensors3.conf + [/sensors_plugin] + + [Profile] + name=On Demand High + minfreq=40% + maxfreq=100% + policy=ondemand + [/Profile] + + [Profile] + name=On Demand Low + minfreq=20% + maxfreq=80% + policy=ondemand + [/Profile] + + [Profile] + name=Performance High + minfreq=100% + maxfreq=100% + policy=performance + [/Profile] + + [Profile] + name=Performance Low + minfreq=80% + maxfreq=80% + policy=performance + [/Profile] + + [Profile] + name=Powersave High + minfreq=70% + maxfreq=70% + policy=powersave + [/Profile] + + [Profile] + name=Powersave Low + minfreq=30% + maxfreq=30% + policy=powersave + [/Profile] + + [Rule] + name=Default Rule + sensor=temp1:0-60 + cpu_interval=0-100 + profile=Performance High + [/Rule] + + [Rule] + name=CPU Too Hot + sensor=temp1:61-100 + cpu_interval=50-100 + profile=On Demand Low + [/Rule] + + EOF + install -d $P/etc/rc.d/init.d + cat <<- "EOF" > $P/etc/rc.d/init.d/cpufreqd + #!/bin/sh + + start() { + for i in cpufreq_{conservative,powersave,userspace,ondemand,stats} \ + freq_table ; do + modprobe $i > /dev/null 2>&1 + done + for i in acpi-cpufreq mperf p4-clockmod powernow-k8 speedstep-centrino \ + speedstep-lib ; do + modprobe $i > /dev/null 2>&1 + done + for i in ac battery container pci_slot processor sbshc video acpi_pad \ + button fan power_meter sbs thermal ; do + modprobe $i >/dev/null 2>&1 + done + if [ -x /usr/sbin/cpufreqd ] ; then + echo $"Starting cpufreqd..." + cpufreqd + fi + } + + stop() { + if [ -f /var/run/cpufreqd.pid ] ; then + echo $"Stopping cpufreqd daemon..." + kill `cat /var/run/cpufreqd.pid` + rm -f /var/run/cpufreqd.pid + fi + } + + case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + sleep 3 + start + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 + ;; + esac + exit 0 + EOF touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -295,9 +423,26 @@ ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done convert - tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` + install -d $P/install + cat <<- "EOF" > $P/install/doinst.sh + mv etc/cpufreqd.conf.new /tmp + if [ -f etc/cpufreqd.conf ] ; then + mv /tmp/cpufreqd.conf.new etc/cpufreqd.conf.dist + else + mv /tmp/cpufreqd.conf.new etc/cpufreqd.conf + fi + EOF + touch -t `date '+%m%d0900'` $P/install/doinst.sh + tar cvpf $pkg.tar -C $P `cd $P ; find usr/sbin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/$libdir | tail -n+2` + tar rvpf $pkg.tar -C $P etc/cpufreqd.conf.{new,sample} + tar rvpf $pkg.tar -C $P etc/rc.d/init.d/cpufreqd tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man5 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man8 | tail -n+2` tar rvpf $pkg.tar -C $P usr/share/doc/$src + tar rvpf $pkg.tar -C $P install/doinst.sh touch -t `date '+%m%d0900'` $pkg.tar ; xz $pkg.tar ; touch $pkg.tar.xz mv $pkg.tar.xz $pkg.txz read -p "Do you want to keep work files? [y/N] " ans