From de328d4a59efe8be362e9eb77b259dc23ebc6d03 Mon Sep 17 00:00:00 2001 From: Doug Barton Date: Sat, 10 Mar 2001 05:33:38 +0000 Subject: [PATCH] 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. --- etc/defaults/rc.conf | 4 +-- etc/rc | 58 ++++++++------------------------------------ 2 files changed, 12 insertions(+), 50 deletions(-) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 47789db4fc6..816b3762179 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.* ## diff --git a/etc/rc b/etc/rc index 630e226eb44..da4d524b3a2 100644 --- a/etc/rc +++ b/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