summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-31 18:38:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-31 18:38:43 +0000
commit9a8a3d0d9af60eeebe64260e9f0bf12494f65c91 (patch)
treea4addc59f3e48d22446cb7be8f832ec3f7bde633 /distrib/miniroot
parent56a9092e1314d2e35e0a15144c5959d90769c01c (diff)
push the dmesg and $SERVERLIST into the random pool to enhance the
entropy, before we pull out the host.random for the next boot
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 6b6984045b5..f7a28c63d05 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sh,v 1.196 2009/05/31 00:03:29 deraadt Exp $
+# $OpenBSD: install.sh,v 1.197 2009/05/31 18:38:42 deraadt Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -250,10 +250,14 @@ for _f in fstab hostname* kbdtype my* ttys *.conf *.tail; do
[[ -f $_f && -s $_f ]] && mv $_f /mnt/etc/.
done )
+# Feed the random pool some junk before we read from it
+dmesg >/dev/urandom
+cat $SERVERLIST >/dev/urandom 2>/dev/null
+
echo -n "done.\nGenerating initial host.random file..."
-( cd /mnt/var/db
-/mnt/bin/dd if=/mnt/dev/urandom of=host.random bs=1024 count=64 >/dev/null 2>&1
-chmod 600 host.random >/dev/null 2>&1 )
+/mnt/bin/dd if=/mnt/dev/urandom of=/mnt/var/db/host.random \
+ bs=1024 count=64 >/dev/null 2>&1
+chmod 600 /mnt/var/db/host.random >/dev/null 2>&1
echo "done."
apply