diff options
Diffstat (limited to 'community/rng-tools')
-rw-r--r-- | community/rng-tools/APKBUILD | 52 | ||||
-rw-r--r-- | community/rng-tools/fix-textrels-on-PIC-x86.patch | 50 | ||||
-rw-r--r-- | community/rng-tools/rngd.confd | 1 | ||||
-rw-r--r-- | community/rng-tools/rngd.initd | 14 |
4 files changed, 117 insertions, 0 deletions
diff --git a/community/rng-tools/APKBUILD b/community/rng-tools/APKBUILD new file mode 100644 index 0000000000..83d0de3d84 --- /dev/null +++ b/community/rng-tools/APKBUILD @@ -0,0 +1,52 @@ +# Contributor: Dennis Przytarski <dennis@przytarski.com> +# Maintainer: ScrumpyJack <scrumypjack@st.ilet.to> +pkgname=rng-tools +pkgver=5 +pkgrel=3 +pkgdesc="a random number generator daemon" +url="http://sourceforge.net/projects/gkernel/" +arch="all" +license="GPL2" +depends="" +depends_dev="" +makedepends="argp-standalone linux-headers" +install= +subpackages="$pkgname-doc" +source="http://downloads.sourceforge.net/project/gkernel/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz + fix-textrels-on-PIC-x86.patch + rngd.confd + rngd.initd + " + +builddir="$srcdir"/$pkgname-$pkgver +build() { + cd "$builddir" + export LIBS="-largp" + ./configure \ + --prefix=/usr \ + --libexecdir=/usr/lib/rng-tools \ + --sysconfdir=/etc \ + --disable-silent-rules + make || return 1 +} + +package() { + cd "$builddir" + make DESTDIR="${pkgdir}" install || return 1 + + install -m644 -D "${srcdir}/rngd.confd" "${pkgdir}/etc/conf.d/rngd" || return 1 + install -m755 -D "${srcdir}/rngd.initd" "${pkgdir}/etc/init.d/rngd" || return 1 +} + +md5sums="6726cdc6fae1f5122463f24ae980dd68 rng-tools-5.tar.gz +327ecc26d50a4a93f8cdec4a24fa837c fix-textrels-on-PIC-x86.patch +2652d9515601d09291f66f8c352d3034 rngd.confd +e0dbde536f506707cb11594fc947607d rngd.initd" +sha256sums="60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e rng-tools-5.tar.gz +15072f76a7198859a08de56fc6c438a1c393a31e4a119200a7c8c63c5b15f0b6 fix-textrels-on-PIC-x86.patch +bcd519614980323554c1db08aea876dff4f0f1cee10e86d4826443aaa81b489d rngd.confd +7ccc1b605a7a861bed8b032010aaad4d745b2e8a8d1800840e1f7063f128599c rngd.initd" +sha512sums="58047c37cad4f5f1210b696e4dba122878f78e57d05d9cb822f79234240ecce31efd2d39061fea1eb5b2e81d48d8c3bf6b92d06451f1ce5d5db7117704e89c50 rng-tools-5.tar.gz +5c8196c3e70c093215fc0720cd3f58f339f74293a7eb35d95b914591d783472119dcc34fb27ab6a4c3ce5359e050b4987d1e7ddf213a7445fc0b70d9fae5eae5 fix-textrels-on-PIC-x86.patch +ce82f583ab06580f038f17d4ecc84655cfc001abf344f9a50d12b8c1a5a6c4b74c386fbbc8b130201e4c34a7d99da75a4e64bcc41b2aebd381e74a352b5531c4 rngd.confd +46abb31d575854a51fc5ee1d31eb436e153cf969435d5b835d6fb44f4bdce549378ca9abcd81142abeb650312bd62133552eed2bec4eb9035f9456f739f1a3b7 rngd.initd" diff --git a/community/rng-tools/fix-textrels-on-PIC-x86.patch b/community/rng-tools/fix-textrels-on-PIC-x86.patch new file mode 100644 index 0000000000..88d0a7f905 --- /dev/null +++ b/community/rng-tools/fix-textrels-on-PIC-x86.patch @@ -0,0 +1,50 @@ +--- rng-tools/rdrand_asm.S ++++ rng-tools/rdrand_asm.S +@@ -49,6 +49,7 @@ + ret + ENDPROC(x86_rdrand_nlong) + ++#define INIT_PIC() + #define SETPTR(var,ptr) leaq var(%rip),ptr + #define PTR0 %rdi + #define PTR1 %rsi +@@ -84,7 +85,16 @@ + ret + ENDPROC(x86_rdrand_nlong) + ++#if defined(__PIC__) ++#undef __i686 /* gcc builtin define gets in our way */ ++#define INIT_PIC() \ ++ call __i686.get_pc_thunk.bx ; \ ++ addl $_GLOBAL_OFFSET_TABLE_, %ebx ++#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr ++#else ++#define INIT_PIC() + #define SETPTR(var,ptr) movl $(var),ptr ++#endif + #define PTR0 %eax + #define PTR1 %edx + #define PTR2 %ecx +@@ -101,6 +111,7 @@ + movl 8(%ebp), %eax + movl 12(%ebp), %edx + #endif ++ INIT_PIC() + + SETPTR(aes_round_keys, PTR2) + +@@ -166,6 +177,17 @@ + #endif + ret + ENDPROC(x86_aes_mangle) ++ ++#if defined(__i386__) && defined(__PIC__) ++ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits ++.globl __i686.get_pc_thunk.bx ++ .hidden __i686.get_pc_thunk.bx ++ .type __i686.get_pc_thunk.bx,@function ++__i686.get_pc_thunk.bx: ++ movl (%esp), %ebx ++ ret ++#endif ++ diff --git a/community/rng-tools/rngd.confd b/community/rng-tools/rngd.confd new file mode 100644 index 0000000000..c065e7e3b9 --- /dev/null +++ b/community/rng-tools/rngd.confd @@ -0,0 +1 @@ +RNGD_OPTS="--no-drng=1 --no-tpm=1" diff --git a/community/rng-tools/rngd.initd b/community/rng-tools/rngd.initd new file mode 100644 index 0000000000..b91412ddf8 --- /dev/null +++ b/community/rng-tools/rngd.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run + +name="rngd" +command="/usr/sbin/${name}" +command_args="-f ${RNGD_OPTS}" +command_background="yes" +start_stop_daemon_args="--wait 5" +pidfile="/var/run/${name}.pid" + +depend() { + need localmount + after urandom + provide entropy +} |