diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-11-11 06:24:22 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-11-11 06:24:22 +0000 |
commit | 5d45a2a69ecdc3bb6f101d46f751ba6f38721d45 (patch) | |
tree | 8dc7dbfd02a8ae11aa23f5c9549b9374b145aa85 /sys-apps/rng-tools | |
parent | Remove old. (diff) | |
download | gentoo-2-5d45a2a69ecdc3bb6f101d46f751ba6f38721d45.tar.gz gentoo-2-5d45a2a69ecdc3bb6f101d46f751ba6f38721d45.tar.bz2 gentoo-2-5d45a2a69ecdc3bb6f101d46f751ba6f38721d45.zip |
Update init.d script to match latest version #442036 by Manuel Rüger.
(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
Diffstat (limited to 'sys-apps/rng-tools')
-rw-r--r-- | sys-apps/rng-tools/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/rngd-confd-4 | 24 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/rngd-initd-4 | 60 | ||||
-rw-r--r-- | sys-apps/rng-tools/rng-tools-4-r1.ebuild (renamed from sys-apps/rng-tools/rng-tools-4.ebuild) | 11 |
4 files changed, 98 insertions, 5 deletions
diff --git a/sys-apps/rng-tools/ChangeLog b/sys-apps/rng-tools/ChangeLog index 04c8c6c32d75..3561af23a613 100644 --- a/sys-apps/rng-tools/ChangeLog +++ b/sys-apps/rng-tools/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/rng-tools # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/ChangeLog,v 1.32 2012/11/06 05:05:36 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/ChangeLog,v 1.33 2012/11/11 06:24:22 vapier Exp $ + +*rng-tools-4-r1 (11 Nov 2012) + + 11 Nov 2012; Mike Frysinger <vapier@gentoo.org> +files/rngd-confd-4, + +files/rngd-initd-4, +rng-tools-4-r1.ebuild, -rng-tools-4.ebuild: + Update init.d script to match latest version #442036 by Manuel Rüger. *rng-tools-4 (06 Nov 2012) diff --git a/sys-apps/rng-tools/files/rngd-confd-4 b/sys-apps/rng-tools/files/rngd-confd-4 new file mode 100644 index 000000000000..182bc6095a75 --- /dev/null +++ b/sys-apps/rng-tools/files/rngd-confd-4 @@ -0,0 +1,24 @@ +# /etc/conf.d/rngd + +# Please see "/usr/sbin/rngd --help" and "man rngd" for more information + +# If a single device is preferred, then specify it here, otherwise we will +# search for suitable devices. TPM is specified via a later option, not this +# one. +#DEVICE= +#TPM_DEVICE= + +# Random step (Number of bytes written to random-device at a time): +STEP=64 + +# Should TPM be avoided? +NO_TPM=0 + +# Fill watermark +# 0 <= n <= 4096 +WATERMARK=2048 + +# Bug #292239: Remixing /dev/urandom back into /dev/random is considered a +# security vulnerability in some cases where not enough entropy is present on +# systems. +DO_NOT_REMIX_URANDOM=0 diff --git a/sys-apps/rng-tools/files/rngd-initd-4 b/sys-apps/rng-tools/files/rngd-initd-4 new file mode 100644 index 000000000000..f8fd95e91cf3 --- /dev/null +++ b/sys-apps/rng-tools/files/rngd-initd-4 @@ -0,0 +1,60 @@ +#!/sbin/runscript +# Copyright 1999-2012 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.1 2012/11/11 06:24:22 vapier Exp $ + +depend() { + need localmount + after random +} + +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 $? +} diff --git a/sys-apps/rng-tools/rng-tools-4.ebuild b/sys-apps/rng-tools/rng-tools-4-r1.ebuild index d31c803a9082..7315c4d4cdb5 100644 --- a/sys-apps/rng-tools/rng-tools-4.ebuild +++ b/sys-apps/rng-tools/rng-tools-4-r1.ebuild @@ -1,10 +1,10 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/rng-tools-4.ebuild,v 1.1 2012/11/06 05:05:36 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/rng-tools-4-r1.ebuild,v 1.1 2012/11/11 06:24:22 vapier Exp $ EAPI="4" -inherit eutils autotools +inherit eutils autotools toolchain-funcs DESCRIPTION="Daemon to use hardware random number generators" HOMEPAGE="http://gkernel.sourceforge.net/" @@ -19,10 +19,13 @@ src_prepare() { echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am epatch "${FILESDIR}"/test-for-argp.patch eautoreconf + + sed -i '/^AR /d' Makefile.in + tc-export AR } src_install() { default - newinitd "${FILESDIR}"/rngd-initd-3 rngd - newconfd "${FILESDIR}"/rngd-confd-3 rngd + newinitd "${FILESDIR}"/rngd-initd-4 rngd + newconfd "${FILESDIR}"/rngd-confd-4 rngd } |