[arch-projects] [PATCH initscripts 2/4] init/shutdown: use {load, store}_random_seed()

Matthew Monaco dgbaley27 at 0x01b.net
Tue Mar 13 21:27:49 EDT 2012


From: Matthew Monaco <matthew.monaco at 0x01b.net>

---
 rc.shutdown |   13 +------------
 rc.sysinit  |    5 +----
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/rc.shutdown b/rc.shutdown
index 54a1e9a..433a945 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -19,18 +19,7 @@ run_hook shutdown_start
 
 stop_all_daemons
 
-stat_busy "Saving Random Seed"
-	RANDOM_SEED=/var/lib/misc/random-seed
-	install -TDm 0600 /dev/null $RANDOM_SEED
-	POOL_FILE=/proc/sys/kernel/random/poolsize
-	if [[ -r $POOL_FILE ]]; then
-		read POOL_SIZE < $POOL_FILE
-		(( POOL_SIZE /= 8 ))
-	else
-		POOL_SIZE=512
-	fi
-	dd if=/dev/urandom of=$RANDOM_SEED count=1 bs=$POOL_SIZE &>/dev/null
-stat_done
+status "Saving Random Seed" store_random_seed
 
 [[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
 
diff --git a/rc.sysinit b/rc.sysinit
index 9880995..d3cda23 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -215,10 +215,7 @@ status "Activating Swap" swapon -a
 
 [[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
 
-RANDOM_SEED=/var/lib/misc/random-seed
-[[ -f $RANDOM_SEED ]] &&
-	status "Initializing Random Seed" \
-		cp $RANDOM_SEED /dev/urandom
+status "Initializing Random Seed" load_random_seed
 
 # Remove leftover files
 remove_leftover
-- 
1.7.9.4



More information about the arch-projects mailing list