diff options
author | B. Watson | 2024-03-08 11:56:59 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo | 2024-03-09 00:18:16 +0100 |
commit | 41395d8d807027dbe27870f8ddf216df4577d144 (patch) | |
tree | 4285c00673ac5780d2e9e30165eda737bcf64db7 /system | |
parent | da34f21ee9ff0902b7217670133ac7400a9c336c (diff) | |
download | slackbuilds-41395d8d807027dbe27870f8ddf216df4577d144.tar.gz |
system/hp-wmi-sensors: Added (monitoring system).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/hp-wmi-sensors/README | 36 | ||||
-rw-r--r-- | system/hp-wmi-sensors/doinst.sh | 3 | ||||
-rw-r--r-- | system/hp-wmi-sensors/git2tarxz.sh | 66 | ||||
-rw-r--r-- | system/hp-wmi-sensors/hp-wmi-sensors.SlackBuild | 70 | ||||
-rw-r--r-- | system/hp-wmi-sensors/hp-wmi-sensors.info | 10 | ||||
-rw-r--r-- | system/hp-wmi-sensors/slack-desc | 19 |
6 files changed, 204 insertions, 0 deletions
diff --git a/system/hp-wmi-sensors/README b/system/hp-wmi-sensors/README new file mode 100644 index 0000000000..09ab7fb221 --- /dev/null +++ b/system/hp-wmi-sensors/README @@ -0,0 +1,36 @@ +hp-wmi-sensors (hwmon sensors driver for HP business-class PCs) + +Hewlett-Packard (and some HP Compaq) business-class computers report +hardware monitoring information via Windows Management Instrumentation +(WMI). This driver exposes that information to the Linux hwmon +subsystem, allowing userspace utilities like sensors to gather numeric +sensor readings. + +In particular, it's required on some systems (e.g. the SlackBuild +author's HP Z2 Mini G3) for fan speeds to be visible in 'sensors'. + +Slackware-specific notes: + +The driver is a kernel module. By default, it's built for the +currently running kernel, but you can build it for any kernel version +if you have that kernel's modules and source installed. Set the KERNEL +environment variable to the version you want to build for. + +After installation, you can load the driver immediately, with: + + /sbin/modprobe hp-wmi-sensors + +To load the module on every boot, add the above command to +/etc/rc.d/rc.modules.local + +Note that there's already an hp-wmi module in Slackware's +kernel-modules package. Loading hp-wmi-sensors will add new sensors, +if there any supported by the driver. Look at the output of the +'sensors' command before and after loading the module, to see if it +found anything supported. + +Note to Slackware-current users: this build was developed and +tested on Slackware 15.0 (latest stable) with the 5.15.x series of +kernels. It may or may not work on -current. If it doesn't, I don't +want you to contact me about it *unless* you send me a patch that +fixes it. diff --git a/system/hp-wmi-sensors/doinst.sh b/system/hp-wmi-sensors/doinst.sh new file mode 100644 index 0000000000..b17f2a6739 --- /dev/null +++ b/system/hp-wmi-sensors/doinst.sh @@ -0,0 +1,3 @@ +if [ -x sbin/depmod ]; then + chroot . /sbin/depmod -a 1> /dev/null 2> /dev/null +fi diff --git a/system/hp-wmi-sensors/git2tarxz.sh b/system/hp-wmi-sensors/git2tarxz.sh new file mode 100644 index 0000000000..9c655890f1 --- /dev/null +++ b/system/hp-wmi-sensors/git2tarxz.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version number. + +# Takes one optional argument, which is the commit or tag to create a +# tarball of. With no arg, HEAD is used. + +# Version number example: 20200227_ad7ec17 + +# Notes: + +# Do not use this if you're packaging a release. + +# This script doesn't need to be run as root. It does need to be able +# to write to the current directory it's run from. + +# Running this script twice for the same commit will NOT give identical +# tarballs, even if the contents are identical. This is because tar +# includes the current time in a newly-created tarball (plus there may +# be other git-related reasons). + +# Once you've generated a tarball, you'll still need a place to host it. +# Ask on the mailing list, if you don't have your own web server to +# play with. + +## Config: +# final tarball and slackbuild PRGNAM: +PRGNAM=hp-wmi-sensors + +# For github projects, you can use this unmodified: +CLONE_URL=https://github.com/kangtastic/hp-wmi-sensors + +## End of config. + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERSION=${DATE}_${GIT_SHA} + +# Makefile needs .git to create the version string. +#rm -rf .git +#find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=\"$VERSION\"" +echo "MD5SUM=\"$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )\"" diff --git a/system/hp-wmi-sensors/hp-wmi-sensors.SlackBuild b/system/hp-wmi-sensors/hp-wmi-sensors.SlackBuild new file mode 100644 index 0000000000..ec6007a797 --- /dev/null +++ b/system/hp-wmi-sensors/hp-wmi-sensors.SlackBuild @@ -0,0 +1,70 @@ +#!/bin/bash + +# Slackware build script for hp-wmi-sensors + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=hp-wmi-sensors +VERSION=${VERSION:-20240121_e9f92c1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +KERNEL=${KERNEL:-$(uname -r)} +PKGVER=${VERSION}_$(echo $KERNEL | tr - _) + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$PKGVER-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +# LIBDIRSUFFIX not needed (modules always go in /lib), and the kernel +# build system provides its own set of CFLAGS. + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# don't depmod during the build (do it in the doinst.sh). +sed -i '/depmod/d' Makefile + +# don't want ARCH passed to the kernel Makefile, it gets confused if +# it's set to i586. +env -u ARCH make TARGET="$KERNEL" +make install KERNEL_MODULES=$PKG/lib/modules/$KERNEL + +PKGDOC=$PKG/usr/doc/$PRGNAM-$PKGVER +mkdir -p $PKGDOC +cp -a LICENSE README.rst $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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-$PKGVER-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/hp-wmi-sensors/hp-wmi-sensors.info b/system/hp-wmi-sensors/hp-wmi-sensors.info new file mode 100644 index 0000000000..6f3b291d78 --- /dev/null +++ b/system/hp-wmi-sensors/hp-wmi-sensors.info @@ -0,0 +1,10 @@ +PRGNAM="hp-wmi-sensors" +VERSION="20240121_e9f92c1" +HOMEPAGE="https://github.com/kangtastic/hp-wmi-sensors" +DOWNLOAD="https://slackware.uk/~urchlay/src/hp-wmi-sensors-20240121_e9f92c1.tar.xz" +MD5SUM="2f80a35ce5e2666e467ba46924792dbe" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/hp-wmi-sensors/slack-desc b/system/hp-wmi-sensors/slack-desc new file mode 100644 index 0000000000..1eaaa3c4c0 --- /dev/null +++ b/system/hp-wmi-sensors/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +hp-wmi-sensors: hp-wmi-sensors (hwmon sensors driver for HP business-class PCs) +hp-wmi-sensors: +hp-wmi-sensors: Hewlett-Packard (and some HP Compaq) business-class computers report +hp-wmi-sensors: hardware monitoring information via Windows Management Instrumentation +hp-wmi-sensors: (WMI). This driver exposes that information to the Linux hwmon +hp-wmi-sensors: subsystem, allowing userspace utilities like sensors to gather numeric +hp-wmi-sensors: sensor readings. +hp-wmi-sensors: +hp-wmi-sensors: In particular, it's required on some systems (e.g. the SlackBuild +hp-wmi-sensors: author's HP Z2 Mini G3) for fan speeds to be visible in 'sensors'. +hp-wmi-sensors: |