Deploy a gross hack to make this buildable on -current and maybe -6.

XXX: This should be reverted and done a different way, or maybe not at all;
XXX: this package should probably be reviewed for soundness.
This commit is contained in:
dholland 2012-09-16 03:21:47 +00:00
parent cd1b38ed0b
commit 56896f9d15
3 changed files with 44 additions and 1 deletions

View file

@ -1,5 +1,7 @@
$NetBSD: distinfo,v 1.3 2006/11/09 11:08:01 rillig Exp $
$NetBSD: distinfo,v 1.4 2012/09/16 03:21:47 dholland Exp $
SHA1 (bitstir-0.2.tar.gz) = 867fc2b28805a71ca2f1e3e3337b3c906951e121
RMD160 (bitstir-0.2.tar.gz) = a34412882c2685acd4b6613fbfe8a6c9fa9ebcf1
Size (bitstir-0.2.tar.gz) = 6423 bytes
SHA1 (patch-Makefile) = 4f7eea72ed245c3c67eb48de0c6724622a3c564b
SHA1 (patch-bitstir_c) = 4af243a87acd713161797386f8a3b39f259e5037

View file

@ -0,0 +1,21 @@
$NetBSD: patch-Makefile,v 1.1 2012/09/16 03:21:47 dholland Exp $
Deploy a gross hack to make RND_POOLBITS available on recent NetBSD.
--- Makefile~ 2003-08-27 20:58:51.000000000 +0000
+++ Makefile
@@ -14,9 +14,13 @@ all: bits-avail bitstir
bits-avail: bits-avail.c
$(CC) $(CFLAGS) -DFIND=$(FIND) -o bits-avail bits-avail.c
-bitstir: bitstir.c
+bitstir: bitstir.c hack.h
$(CC) $(CFLAGS) -DFIND=$(FIND) -o bitstir bitstir.c
+hack.h:
+ grep RND_POOLWORDS /usr/include/sys/rnd.h | grep define > hack.h
+ grep RND_POOLBITS /usr/include/sys/rnd.h | grep define >> hack.h
+
install: .PHONY
install -c -o root -g wheel bitstir $(INSTALLDIR)
install -c -o root -g wheel bits-avail $(INSTALLDIR)

View file

@ -0,0 +1,20 @@
$NetBSD: patch-bitstir_c,v 1.1 2012/09/16 03:21:47 dholland Exp $
Deploy a gross hack to make RND_POOLBITS available on recent NetBSD.
--- bitstir.c~ 2003-08-27 20:58:51.000000000 +0000
+++ bitstir.c
@@ -41,6 +41,13 @@
#include <syslog.h>
#include <unistd.h>
+/* Ugh. Use this only if required and only if appropriate. */
+#ifdef __NetBSD__
+#ifndef RND_POOLBITS
+#include "hack.h"
+#endif
+#endif
+
const char gRequiredOS[] = "NetBSD";
const char gRandomDevice[] = "/dev/random";
const long gMaxEntropy = RND_POOLBITS;