entropy_start()
{
case ${entropy-} in
'') ;;
check) echo -n "Checking for entropy..."
# dd will print an error message `Resource temporarily
# unavailable' to stderr, which is a little annoying,
# but getting rid of it is also a little annoying.
if dd if=/dev/random iflag=nonblock of=/dev/null bs=1 count=1 \
msgfmt=quiet; then
echo "done"
else
echo "not enough entropy available, aborting boot."
stop_boot
fi
;;
wait) echo -n "Waiting for entropy..."
dd if=/dev/random of=/dev/null bs=1 count=1 msgfmt=quiet
echo "done"
;;
esac
}