Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,8 +1,8 @@
$NetBSD: patch-configure,v 1.10 2015/09/17 11:24:11 he Exp $
$NetBSD: patch-configure,v 1.11 2016/02/03 13:10:27 he Exp $
Regen from configure.ac.
--- configure.orig 2015-09-10 18:56:19.000000000 +0000
--- configure.orig 2015-05-27 07:51:50.000000000 +0000
+++ configure
@@ -797,6 +797,8 @@ BUILD_PLUGIN_NFS_FALSE
BUILD_PLUGIN_NFS_TRUE
@@ -125,7 +125,7 @@ Regen from configure.ac.
+$as_echo_n "checking for sysctl kern.cp_time... " >&6; }
+if test -x /sbin/sysctl
+then
+ /sbin/sysctl kern.cp_times 2>/dev/null
+ /sbin/sysctl kern.cp_time 2>/dev/null
+ if test $? -eq 0
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5

View File

@@ -1,4 +1,4 @@
$NetBSD: patch-configure.ac,v 1.8 2015/09/17 11:24:11 he Exp $
$NetBSD: patch-configure.ac,v 1.9 2016/02/03 13:10:27 he Exp $
Add KERNEL_NETBSD, add entry and disk plugins for NetBSD,
and also do swap for "have_swapctl_three_args" (as for NetBSD).
@@ -43,7 +43,7 @@ Also, the start of process support, but that's not yet finished.
+AC_MSG_CHECKING([for sysctl kern.cp_time])
+if test -x /sbin/sysctl
+then
+ /sbin/sysctl kern.cp_times 2>/dev/null
+ /sbin/sysctl kern.cp_time 2>/dev/null
+ if test $? -eq 0
+ then
+ AC_MSG_RESULT([yes])

View File

@@ -1,6 +1,9 @@
$NetBSD: patch-src_entropy.c,v 1.4 2015/09/01 09:31:46 he Exp $
$NetBSD: patch-src_entropy.c,v 1.6 2015/12/12 22:23:32 he Exp $
Provide a NetBSD implementation for graphing available entropy.
This version tries to keep /dev/urandom open (for repeated use),
instead of constantly re-opening/closing it, since the latter will
needlessly reduce the kernel's entropy estimate.
--- src/entropy.c.orig 2015-03-10 14:14:45.000000000 +0000
+++ src/entropy.c
@@ -13,33 +16,33 @@ Provide a NetBSD implementation for graphing available entropy.
-#endif
-
-#define ENTROPY_FILE "/proc/sys/kernel/random/entropy_avail"
+static void entropy_submit (double);
+static int entropy_read (void);
-
-static void entropy_submit (double entropy)
-{
- value_t values[1];
- value_list_t vl = VALUE_LIST_INIT;
+static void entropy_submit (double);
+static int entropy_read (void);
- values[0].gauge = entropy;
+#if !KERNEL_LINUX && !KERNEL_NETBSD
+# error "No applicable input method."
+#endif
- values[0].gauge = entropy;
+#if KERNEL_LINUX
- vl.values = values;
- vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
- sstrncpy (vl.plugin, "entropy", sizeof (vl.plugin));
- sstrncpy (vl.type, "entropy", sizeof (vl.type));
-
+#if KERNEL_LINUX
- plugin_dispatch_values (&vl);
-}
+#define ENTROPY_FILE "/proc/sys/kernel/random/entropy_avail"
static int entropy_read (void)
{
@@ -74,6 +63,56 @@ static int entropy_read (void)
@@ -74,6 +63,68 @@ static int entropy_read (void)
return (0);
}
@@ -48,6 +51,12 @@ Provide a NetBSD implementation for graphing available entropy.
+#if KERNEL_NETBSD
+/* Provide a NetBSD implementation, partial from rndctl.c */
+
+/*
+ * Improved to keep the /dev/urandom open, since there's a consumption
+ * of entropy from /dev/random for every open of /dev/urandom, and this
+ * will end up opening /dev/urandom lots of times.
+ */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/param.h>
@@ -61,18 +70,24 @@ Provide a NetBSD implementation for graphing available entropy.
+entropy_read (void)
+{
+ rndpoolstat_t rs;
+ int fd;
+ static int fd;
+
+ fd = open(_PATH_URANDOM, O_RDONLY, 0644);
+ if (fd < 0)
+ return -1;
+ if (fd == 0) {
+ fd = open(_PATH_URANDOM, O_RDONLY, 0644);
+ if (fd < 0) {
+ fd = 0;
+ return -1;
+ }
+ }
+
+ if (ioctl(fd, RNDGETPOOLSTAT, &rs) < 0)
+ if (ioctl(fd, RNDGETPOOLSTAT, &rs) < 0) {
+ (void) close(fd);
+ fd = 0; /* signal a reopening on next attempt */
+ return -1;
+ }
+
+ entropy_submit (rs.curentropy);
+
+ close(fd);
+ return 0;
+}
+

View File

@@ -1,4 +1,4 @@
$NetBSD: patch-src_irq.c,v 1.1 2015/08/18 07:47:46 he Exp $
$NetBSD: patch-src_irq.c,v 1.2 2016/02/03 15:10:43 he Exp $
Provide a port to NetBSD.
@@ -36,7 +36,7 @@ Provide a port to NetBSD.
static int irq_read (void)
{
FILE *fh;
@@ -183,6 +196,63 @@ static int irq_read (void)
@@ -183,6 +196,64 @@ static int irq_read (void)
return (0);
} /* int irq_read */
@@ -60,6 +60,7 @@ Provide a port to NetBSD.
+ size_t newlen;
+ int error;
+
+ newlen = buflen;
+ if (buflen)
+ buf = malloc(buflen);
+ error = sysctl(mib, __arraycount(mib),
@@ -93,7 +94,7 @@ Provide a port to NetBSD.
+ buflen -= evs->ev_len;
+ evs =(const void*)((const uint64_t *)evs + evs->ev_len);
+ }
+
+ free(buf);
+ return 0;
+}
+#endif /* KERNEL_NETBSD */