diff options
Diffstat (limited to 'sys-apps/rng-tools/files/rngd-initd-4')
-rw-r--r-- | sys-apps/rng-tools/files/rngd-initd-4 | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/sys-apps/rng-tools/files/rngd-initd-4 b/sys-apps/rng-tools/files/rngd-initd-4 deleted file mode 100644 index ced1a2f743fc..000000000000 --- a/sys-apps/rng-tools/files/rngd-initd-4 +++ /dev/null @@ -1,60 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/files/rngd-initd-4,v 1.2 2013/05/22 05:16:17 vapier Exp $ - -depend() { - need localmount - after urandom -} - -BINARY=/usr/sbin/rngd -# Do NOT add /dev/tpm to this. -DEFAULT_DEVICE="/dev/hw_random* /dev/hwrandom* /dev/i810_rng /dev/hwrng*" -DEFAULT_TPM_DEVICE="/dev/tpm*" -[ $DO_NOT_REMIX_URANDOM -eq 0 ] && DEFAULT_DEVICE="${DEFAULT_DEVICE} /dev/urandom" - -find_device() { - # The echo is to cause globbing - local d - for d in $* ; do - [ -e "${d}" ] && break - done - echo "${d:-/dev/null}" -} - -find_rng_device() { - echo "$(find_device $(echo ${DEVICE:-${DEFAULT_DEVICE}}))" -} - -find_tpm_device() { - echo "$(find_device $(echo ${TPM_DEVICE:-${DEFAULT_TPM_DEVICE}}))" -} - -start() { - local d t - d="$(find_rng_device)" - [ "${NO_TPM}" = "1" ] || t="$(find_tpm_device)" - - if [ "${d}" = "/dev/null" -a "${t}" = "/dev/null" ] ; then - eerror "No hardware RNG or feedback source available." - return 1 - fi - - # TODO: find a better way to handle multiple feedback devices. - # Notice that we only warn if TPM is not available. - if [ "${d}" = "/dev/urandom" -a "${t}" = "/dev/null" ] ; then - ewarn "No hardware RNG found, using ${d} as feedback input" - fi - - ebegin "Starting hardware RNG daemon" - start-stop-daemon --start --quiet --exec ${BINARY} -- \ - -b -s ${STEP:-64} --no-tpm=${NO_TPM:-0} -W ${WATERMARK:-2048} -r ${d} - eend $? -} - -stop() { - ebegin "Stopping hardware RNG daemon" - start-stop-daemon --stop --quiet --exec ${BINARY} - eend $? -} |