3 # $FreeBSD: src/etc/rc.d/initrandom,v 1.1 2002/06/13 22:14:36 gordon Exp $
4 # $DragonFly: src/etc/rc.d/initrandom,v 1.6 2006/07/10 22:19:14 dillon Exp $
8 # REQUIRE: initdiskless
14 start_cmd
="initrandom_start"
19 if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then
20 sysctl kern.seedenable
=1
21 cat "${1}" |
dd of
=/dev
/random bs
=8k
2>/dev
/null
22 sysctl kern.seedenable
=0
30 # First pass at reseeding /dev/random.
32 case ${entropy_file} in
36 if [ -w /dev
/random
]; then
37 feed_dev_random
"${entropy_file}"
42 # Mix in more junk. At the very least this will make seeding a
43 # bit more machine specific. The sysctl -a will also catch the
44 # TSC, 8254, and a few other things that tend to be somewhat more
45 # random (even from a CD boot) so it isn't all that bad.
47 sysctl kern.seedenable
=1
48 ( ps
-fauxww; sysctl
-a; date; df
-ib; dmesg
; ps
-fauxww; ) \
49 2>&1 |
dd of
=/dev
/random bs
=8k
2>/dev
/null
50 cat /bin
/ls |
dd of
=/dev
/random bs
=8k
2>/dev
/null
51 sysctl kern.seedenable
=0