initrandom revision 256381
1291716Sken#!/bin/sh 2291716Sken# 3291716Sken# $FreeBSD: stable/10/etc/rc.d/initrandom 256381 2013-10-12 15:31:36Z markm $ 4291716Sken# 5291716Sken 6291716Sken# PROVIDE: initrandom 7291716Sken# REQUIRE: dumpon ddb 8291716Sken# BEFORE: disks 9291716Sken# KEYWORD: nojail 10291716Sken 11291716Sken. /etc/rc.subr 12 13name="initrandom" 14start_cmd="initrandom_start" 15stop_cmd=":" 16 17initrandom_start() 18{ 19 soft_random_generator=`sysctl kern.random 2>/dev/null` 20 21 echo -n 'Entropy harvesting:' 22 23 if [ \! -z "${soft_random_generator}" ] ; then 24 25 if [ -w /dev/random ]; then 26 if checkyesno harvest_interrupt; then 27 ${SYSCTL} kern.random.sys.harvest.interrupt=1 >/dev/null 28 echo -n ' interrupts' 29 else 30 ${SYSCTL} kern.random.sys.harvest.interrupt=0 >/dev/null 31 fi 32 33 if checkyesno harvest_ethernet; then 34 ${SYSCTL} kern.random.sys.harvest.ethernet=1 >/dev/null 35 echo -n ' ethernet' 36 else 37 ${SYSCTL} kern.random.sys.harvest.ethernet=0 >/dev/null 38 fi 39 40 if checkyesno harvest_p_to_p; then 41 ${SYSCTL} kern.random.sys.harvest.point_to_point=1 >/dev/null 42 echo -n ' point_to_point' 43 else 44 ${SYSCTL} kern.random.sys.harvest.point_to_point=0 >/dev/null 45 fi 46 47 if checkyesno harvest_swi; then 48 ${SYSCTL} kern.random.sys.harvest.swi=1 >/dev/null 49 echo -n ' swi' 50 else 51 ${SYSCTL} kern.random.sys.harvest.swi=0 >/dev/null 52 fi 53 fi 54 55 fi 56 57 echo '.' 58} 59 60load_rc_config random 61run_rc_command "$1" 62