head	1.6;
access;
symbols
	RELENG_5_5_0_RELEASE:1.4.2.1
	RELENG_5_5:1.4.2.1.0.6
	RELENG_5_5_BP:1.4.2.1
	RELENG_5_4_0_RELEASE:1.4.2.1
	RELENG_5_4:1.4.2.1.0.4
	RELENG_5_4_BP:1.4.2.1
	RELENG_5_3_0_RELEASE:1.4.2.1
	RELENG_5_3:1.4.2.1.0.2
	RELENG_5_3_BP:1.4.2.1
	RELENG_5:1.4.0.2
	RELENG_5_BP:1.4;
locks; strict;
comment	@# @;


1.6
date	2005.04.29.23.02.56;	author brooks;	state dead;
branches;
next	1.5;

1.5
date	2004.10.07.13.55.26;	author mtm;	state Exp;
branches;
next	1.4;

1.4
date	2004.06.08.19.53.25;	author obrien;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2004.06.07.09.16.19;	author obrien;	state Exp;
branches;
next	1.2;

1.2
date	2004.04.15.18.23.14;	author brooks;	state Exp;
branches;
next	1.1;

1.1
date	2004.04.15.17.52.53;	author brooks;	state Exp;
branches;
next	;

1.4.2.1
date	2004.10.10.09.50.54;	author mtm;	state Exp;
branches;
next	;


desc
@@


1.6
log
@To allow /etc to be as minimal as possible in a diskless setup, we need
to run initdiskless before we run rcorder on /etc/rc.d.  To allow this,
move /etc/rc.d/initdiskless to /etc/rc.initdiskless and run it directly
from /etc/rc.

Remove /etc/rc.d/preseedrandom as it is no longer necessicary (we start
with entropy unblocked) and was only used by initdiskless when it
was needed.

Discussed on:	freebsd-rc
Repocopy by:	peter
@
text
@#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/preseedrandom,v 1.5 2004/10/07 13:55:26 mtm Exp $
#

# PROVIDE: preseedrandom
# KEYWORD: nojail

feed_dev_random()
{
	if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then
		cat "${1}" | dd of=/dev/random bs=8k 2>/dev/null
	fi
}

soft_random_generator=`sysctl kern.random 2>/dev/null`

if [ -n "${soft_random_generator}" ] ; then

	echo -n 'Pre-seeding PRNG:'

	# XXX temporary until we can improve the entropy
	# harvesting rate.
	# Entropy below is not great, but better than nothing.
	# This unblocks the generator at startup
	( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww; ) \
	    | dd of=/dev/random bs=8k 2>/dev/null
	cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null

	# First pass at reseeding /dev/random.
	#
	if [ -w /dev/random ]; then
		feed_dev_random "/entropy"
	fi

	echo -n ' kickstart'

	echo '.'
fi
@


1.5
log
@Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
@
text
@d3 1
a3 1
# $FreeBSD$
@


1.4
log
@Back out rev 1.3.
This is one of the few RC scripts that doesn't use rc.subr, and thus
doesn't source rc.conf. :-(
@
text
@d7 1
a7 1
# KEYWORD: FreeBSD nojail
@


1.4.2.1
log
@RCS file: /home/ncvs/src/etc/rc,v
----------------------------
revision 1.335
date: 2004/10/08 14:23:49;  author: mtm;  state: Exp;  lines: +0 -1
Remove an unused variable.

Submitted by: Pawel Worach <pawel.worach@@telia.com>
----------------------------
revision 1.334
date: 2004/10/07 13:55:25;  author: mtm;  state: Exp;  lines: +1 -1
Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/nsswitch,v
----------------------------
revision 1.4
date: 2004/09/16 17:03:12;  author: keramida;  state: Exp;  lines: +1 -1
Fix requirement of `network' to `NETWORK' because the former isn't
provided by any rc.d script.

Approved by:	mtm
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/pflog,v
----------------------------
revision 1.3
date: 2004/09/16 17:04:20;  author: keramida;  state: Exp;  lines: +1 -1
We don't have any providers of `beforenetlkm' in FreeBSD.  Remove the
dependency to it from our rc.d scripts.

Approved by:	mtm
=============================================================================

Approved by: re/scottl
@
text
@d7 1
a7 1
# KEYWORD: nojail
@


1.3
log
@Don't assume everyone's /etc/[default/]rc.conf 'entropy_file' is "/entropy".
@
text
@d33 1
a33 1
		feed_dev_random ${entropy_file}
@


1.2
log
@Remove bogus checks on the value of ${entropy_file} and hardcode out
entropy source to /entropy.  We have to assume there is no rc.conf at
this stage of the boot process.

Reported by:	njl
@
text
@d33 1
a33 1
		feed_dev_random "/entropy"
@


1.1
log
@Band-aid diskless booting by running a new preseedrandom script before
initdiskless.  The output of several commands and if available the
contents of /entropy are feed into /dev/random to kickstart the PRNG.
/etc/rc.d/initrandom is left alone to maintain the previous behavior as
much as possiable.

Further work in this area is probably needed.

Discussed with:	markm
@
text
@a15 2
entropy_file="/entropy"

d32 3
a34 9
	case ${entropy_file} in
	[Nn][Oo] | '')
		;;
	*)
		if [ -w /dev/random ]; then
			feed_dev_random "${entropy_file}"
		fi
		;;
	esac
@

