From 155ae15390deaac883ab906b11d88e1cbf242adf Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 22 Jun 2015 12:17:31 +0200 Subject: [PATCH] Refactor: Move random seed config to configure script. Signed-off-by: Joachim Nilsson --- configure | 32 +++++++++++++++++++++++--------- finit.h | 1 - 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/configure b/configure index a897685e..d3907703 100755 --- a/configure +++ b/configure @@ -43,9 +43,7 @@ result() echo echo "Finit configuration" echo "========================================================================" -if [ x"$heading" != x"" ]; then echo "Heading : $heading" -fi echo "Install prefix : $prefix" echo "System config dir : $sysconfdir" echo "Super user bindir : $sbindir" @@ -61,27 +59,37 @@ fi if [ $debug -ne 0 ]; then echo "Debug : ENABLED" fi + if [ $embedded -ne 0 ]; then echo "Embedded target : YES (BusyBox getty, and mdev instead of udev)" fi + + if [ x"$random" != x"" ]; then + echo "Random seed : $random" + fi + if [ $inetd -ne 0 ]; then echo "Inetd : Built-in" else echo "Inetd : DISABLED" fi + if [ $verbose -ne 1 ]; then echo "Quiet Finit : YES" else echo "Quiet Finit : NO, verbose output (default)" fi + if [ $kernel_quiet -eq 1 ]; then echo "Kernel Quiet : YES, silent after inital boot (default)" else echo "Kernel Quiet : NO" fi + if [ $static -ne 0 ]; then echo "Static Finit : YES" fi + if [ $disable_plugins -eq 1 ]; then echo "Plugins : DISABLED" else @@ -111,6 +119,9 @@ usage() echo " --with-fifo=FIFO FIFO for initctl plugin, default '$fifo'" echo " --with-config=CONFIG Finit CONFIG file, default '\$sysconfdir/$conf'" echo " --with-heading=GREET Display GREET instead of Finit version at boot" + echo " --with-randomseed=SEED Seed /dev/urandom from file SEED. On Debian/Ubuntu" + echo " systems, set this to /var/lib/urandom/random-seed" + echo " Default: none" echo " --with-plugins=\"a b c\" Build plugins 'a', 'b' and 'c', either as dynamic .so" echo " files, or as built-in if --enable-static is given," echo " defaults to all plugins. Exclude extension!" @@ -180,6 +191,10 @@ while [ "$*" != "" ]; do heading="\"$arg\"" ;; + with-randomseed) + random="$arg" + ;; + with-plugins) plugins="$arg" ;; @@ -296,6 +311,9 @@ echo "export libdir plugindir incdir CPPFLAGS LDFLAGS LDLIBS STATIC" >> config.m ############################################################################## echo "/* Generated by finit configure script. */" > config.h +echo "#define INIT_HEADING $heading" >> config.h +echo "#define VERBOSE_MODE $verbose" >> config.h +echo "#define KERNEL_QUIET $kernel_quiet" >> config.h if [ $embedded -eq 1 ]; then echo "#define EMBEDDED_SYSTEM" >> config.h fi @@ -303,17 +321,13 @@ fi if [ $inetd -eq 0 ]; then echo "#define INETD_DISABLED" >> config.h fi - -if [ x"$heading" != x"" ]; then - echo "#define INIT_HEADING $heading" >> config.h -fi - -echo "#define VERBOSE_MODE $verbose" >> config.h -echo "#define KERNEL_QUIET $kernel_quiet" >> config.h echo "#define FINIT_FIFO \"$fifo\"" >> config.h echo "#define FINIT_CONF \"$config\"" >> config.h echo "#define FINIT_RCSD \"$rcsd\"" >> config.h echo "#define PLUGIN_PATH \"$plugindir\"" >> config.h +if [ x"$random" != x"" ]; then + echo "#define RANDOMSEED \"$random\"" >> config.h +fi echo "#define DEFUSER \"$defuser\"" >> config.h echo "#define DEFHOST \"$defhost\"" >> config.h echo "#define RUNLEVEL $runlevel" >> config.h diff --git a/finit.h b/finit.h index dd04a4fc..4831a164 100644 --- a/finit.h +++ b/finit.h @@ -49,7 +49,6 @@ # define GETTY "/sbin/getty -8" # define GETTY_AGETTY /* Tell tty.c about the getty argument order */ # define BAUDRATE 38400 -# define RANDOMSEED "/var/lib/urandom/random-seed" # define REMOUNT_ROOTFS_RW # define HAVE_DBUS #endif