diff options
author | dougb <dougb@FreeBSD.org> | 2001-03-10 05:33:38 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2001-03-10 05:33:38 +0000 |
commit | 020bef59da8839ee7ebc63d2d223e8bc8d368697 (patch) | |
tree | 7a2f69ea46812f6c26eb1209a61eca4e792182f0 | |
parent | a7f5447c8fb21beccf5d594da6abc1a07e38bfc8 (diff) | |
download | FreeBSD-src-020bef59da8839ee7ebc63d2d223e8bc8d368697.zip FreeBSD-src-020bef59da8839ee7ebc63d2d223e8bc8d368697.tar.gz |
Avoid complicated tests of whether devices are present or not, and
enable all harvesting options by default since having them on for
devices not present doesn't hurt anything. Leave them on by default
since for the most part they are not producing noticable slowdown,
and are about to get a lot more efficient.
Re-order part of the cheesy entropy process in preparation for
its complete removal.
-rw-r--r-- | etc/defaults/rc.conf | 4 | ||||
-rw-r--r-- | etc/rc | 58 |
2 files changed, 12 insertions, 50 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 47789db..816b376 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -333,8 +333,8 @@ entropy_dir="/var/db/entropy" # Set to NO to disable caching entropy via cron. entropy_save_sz="2048" # Size of the entropy cache files. entropy_save_num="8" # Number of entropy cache files to save. harvest_interrupt="YES" # Entropy device harvests interrupt randomness -harvest_ethernet="" # Entropy device harvests ethernet randomness -harvest_p_to_p="" # Entropy device harvests point-to-point randomness +harvest_ethernet="YES" # Entropy device harvests ethernet randomness +harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## @@ -123,34 +123,11 @@ case ${harvest_interrupt} in ;; esac -# Steal some code from rc.network to help determine what to enable. -case ${network_interfaces} in -[Aa][Uu][Tt][Oo]) - h_network_interfaces="`ifconfig -l`" - ;; -*) - h_network_interfaces="${network_interfaces}" - ;; -esac - case ${harvest_ethernet} in [Nn][Oo]) ;; *) - do_ether_harvest='' - - for h_ifn in ${h_network_interfaces}; do - eval h_ifconfig_args=\$ifconfig_${h_ifn} - case ${h_ifconfig_args} in - '') - ;; - *) - do_ether_harvest=1 - ;; - esac - done - - if [ -w /dev/random -a "${do_ether_harvest}" ]; then + if [ -w /dev/random ]; then /sbin/sysctl -w kern.random.sys.harvest_ethernet=1 >/dev/null echo -n ' ethernet' fi @@ -161,22 +138,7 @@ case ${harvest_p_to_p} in [Nn][Oo]) ;; *) - do_p_to_p_harvest='' - - # Other than user ppp, tun* will already exist - case "${h_network_interfaces}" in - *tun0*) - do_p_to_p_harvest=1 - ;; - esac - - case ${ppp_enable} in - [Yy][Ee][Ss]) - do_p_to_p_harvest=1 - ;; - esac - - if [ -w /dev/random -a "${do_p_to_p_harvest}" ]; then + if [ -w /dev/random ]; then /sbin/sysctl -w kern.random.sys.harvest_point_to_point=1 >/dev/null echo -n ' point_to_point' fi @@ -187,14 +149,6 @@ echo '.' # First pass at reseeding /dev/random. # -# XXX temporary until we can get the entropy -# harvesting rate up -# Entropy below is not great, -# but better than nothing. -( ps -efauxww; sysctl -a; date; df -ib; dmesg; ps -efauxww; ) \ - | dd of=/dev/random bs=8k 2>/dev/null -cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null - case ${entropy_file} in [Nn][Oo] | '') ;; @@ -205,6 +159,14 @@ case ${entropy_file} in ;; esac +# XXX temporary until we can get the entropy +# harvesting rate up +# Entropy below is not great, +# but better than nothing. +( ps -efauxww; sysctl -a; date; df -ib; dmesg; ps -efauxww; ) \ + | dd of=/dev/random bs=8k 2>/dev/null +cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null + # Configure ccd devices. # if [ -r /etc/ccd.conf ]; then |