summaryrefslogtreecommitdiffstats
path: root/system/hddtemp
diff options
context:
space:
mode:
Diffstat (limited to 'system/hddtemp')
-rw-r--r--system/hddtemp/README20
-rw-r--r--system/hddtemp/README.Slackware27
-rw-r--r--system/hddtemp/doinst.sh1
-rw-r--r--system/hddtemp/hddtemp.SlackBuild72
-rw-r--r--system/hddtemp/hddtemp.info2
-rw-r--r--system/hddtemp/rc.hddtemp.new102
-rw-r--r--system/hddtemp/slack-desc10
7 files changed, 190 insertions, 44 deletions
diff --git a/system/hddtemp/README b/system/hddtemp/README
index 7f3abd48b8..76b38fc83b 100644
--- a/system/hddtemp/README
+++ b/system/hddtemp/README
@@ -1,21 +1,5 @@
-hddtemp (reads hard disk S.M.A.R.T. info and reports temperature)
-
hddtemp is a small and daemonizable utility designed to read the
S.M.A.R.T. information from the given hard disk and report the
-temperature of the disk. Different hard disk manufacturers use
-different raw values in their S.M.A.R.T. data and the hddtemp.db file
-helps to map raw values to actual temperatures.
-
-http://www.guzu.net/linux/hddtemp.php
-https://savannah.nongnu.org/projects/hddtemp/
-
-The hddtemp.db file does not include more recent hard disks as the
-project does not appear to be maintained anymore. To resolve this,
-simply add your disk to the file manually. Run hddtemp on your drive
-to get the expected string and use the other entries in the file as
-templates to create a new one.
+temperature of the disk.
-Note that only a few hard disks actually differ from the 194C value so
-you can bet your disk will probably use that value too, but I
-recommend using older drives from the same manufacturer that are in the
-file as a guideline.
+Note: hddtemp does not support eMMC or NVMe devices.
diff --git a/system/hddtemp/README.Slackware b/system/hddtemp/README.Slackware
new file mode 100644
index 0000000000..5e774248e4
--- /dev/null
+++ b/system/hddtemp/README.Slackware
@@ -0,0 +1,27 @@
+To use hddtemp you need to do the following:
+
+First you must make sure hddtemp knows how to handle your disks. Run
+the command "hddtemp /dev/sdX" as root for each of your block devices.
+If it correctly reports HDD model and its temperature, you're all set.
+If instead you get a warning that the drive is not in the database, you
+have to add a record describing your device to /etc/hddtemp/hddtemp.db.
+Use the disk ID string returned by hddtemp in the first column. Most
+drives will use "194" and "C" in second and third columns, but check
+output of "smartctl" command to see if this is really the case for your
+disk. The last column is a free-form description of the device.
+
+Next, edit /etc/rc.d/rc.hddtemp and set HDDTEMP_DRIVES variable to a list
+of drives you want to monitor. Use the usual /dev/sdX block device files,
+or the symlinks available in /dev/disk/. Multiple entries must be separated
+with spaces. The remaining configuration variables are set to reasonable
+defaults, change them if it suits your needs.
+
+Finally, to start hddtemp automatically at boot, make /etc/rc.d/rc.hddtemp
+executable and add the following to your /etc/rc.d/rc.local:
+
+if [ -x /etc/rc.d/rc.hddtemp ]; then
+ /etc/rc.d/rc.hddtemp start
+fi
+
+Once the hddtemp daemon is running you can use hddtemp-aware tools such as
+gkrellm or Conky to display the temperature readings.
diff --git a/system/hddtemp/doinst.sh b/system/hddtemp/doinst.sh
index 7f616013b7..822ea598b2 100644
--- a/system/hddtemp/doinst.sh
+++ b/system/hddtemp/doinst.sh
@@ -12,4 +12,5 @@ config() {
}
config etc/hddtemp/hddtemp.db.new
+config etc/rc.d/rc.hddtemp.new
diff --git a/system/hddtemp/hddtemp.SlackBuild b/system/hddtemp/hddtemp.SlackBuild
index 4573308d9c..836e889351 100644
--- a/system/hddtemp/hddtemp.SlackBuild
+++ b/system/hddtemp/hddtemp.SlackBuild
@@ -1,15 +1,40 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for hddtemp
-# Written by Zordrak
-
-# Modified by SlackBuilds.org
+# Copyright 2010 Zordrak
+# Copyright 2010-2020 SlackBuilds.org
+# Copyright 2020 Dominik Drobek <dominik.drobek (at) o2.pl>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# 20220318 bkw: Modified by SlackBuilds.org:
+# - fix 32-bit build.
+# - do not install useless INSTALL in doc dir.
+
+cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=hddtemp
VERSION=${VERSION:-0.3beta15}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-4}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
SRCVERSION="0.3-beta15"
@@ -21,7 +46,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -51,34 +80,37 @@ cd $PRGNAM-$SRCVERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
patch -p1 < $CWD/hddtemp.patch
+# 20220318 bkw: 'struct ucontext' was removed from glibc, use
+# 'ucontext_t' instead: https://sourceware.org/glibc/wiki/Release/2.26
+# Curiously, this only broke the build on 32-bit Slackware...
+sed -i 's,struct *ucontext,ucontext_t,g' src/backtrace.c
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
- --libdir=/usr/lib$LIBDIRSUFFIX \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
--with-db-path=/etc/hddtemp/hddtemp.db \
--build=$ARCH-slackware-linux
make
-make install DESTDIR=$PKG
-
-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
-
-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
+make install-strip DESTDIR=$PKG
+gzip -9 $PKG/usr/man/man*/*
-mkdir -p $PKG/etc/hddtemp
-cp $CWD/hddtemp.db $PKG/etc/hddtemp/hddtemp.db.new
+install -D -m 644 $CWD/hddtemp.db $PKG/etc/hddtemp/hddtemp.db.new
+install -D -m 644 $CWD/rc.hddtemp.new $PKG/etc/rc.d/rc.hddtemp.new
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a ABOUT-NLS ChangeLog GPL-2 INSTALL README TODO COPYING LICENSE contribs \
+cp -a ABOUT-NLS ChangeLog GPL-2 README TODO COPYING LICENSE contribs/ \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
@@ -87,4 +119,4 @@ 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}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/system/hddtemp/hddtemp.info b/system/hddtemp/hddtemp.info
index 9d28ae58c7..3bdfd6cf6e 100644
--- a/system/hddtemp/hddtemp.info
+++ b/system/hddtemp/hddtemp.info
@@ -1,7 +1,7 @@
PRGNAM="hddtemp"
VERSION="0.3beta15"
HOMEPAGE="https://savannah.nongnu.org/projects/hddtemp/"
-DOWNLOAD="http://download.savannah.gnu.org/releases/hddtemp/hddtemp-0.3-beta15.tar.bz2"
+DOWNLOAD="https://download.savannah.gnu.org/releases/hddtemp/hddtemp-0.3-beta15.tar.bz2"
MD5SUM="8b829339e1ae9df701684ec239021bb8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
diff --git a/system/hddtemp/rc.hddtemp.new b/system/hddtemp/rc.hddtemp.new
new file mode 100644
index 0000000000..6532a95cde
--- /dev/null
+++ b/system/hddtemp/rc.hddtemp.new
@@ -0,0 +1,102 @@
+#!/bin/sh
+
+# Script to start/stop/restart the hddtemp daemon.
+# Copyright 2017, 2020 Dominik Drobek <dominik.drobek (at) o2.pl>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+# Configuration options for hddtemp:
+
+# HDDTEMP_DRIVES must contain a list of drives to monitor.
+# The daemon will not start without it.
+HDDTEMP_DRIVES=""
+
+# Listen host and port:
+HDDTEMP_LISTENHOST="--listen=localhost"
+HDDTEMP_PORT="--port=7634"
+
+# Additional options (man 8 hddtemp):
+#HDDTEMP_OPTIONS=""
+
+hddtemp_getpid() {
+ HDDTEMP_PID="$(pidof hddtemp 2> /dev/null)"
+}
+
+hddtemp_start() {
+ hddtemp_getpid
+ if [ -n "${HDDTEMP_PID}" ]; then
+ echo "hddtemp daemon is already running!"
+ exit
+ fi
+
+ if [ -x /usr/sbin/hddtemp ]; then
+ echo -n "Starting hddtemp daemon: "
+ /usr/sbin/hddtemp --daemon \
+ ${HDDTEMP_LISTENHOST} \
+ ${HDDTEMP_PORT} \
+ ${HDDTEMP_OPTIONS} \
+ ${HDDTEMP_DRIVES} &> /dev/null
+ fi
+
+ hddtemp_getpid
+ if [ -n "${HDDTEMP_PID}" ]; then
+ echo "success"
+ else
+ echo "failed!"
+ fi
+}
+
+hddtemp_stop() {
+ hddtemp_getpid
+ if [ -z "${HDDTEMP_PID}" ]; then
+ echo "hddtemp daemon is not running!"
+ exit
+ else
+ echo -n "Stopping hddtemp daemon: "
+ kill "${HDDTEMP_PID}" &> /dev/null
+ sleep 1
+ fi
+
+ hddtemp_getpid
+ if [ -z "${HDDTEMP_PID}" ]; then
+ echo "success"
+ else
+ echo "failed!"
+ fi
+}
+
+hddtemp_restart() {
+ hddtemp_stop
+ hddtemp_start
+}
+
+case "$1" in
+ "start")
+ hddtemp_start
+ ;;
+ "stop")
+ hddtemp_stop
+ ;;
+ "restart")
+ hddtemp_restart
+ ;;
+ *)
+ echo "usage: $0 start|stop|restart"
+esac
diff --git a/system/hddtemp/slack-desc b/system/hddtemp/slack-desc
index 64d06f1ae3..b2eba97204 100644
--- a/system/hddtemp/slack-desc
+++ b/system/hddtemp/slack-desc
@@ -10,10 +10,10 @@ hddtemp: hddtemp (reads hard disk S.M.A.R.T. info and reports temperature)
hddtemp:
hddtemp: hddtemp is a small and daemonizable utility designed to read the
hddtemp: S.M.A.R.T. information from the given hard disk and report the
-hddtemp: temperature of the disk. Different hard disk manufacturers use
-hddtemp: different raw values in their S.M.A.R.T. data and the hddtemp.db file
-hddtemp: helps to map raw values to actual temperatures.
+hddtemp: temperature of the disk.
+hddtemp:
+hddtemp: Homepage: https://savannah.nongnu.org/projects/hddtemp/
+hddtemp:
+hddtemp:
hddtemp:
-hddtemp: http://www.guzu.net/linux/hddtemp.php
-hddtemp: https://savannah.nongnu.org/projects/hddtemp/
hddtemp: