summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <awilcox@wilcox-tech.com>2019-01-27 20:20:57 +0000
committerA. Wilcox <awilcox@wilcox-tech.com>2019-01-27 20:20:57 +0000
commit35cf1156baad094ddcf9ef26ad26e71fe5df1a97 (patch)
tree1658207d9ae5156b742148c50309b051e756eb9e
parentebeee0de334e0fe87934393f1be977aeb17805f3 (diff)
parent4b8e76cc12e2b73ff9ad920f7f4eb370f0ca3b33 (diff)
downloadpackages-35cf1156baad094ddcf9ef26ad26e71fe5df1a97.tar.gz
packages-35cf1156baad094ddcf9ef26ad26e71fe5df1a97.tar.bz2
packages-35cf1156baad094ddcf9ef26ad26e71fe5df1a97.tar.xz
packages-35cf1156baad094ddcf9ef26ad26e71fe5df1a97.zip
Merge branch 'haveged' into 'master'
user/haveged: new package APKBUILD, patch, and OpenRC script imported from Alpine. Builds and runs on `x86_64`. Note the OpenRC configuration file does not set any default options -- it may be desirable to set some default options there such as `-w 1024`, which I believe is common in other distributions. See merge request !149
-rw-r--r--user/haveged/APKBUILD51
-rw-r--r--user/haveged/fix-cpu-cache-size-detection.patch15
-rw-r--r--user/haveged/haveged.confd5
-rw-r--r--user/haveged/haveged.initd11
4 files changed, 82 insertions, 0 deletions
diff --git a/user/haveged/APKBUILD b/user/haveged/APKBUILD
new file mode 100644
index 000000000..7a40a3fc4
--- /dev/null
+++ b/user/haveged/APKBUILD
@@ -0,0 +1,51 @@
+# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+# Contributor: Danilo Godec <danilo.godec@agenda.si>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: multiplexd <multi@in-addr.xyz>
+pkgname=haveged
+pkgver=1.9.4
+pkgrel=1
+pkgdesc="Entropy harvesting daemon using CPU timings"
+url="http://www.issihosts.com/haveged/"
+arch="all"
+license="GPL-3.0+"
+subpackages="$pkgname-doc $pkgname-openrc"
+makedepends="linux-headers"
+source="$pkgname-$pkgver.tar.gz::https://github.com/jirka-h/haveged/archive/$pkgver.tar.gz
+ fix-cpu-cache-size-detection.patch
+ haveged.initd
+ haveged.confd"
+
+build() {
+ cd "$builddir"
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install
+
+ rm "$pkgdir"/usr/lib/libhavege.la
+
+ install -Dm755 "$srcdir"/haveged.initd \
+ "$pkgdir"/etc/init.d/haveged
+ install -Dm644 "$srcdir"/haveged.confd \
+ "$pkgdir"/etc/conf.d/haveged
+}
+
+sha512sums="20017c7637779c0cfa414233bb67efb2976f92c08e4eb1b7ea41ccd483dad755629d8e05fb8560a2db811fc2ded7d05fa081ab10c59341cb4c206595a964641d haveged-1.9.4.tar.gz
+6279296b057f19daf25020ac14997268230af4b11510d6e5c4a86989c119d6b081d2501069af198772302d5cce1464514c749033a4928fb95671268825a84ba8 fix-cpu-cache-size-detection.patch
+5d1e4186580951d4e6e01193e9c8827ceddaf3c2e28a981fc9176cb446bed32b059304796a77d9db6fb761a21f8fd27dd3d31e06a0fb7a5985b4ea94978fcd64 haveged.initd
+57201472fc659aaab919562a00d474d3823d5becea62e8b13ef93eda05e1fd667721c968f224fcae871d13cfcd16d1924403d9181e0899fa214fa00bf4fefc75 haveged.confd"
diff --git a/user/haveged/fix-cpu-cache-size-detection.patch b/user/haveged/fix-cpu-cache-size-detection.patch
new file mode 100644
index 000000000..07da2b46d
--- /dev/null
+++ b/user/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);
+ }
+ }
diff --git a/user/haveged/haveged.confd b/user/haveged/haveged.confd
new file mode 100644
index 000000000..c4c1e0a3b
--- /dev/null
+++ b/user/haveged/haveged.confd
@@ -0,0 +1,5 @@
+# Config file for /etc/init.d/haveged
+
+# Any extra options you want to pass to haveged
+# on start-up should be put here.
+HAVEGED_OPTS="-w 1024"
diff --git a/user/haveged/haveged.initd b/user/haveged/haveged.initd
new file mode 100644
index 000000000..86660e9c3
--- /dev/null
+++ b/user/haveged/haveged.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+
+command="/usr/sbin/haveged"
+command_args="$HAVEGED_OPTS"
+command_background="yes"
+
+pidfile="/run/$RC_SVCNAME.pid"
+
+depend() {
+ need net
+}