aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-05-18 14:39:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-05-18 14:55:57 +0000
commit3cb6d79b93130a0354875ea95d32e0495bf41b81 (patch)
treea1cf700b0adea5bba4204625ac4ce6c702e42331
parent5db9c7d1de44edb12f18ad0ce7c3a54b37bfdc56 (diff)
downloadaports-3cb6d79b93130a0354875ea95d32e0495bf41b81.tar.bz2
main/haveged: fix for armhf and aarch64
armhf and aarch64 apparently does not expose the cpu cache size via sysfs. It set it to -1 and that confuses haveged. Make it fallback to default cache size when sysfs reports -1.
-rw-r--r--main/haveged/APKBUILD4
-rw-r--r--main/haveged/fix-arm.patch0
-rw-r--r--main/haveged/fix-cpu-cache-size-detection.patch15
3 files changed, 18 insertions, 1 deletions
diff --git a/main/haveged/APKBUILD b/main/haveged/APKBUILD
index 389e2b4..79894cb 100644
--- a/main/haveged/APKBUILD
+++ b/main/haveged/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=haveged
pkgver=1.9.2
-pkgrel=0
+pkgrel=1
pkgdesc="Entropy harvesting daemon using CPU timings"
url="https://sourceforge.net/projects/haveged"
arch="all"
@@ -11,6 +11,7 @@ license="GPL"
subpackages="$pkgname-doc"
makedepends="linux-headers"
source="$pkgname-$pkgver.tar.gz::https://sourceforge.net/projects/haveged/files/$pkgname-$pkgver.tar.gz/download
+ fix-cpu-cache-size-detection.patch
haveged.initd
haveged.confd"
builddir="$srcdir/$pkgname-$pkgver"
@@ -45,5 +46,6 @@ package() {
}
sha512sums="65f70950fb90ef9c24ff3bf1b26e19a9cde2bec4749e2e64d5461a51646a20cf610efa2a5014219b8605957afa0084abd2ba11c7dc15f9379afce784971627b8 haveged-1.9.2.tar.gz
+6279296b057f19daf25020ac14997268230af4b11510d6e5c4a86989c119d6b081d2501069af198772302d5cce1464514c749033a4928fb95671268825a84ba8 fix-cpu-cache-size-detection.patch
5d1e4186580951d4e6e01193e9c8827ceddaf3c2e28a981fc9176cb446bed32b059304796a77d9db6fb761a21f8fd27dd3d31e06a0fb7a5985b4ea94978fcd64 haveged.initd
57201472fc659aaab919562a00d474d3823d5becea62e8b13ef93eda05e1fd667721c968f224fcae871d13cfcd16d1924403d9181e0899fa214fa00bf4fefc75 haveged.confd"
diff --git a/main/haveged/fix-arm.patch b/main/haveged/fix-arm.patch
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/main/haveged/fix-arm.patch
diff --git a/main/haveged/fix-cpu-cache-size-detection.patch b/main/haveged/fix-cpu-cache-size-detection.patch
new file mode 100644
index 0000000..07da2b4
--- /dev/null
+++ b/main/haveged/fix-cpu-cache-size-detection.patch
@@ -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);
+ }
+ }