From f191266a330bfc89c9322736c92a9b82dbef14d8 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 21 Jul 2016 00:41:23 +0200 Subject: [PATCH] Add --with-random-seed to enable urandom plugin By default the urandom plugin will use /var/lib/misc/random-seed across reboots to seed /dev/urandom at boot. Signed-off-by: Joachim Nilsson --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index c9dc299b..d9fd8bf6 100644 --- a/configure.ac +++ b/configure.ac @@ -111,6 +111,11 @@ AC_ARG_WITH(runlevel, AS_HELP_STRING([--with-runlevel=N], [Runlevel to switch to after bootstrap, default: 2]), [runlevel=$withval], [runlevel=2]) +AC_ARG_WITH(random-seed, + AS_HELP_STRING([--with-random-seed=FILE], [Save a random seed for /dev/urandom across reboots, default /var/lib/misc/random-seed]), + [random_seed=$withval], [random_seed=/var/lib/misc/random-seed]) + + ### Enable features ########################################################################### # Create config.h from selected features and fallback defautls @@ -198,6 +203,12 @@ AS_IF([test "x$with_runlevel" != "xno"],[ AC_DEFINE_UNQUOTED(RUNLEVEL, 2, [Default runlevel to start after S])]) AC_DEFINE_UNQUOTED(RUNLEVEL, $runlevel, [Runlevel to start after S])]) +AS_IF([test "x$with_random_seed" != "xno"],[ + AS_IF([test "x$random_seed" = "xyes"],[ + random_seed=/var/lib/misc/random-seed]) + AC_EXPAND_DIR(lurvig, "$random_seed") + AC_DEFINE_UNQUOTED(RANDOMSEED, "$lurvig", [Improve random at boot by seeding it with sth from before.])]) + # Control build with automake flags AM_CONDITIONAL(STATIC, [test "x$enable_static" = "xyes"]) AM_CONDITIONAL(INETD, [test "x$enable_inetd" = "xyes"])