. /etc/sysconfig/rc
. ${rc_functions}
-function has_rdrand() {
- grep -q "rdrand" /proc/cpuinfo
-}
-
-function has_hwrng() {
- [ -e "/dev/hwrng" ]
-}
-
case "${1}" in
start)
- if ! has_hwrng && ! has_rdrand; then
- boot_mesg "No Hardware Random Number Generator found..."
- echo_warning
+ if pidofproc -s /usr/sbin/rngd; then
+ boot_mesg "Random Number Generator Daemon is already running..."
+ echo_ok;
exit 0
fi
-
- boot_mesg "Starting Random Number Generator Daemon..."
-
- if pidofproc /usr/sbin/rngd &>/dev/null; then
- # Is already running.
- echo_ok
+ if [ -e /dev/hwrngtty ]; then
+ HWRNG=/dev/hwrngtty
else
- loadproc /usr/sbin/rngd --no-tpm=1
+ HWRNG=/dev/hwrng
fi
+ boot_mesg "Starting Random Number Generator Daemon..."
+ loadproc /usr/sbin/rngd -r $HWRNG --quiet
;;
stop)