From 39dab9181378d1d7443ffe4c5a32a57663be07af Mon Sep 17 00:00:00 2001 From: Erik Falor Date: Wed, 13 Sep 2017 09:04:22 +0100 Subject: [PATCH] system/haveged: SlackBuild updated (thanks to Nikos Giotis). Signed-off-by: David Spencer --- system/haveged/haveged.SlackBuild | 32 ++++++++++++++++++++++++------- system/haveged/rc.haveged | 6 +++--- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/system/haveged/haveged.SlackBuild b/system/haveged/haveged.SlackBuild index b21881f871..48bafb4913 100644 --- a/system/haveged/haveged.SlackBuild +++ b/system/haveged/haveged.SlackBuild @@ -22,14 +22,20 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Modified by Nikos Giotis 20170903, Athens, GR +# Use static building +# Changed install target to /sbin, /lib[64] +# Added check for existing installation due to problems when rebuilding +# produces binary that segfaults if any previous installation is there + PRGNAM=haveged VERSION=${VERSION:-1.9.1} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -40,8 +46,8 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" @@ -56,6 +62,16 @@ fi set -e +# Try to detect any previous installations and bail out if true +if [ -f "/usr/lib$LIBDIRSUFFIX/libhavege.so" -o \ + -f "/usr/lib$LIBDIRSUFFIX/libhavege.a" -o \ + -f "/lib$LIBDIRSUFFIX/libhavege.so" -o \ + -f "/lib$LIBDIRSUFFIX/libhavege.a" ]; then + echo 'Detected libhaveged!' >&2 + echo 'Please remove libhaveged before building a new one.' >&2 + exit 1 +fi + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP @@ -67,18 +83,20 @@ find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -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 {} \; +# Static build for easier inclusion in initrd CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ +LDFLAGS="-static" \ ./configure \ --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sbindir=/sbin \ + --libdir=/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ - --disable-static \ --build=$ARCH-slackware-linux make diff --git a/system/haveged/rc.haveged b/system/haveged/rc.haveged index 7f6f5e4fc2..404d9ca800 100644 --- a/system/haveged/rc.haveged +++ b/system/haveged/rc.haveged @@ -9,9 +9,9 @@ haveged_start() { if [ -f $PIDFILE ]; then echo "HAVEGE daemon is already running as PID $(cat $PIDFILE) " >&2 exit 3 - elif [ -x /usr/sbin/haveged ]; then - echo "Starting HAVEGE daemon: /usr/sbin/haveged" - /usr/sbin/haveged $HAVEGED_OPTS + elif [ -x /sbin/haveged ]; then + echo "Starting HAVEGE daemon: /sbin/haveged" + /sbin/haveged $HAVEGED_OPTS fi }