aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrc.shutdown11
-rwxr-xr-xrc.sysinit5
2 files changed, 13 insertions, 3 deletions
diff --git a/rc.shutdown b/rc.shutdown
index 74347c9..7f79c88 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -51,7 +51,16 @@ stat_busy "Sending SIGKILL To Processes"
stat_done
stat_busy "Saving Random Seed"
-/bin/dd if=/dev/urandom of=/var/run/random-seed count=1 bs=512 2> /dev/null
+RANDOM_SEED=/var/lib/misc/random-seed
+: > $RANDOM_SEED
+/bin/chmod 0600 $RANDOM_SEED
+POOL_FILE=/proc/sys/kernel/random/poolsize
+if [ -r $POOL_FILE ]; then
+ POOL_SIZE=$(/bin/cat $POOL_FILE)
+else
+ POOL_SIZE=512
+fi
+/bin/dd if=/dev/urandom of=$RANDOM_SEED count=1 bs=$POOL_SIZE &> /dev/null
stat_done
stat_busy "Saving System Clock"
diff --git a/rc.sysinit b/rc.sysinit
index 7f22e88..d4d3249 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -320,9 +320,10 @@ fi
/sbin/hwclock $HWCLOCK_PARAMS
stat_done
-if [ -f /var/run/random-seed ]; then
+RANDOM_SEED=/var/lib/misc/random-seed
+if [ -f $RANDOM_SEED ]; then
stat_busy "Initializing Random Seed"
- /bin/cat /var/run/random-seed >/dev/urandom
+ /bin/cat $RANDOM_SEED > /dev/urandom
stat_done
fi