From 4bb1c55f3390bbcb0e11b4ab44299ae06d89b888 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 11 May 2015 16:58:20 +0200 Subject: Find out size of the saved random-seed via /proc/sys/kernel/random/poolsize. This is what the random(4) manual page recommends, and hopefully should improve entropy reading from /dev/{u,}random. --- 3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '3') diff --git a/3 b/3 index 13c96b1..42d6c22 100755 --- a/3 +++ b/3 @@ -19,7 +19,7 @@ sv exit /var/service/* [ -x /etc/rc.shutdown ] && /etc/rc.shutdown msg "Saving random seed..." -( umask 077; dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 >/dev/null 2>&1 ) +( umask 077; bytes=$(cat /proc/sys/kernel/random/poolsize) || bytes=512; dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=$bytes >/dev/null 2>&1 ) if [ -z "$VIRTUALIZATION" -a -n "$HARDWARECLOCK" ]; then hwclock --systohc ${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z)} -- cgit 1.4.1