diff options
author | B. Watson <yalhcru@gmail.com> | 2020-06-06 09:12:44 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-06-06 09:12:44 +0700 |
commit | d1fb1dbca9b4a400899d2d96d2cbd5a1821da20a (patch) | |
tree | 88ba879ff83241655be93f78b58120c314068816 /system/memtester | |
parent | 017233c05e7e0f60476156f12c5572db2c3df5b5 (diff) | |
download | slackbuilds-d1fb1dbca9b4a400899d2d96d2cbd5a1821da20a.tar.gz |
system/memtester: Added (memory test utility).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/memtester')
-rw-r--r-- | system/memtester/README | 23 | ||||
-rw-r--r-- | system/memtester/memtester.SlackBuild | 78 | ||||
-rw-r--r-- | system/memtester/memtester.info | 12 | ||||
-rw-r--r-- | system/memtester/slack-desc | 19 |
4 files changed, 132 insertions, 0 deletions
diff --git a/system/memtester/README b/system/memtester/README new file mode 100644 index 0000000000..df134f1b2e --- /dev/null +++ b/system/memtester/README @@ -0,0 +1,23 @@ +memtester (memory test utility) + +memtester is a userspace utility for testing the memory subsystem for +faults. Unlike memtest86, it runs as a process on a running Linux system, +meaning it can't test all of memory the way memtest86 is able to... but +you don't have to reboot to use it. + +Note that, by definition, memtester counts as a denial-of-service +(resource exhaustion) attack against the local machine. Be cautious +about using it, and definitely *read its man page* before use. + +memtester has traditionally been run as root, so that it can lock the +memory it's testing to prevent swapping and remapping. However, it's +possible to use capabilities to allow it to run correctly as a normal +user. Use something like: + +# chown root:console /usr/bin/memtester +# chmod 0750 /usr/bin/memtester +# setcap cap_ipc_lock=ep /usr/bin/memtester + +This allows anyone in the "console" group to run memtester. You could +also create a memtester group and use it in the chown command above, +if you'd rather have more fine-grained control. diff --git a/system/memtester/memtester.SlackBuild b/system/memtester/memtester.SlackBuild new file mode 100644 index 0000000000..d32e2086c4 --- /dev/null +++ b/system/memtester/memtester.SlackBuild @@ -0,0 +1,78 @@ +#!/bin/sh + +# Slackware build script for memtester + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# The _5 is the debian patchlevel. + +PRGNAM=memtester +VERSION=${VERSION:-4.3.0_5} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +SRCVER="$( echo $VERSION | cut -d_ -f1 )" +DEBVER="$( echo $VERSION | cut -d_ -f2 )" + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG/usr $OUTPUT +cd $TMP +rm -rf $PRGNAM-$SRCVER +tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz +cd $PRGNAM-$SRCVER +tar xvf $CWD/${PRGNAM}_$SRCVER-$DEBVER.debian.tar.xz +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 {} \+ + +# These patches don't do much, but they're worth having. +for i in $( cat debian/patches/series ); do + patch -p1 < debian/patches/$i +done + +# After applying the debian patches, CC doesn't get a default value (?) +make CC=${CC:-gcc} CFLAGS="$SLKCFLAGS" +make install INSTALLPATH=$PKG/usr + +# Binary already stripped, manpage already gzipped. + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a BUGS CHANGELOG COPYING README* $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 + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/memtester/memtester.info b/system/memtester/memtester.info new file mode 100644 index 0000000000..eac51c6c69 --- /dev/null +++ b/system/memtester/memtester.info @@ -0,0 +1,12 @@ +PRGNAM="memtester" +VERSION="4.3.0_5" +HOMEPAGE="http://pyropus.ca/software/memtester/" +DOWNLOAD="http://pyropus.ca/software/memtester/old-versions/memtester-4.3.0.tar.gz \ + http://deb.debian.org/debian/pool/main/m/memtester/memtester_4.3.0-5.debian.tar.xz" +MD5SUM="598f41b7308e1f736164bca3ab84ddbe \ + a1db0271761c3913357a1930e5753e3b" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/system/memtester/slack-desc b/system/memtester/slack-desc new file mode 100644 index 0000000000..d68f3dccba --- /dev/null +++ b/system/memtester/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------------------------------------------------------| +memtester: memtester (memory test utility) +memtester: +memtester: memtester is a userspace utility for testing the memory subsystem +memtester: for faults. Unlike memtest86, it runs as a process on a running +memtester: Linux system, meaning it can't test all of memory the way memtest86 +memtester: is able to... but you don't have to reboot to use it. +memtester: +memtester: +memtester: +memtester: +memtester: |