7 # REQUIRE: initdiskless
14 start_cmd="initrandom_start"
19 if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then
20 cat "${1}" | dd of=/dev/random bs=8k 2>/dev/null
26 soft_random_generator=`sysctl kern.random 2>/dev/null`
28 echo -n 'Entropy harvesting:'
30 if [ \! -z "${soft_random_generator}" ] ; then
32 if checkyesno harvest_interrupt; then
33 if [ -w /dev/random ]; then
34 ${SYSCTL_W} kern.random.sys.harvest.interrupt=1 >/dev/null
39 if checkyesno harvest_ethernet; then
40 if [ -w /dev/random ]; then
41 ${SYSCTL_W} kern.random.sys.harvest.ethernet=1 >/dev/null
46 if checkyesno harvest_p_to_p; then
47 if [ -w /dev/random ]; then
48 ${SYSCTL_W} kern.random.sys.harvest.point_to_point=1 >/dev/null
49 echo -n ' point_to_point'
53 # XXX temporary until we can improve the entropy
55 # Entropy below is not great, but better than nothing.
56 # This unblocks the generator at startup
57 ( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww; ) \
58 | dd of=/dev/random bs=8k 2>/dev/null
59 cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null
61 # First pass at reseeding /dev/random.
63 case ${entropy_file} in
67 if [ -w /dev/random ]; then
68 feed_dev_random "${entropy_file}"