added extra/haveged

This commit is contained in:
Kevin Mihelich 2018-05-29 02:14:06 +00:00
parent 4e7abe2c8e
commit cb471c13a6
3 changed files with 72 additions and 0 deletions

44
extra/haveged/PKGBUILD Normal file
View file

@ -0,0 +1,44 @@
# $Id$
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: kfgz <kfgz at interia dot pl>
# Contributor: pootzko <pootzko at gmail dot com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch from Alpine Linux to fix cache detection issues on ARM
pkgname=haveged
pkgver=1.9.1
pkgrel=4.1
pkgdesc='Entropy harvesting daemon using CPU timings'
arch=('i686' 'x86_64')
url='http://www.issihosts.com/haveged'
license=('GPL')
depends=('glibc')
validpgpkeys=('4CFBA9F06A360837CE23919DA24EDC651E265688') # Gary Wuertz <gary@issiweb.com>
source=("$url/$pkgname-$pkgver.tar.gz"
"$pkgname-$pkgver.tar.gz.sig::$url/verify/$pkgname-$pkgver.sig"
'haveged.service'
'fix-cpu-cache-size-detection.patch')
sha256sums=('9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715'
'SKIP'
'43540fbff57c5106e4283dd7b331499648e38ba15e84898ef5e0a53cccc0200b'
'5aecfd72a1dbb9cc9b32d5677917d8a59dba7a2e021e31dee95f3f5b9e7ecf28')
prepare() {
cd $pkgname-$pkgver
patch -p1 -i ../fix-cpu-cache-size-detection.patch
}
build() {
cd $pkgname-$pkgver
./configure \
--prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/bin
make
}
package() {
make -C $pkgname-$pkgver DESTDIR="$pkgdir" install
install -Dm644 haveged.service "$pkgdir"/usr/lib/systemd/system/haveged.service
}

View file

@ -0,0 +1,15 @@
Some ARM cpus does not report the cache size or say it is -1
diff --git a/src/havegetune.c b/src/havegetune.c
index f1a99f2..de39c53 100644
--- a/src/havegetune.c
+++ b/src/havegetune.c
@@ -795,6 +795,8 @@ static int vfs_configInfoCache(
ctype = vfs_configFile(pAnchor, path, vfs_configType);
strcpy(path+plen, "size");
size = vfs_configFile(pAnchor, path, vfs_configInt);
+ if (size == -1)
+ size = ctype == 'I' ? GENERIC_ICACHE : GENERIC_DCACHE;
cfg_cacheAdd(pAnchor, SRC_VFS_INDEX, pArgs[1], level, ctype, size);
}
}

View file

@ -0,0 +1,13 @@
[Unit]
Description=Entropy Harvesting Daemon
Documentation=man:haveged(8)
[Service]
ExecStart=/usr/bin/haveged -F -w 1024 -v 1
SuccessExitStatus=143
ProtectSystem=full
ProtectHome=on
PrivateNetwork=on
[Install]
WantedBy=multi-user.target