From 322cfb172d9c04dfc3aa7a1908cb61dbab952443 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Fri, 28 Mar 2014 20:37:47 -0500 Subject: system/thermal-daemon: Miscellaneous cleanups Signed-off-by: Robby Workman --- system/thermal_daemon/README | 17 ++++++----------- system/thermal_daemon/README.Slackware | 13 ++++++++----- system/thermal_daemon/doinst.sh | 16 ++++++++++++++++ system/thermal_daemon/thermal_daemon.SlackBuild | 12 +++++++----- 4 files changed, 37 insertions(+), 21 deletions(-) create mode 100644 system/thermal_daemon/doinst.sh (limited to 'system/thermal_daemon') diff --git a/system/thermal_daemon/README b/system/thermal_daemon/README index 9cca31e08c..1510ad7c1b 100644 --- a/system/thermal_daemon/README +++ b/system/thermal_daemon/README @@ -1,16 +1,13 @@ The Linux Thermal Daemon program from 01.org -Thermald deals with thermal issues for intel processor families codenamed -intel sandy-bridge and above. -Its is a Linux daemon used to prevent the overheating of systems. -This daemon monitors temperature and applies compensation using available -cooling methods. +Thermald deals with thermal issues for intel processor families +codenamed intel sandy-bridge and above. It is a Linux daemon +used to prevent the overheating of systems. This daemon monitors +temperature and applies compensation using available cooling methods. -Prerequisites: +Prerequisites: intel p-state driver and kernel 3.10+ -Uses intel p-state driver and works with kernels 3.10 and above. - -Prefers kernel with +Prefers kernel with: Intel RAPL power capping driver : Available from Linux kernel 3.13.rc1 Intel P State driver (Available in Linux kernel stable release) Intel Power clamp driver (Available in Linux kernel stable release) @@ -18,6 +15,4 @@ Prefers kernel with CONFIG_X86_MSR, so that x86 MSR can be read/write from user space to control RAPL if no RAPL powecap class driver is not present. - Default If none of the above is available uses cpufreq to control P states. - diff --git a/system/thermal_daemon/README.Slackware b/system/thermal_daemon/README.Slackware index 601b654e72..c0460ec5b2 100644 --- a/system/thermal_daemon/README.Slackware +++ b/system/thermal_daemon/README.Slackware @@ -1,12 +1,15 @@ -Since this is a daemon, it should be started at boot via /etc/rc.d/rc.local : -/usr/bin/thermald +Since this is a daemon, it should be started at boot via /etc/rc.d/rc.local: + /usr/bin/thermald + +It might be necessary to create /var/run/thermald/ first (depending on your +local system setup) Also it would need to be stopped before shutdown, so an entry could be added -to /etc/rc.d/rc.local_shutdown as well : -killall thermald +to /etc/rc.d/rc.local_shutdown as well: + killall thermald CONFIG_X86_MSR is listed as an (optional) dependency, msr-tools can be installed from http://01.org/msr-tools via src2pkg (www.src2pkg.net/) If you installed a previous version of thermald, you may need to uninstall -it one and then re-install this one instead of upgrading. +it and then install this one instead of using upgradepkg diff --git a/system/thermal_daemon/doinst.sh b/system/thermal_daemon/doinst.sh new file mode 100644 index 0000000000..95d2cdd197 --- /dev/null +++ b/system/thermal_daemon/doinst.sh @@ -0,0 +1,16 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/thermald/thermal-conf.xml.new +config etc/thermald/thermal-cpu-cdev-order.xml.new + diff --git a/system/thermal_daemon/thermal_daemon.SlackBuild b/system/thermal_daemon/thermal_daemon.SlackBuild index c77fbb1958..9457eed88a 100644 --- a/system/thermal_daemon/thermal_daemon.SlackBuild +++ b/system/thermal_daemon/thermal_daemon.SlackBuild @@ -86,9 +86,12 @@ find -L . \ make make install DESTDIR=$PKG -#Remove /etc/init and systemd stuff +# Remove /etc/init but keep dbus config rm -r $PKG/etc/init -rm -r $PKG/etc/dbus-1 + +# Don't clobber configs +mv $PKG/etc/thermald/thermal-conf.xml $PKG/etc/thermald/thermal-conf.xml.new +mv $PKG/etc/thermald/thermal-cpu-cdev-order.xml $PKG/etc/thermald/thermal-cpu-cdev-order.xml.new find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true @@ -97,13 +100,12 @@ find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a \ - COPYING README.txt \ - $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYING README.txt $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} -- cgit v1.2.3