Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b478d39559cbb201cd23f4dfed74c54a27048082

commit b478d39559cbb201cd23f4dfed74c54a27048082
Author: DeX77 <[email protected]>
Date:   Fri Dec 23 20:39:08 2016 +0100

rng-tools-5-1-x86_64

* new package

diff --git a/source/base-extra/rng-tools/FrugalBuild 
b/source/base-extra/rng-tools/FrugalBuild
new file mode 100644
index 0000000..f7c369f
--- /dev/null
+++ b/source/base-extra/rng-tools/FrugalBuild
@@ -0,0 +1,32 @@
+# Compiling Time: 1.0 SBU
+# Maintainer: DeX77 <[email protected]>
+
+pkgname=rng-tools
+pkgver=5
+pkgrel=1
+pkgdesc="Random number generator related utilities"
+archs=('x86_64')
+groups=('base-extra')
+depends=('libgcrypt')
+backup=(etc/conf.d/rngd)
+_F_sourceforge_dirname="gkernel"
+Finclude sourceforge
+source=("${source[@]}"
+        rngd.conf
+        rngd.service
+        rngd-test-signal-in-loop.patch)
+
+sha1sums=('3092768ac45315a5dcc0170d05566d1d00dbad96' \
+          '3843ed109db98f26bc236e66914ad69404897e7c' \
+          'ffd3429786eaef25cf68141946494594e673da31' \
+          '7d718375644fc2167ced6b89391a95d44cf726ce')
+
+
+build() {
+       Fbuild
+
+       Finstall 0644 lib/systemd/system/rngd.service
+       Finstall 0644 rngd.conf etc/conf.d/rngd
+}
+
+# optimization OK
diff --git a/source/base-extra/rng-tools/rngd-test-signal-in-loop.patch 
b/source/base-extra/rng-tools/rngd-test-signal-in-loop.patch
new file mode 100644
index 0000000..a26ee64
--- /dev/null
+++ b/source/base-extra/rng-tools/rngd-test-signal-in-loop.patch
@@ -0,0 +1,36 @@
+From: Leonardo Chiquitto <[email protected]>
+Subject: Check for signals in update_kernel_random()
+
+When running as a daemon, a signal handler is installed to catch
+SIGINT/SIGTERM. This handler sets a flag that's tested in the main
+loop. However, rngd loops in update_kernel_random() as well, where
+the flag was not tested.
+
+This patch adds the check to update_kernel_random() so that the
+daemon exits properly after receiving a SIGINT/SIGTERM signal.
+
+Index: rng-tools-5/rngd.c
+===================================================================
+--- rng-tools-5.orig/rngd.c
++++ rng-tools-5/rngd.c
+@@ -218,6 +218,8 @@ static int update_kernel_random(int rand
+
+       for (p = buf; p + random_step <= &buf[FIPS_RNG_BUFFER_SIZE];
+                p += random_step) {
++              if (!server_running)
++                      return 0;
+               random_add_entropy(p, random_step);
+               random_sleep();
+       }
+@@ -239,10 +241,10 @@ static void do_loop(int random_step)
+               {
+                       int rc;
+
++              retry_same:
+                       if (!server_running)
+                               return;
+
+-              retry_same:
+                       if (iter->disabled)
+                               continue;       /* failed, no work */
+
diff --git a/source/base-extra/rng-tools/rngd.conf 
b/source/base-extra/rng-tools/rngd.conf
new file mode 100644
index 0000000..3429fcc
--- /dev/null
+++ b/source/base-extra/rng-tools/rngd.conf
@@ -0,0 +1 @@
+RNGD_OPTS=""
diff --git a/source/base-extra/rng-tools/rngd.service 
b/source/base-extra/rng-tools/rngd.service
new file mode 100644
index 0000000..87185bc
--- /dev/null
+++ b/source/base-extra/rng-tools/rngd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+EnvironmentFile=/etc/conf.d/rngd
+ExecStart=/usr/sbin/rngd -f $RNGD_OPTS
+
+[Install]
+WantedBy=multi-user.target
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to