From a8efd663ed7482a435ebd5518d4415829bba2a14 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Mon, 10 Jul 2023 12:01:37 +0200 Subject: [PATCH] rng-tools: increase initialization robustness together with jitterentropy-3.4.1 With jitterentropy 3.4.1 the initial timeout of rng-tools for the initialization of jitterentropy seems to be too small in some cases. Set a larger timeout for tests. Add comment how this timeout can be set by users needing it. Signed-off-by: Markus Theil --- pkgs/tools/security/rng-tools/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/rng-tools/default.nix b/pkgs/tools/security/rng-tools/default.nix index 92774bd716b8..a5470f05613b 100644 --- a/pkgs/tools/security/rng-tools/default.nix +++ b/pkgs/tools/security/rng-tools/default.nix @@ -55,7 +55,17 @@ stdenv.mkDerivation rec { ]; doCheck = true; - preCheck = "patchShebangs tests/*.sh"; + preCheck = '' + patchShebangs tests/*.sh + export RNGD_JITTER_TIMEOUT=10 + ''; + # After updating to jitterentropy 3.4.1 jitterentropy initialization seams + # to have increased. On some system rng-tools fail therefore to initialize the + # jitterentropy entropy source. You can increase the init timeout with a command-line + # option (-O jitter:timeout:SECONDS). The environment variable above only has effect + # for the test cases. + # Patching the timeout to a larger value was declined upstream, + # see (https://github.com/nhorman/rng-tools/pull/178). nativeCheckInputs = [ psmisc ]; # rngtestjitter.sh needs killall doInstallCheck = true;