Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 276973 - sys-apps/rng-tools: rngd does not use hw random with udev-141
Summary: sys-apps/rng-tools: rngd does not use hw random with udev-141
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-07 19:57 UTC by Michał Bartoszkiewicz
Modified: 2009-09-03 20:47 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Bartoszkiewicz 2009-07-07 19:57:51 UTC
/etc/init.d/rngd from rng-tools-2 contains:
        ebegin "Starting hardware RNG daemon"
        if [ -e /dev/hw_random ]; then
                start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -s ${STEP-64} -t ${TIMEOUT-60} -b -r /dev/hw_random
                eend $? "Failed to start hardware RNG daemon"
        elif [ -e /dev/hwrandom ]; then
                start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -s ${STEP-64} -t ${TIMEOUT-60} -b -r /dev/hwrandom
                eend $? "Failed to start hardware RNG daemon"
        elif [ -e /dev/i810_rng ]; then
                start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -s ${STEP-64} -t ${TIMEOUT-60} -b -r /dev/i810_rng
                eend $? "Failed to start hardware RNG daemon"
        else
                einfo "No hardware RNG found, using /dev/urandom as feedback input"
                start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -s ${STEP-64} -t ${TIMEOUT-60} -b -r /dev/urandom
                eend $? "Failed to start hardware RNG daemon"
        fi

I.e. it looks for the hardware RNG in /dev/hw_random, /dev/hwrandom and /dev/i810_rng.
But udev-141 contains (in 50-udev-default.rules):
KERNEL=="hw_random",		NAME="hwrng"

This means that the rngd init script can not find the hw RNG device.
Comment 1 Krzysztof Pawlik (RETIRED) gentoo-dev 2009-07-15 19:47:47 UTC
------------------------------------------------------------------------------
Check /dev/hwrng, see bug #276973.
(Portage version: 2.1.6.13/cvs/Linux x86_64)
------------------------------------------------------------------------------
Comment 2 cilly 2009-08-18 13:01:22 UTC
same issue here, pls correct init-scripts of rngd, or fix udevd with proper string

Rather than checking different instances, the init-script of rng-tools should allow the user to configure a rng-device thru the conf.d/rngd file.

minimalistic diff by hand, atm no time to do diffs

/etc/conf.d/rngd:

+# rng-device, usually /dev/hwrandom, /dev/hw_random, /dev/hwrng
+#RNG_DEVICE=/dev/hwrng

/etc/init.d/rngd:

           ebegin "Starting hardware RNG daemon"
+        if [ -e ${RNG_DEVICE} ]; then
+              start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -s ${STEP-64} -t ${TIMEOUT-60} -b -r ${RNG_DEVICE}
+              eend $? "Failed to start hardware RNG daemon"
 -       if [ -e /dev/hw_random ]; then
+       elif [ -e /dev/hw_random ]; then
                start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -${STEP-64} -t ${TIMEOUT-60} -b -r /dev/hw_random

Comment 3 cilly 2009-08-18 13:12:02 UTC
Where is this fixed?

Pls reopen.
Comment 4 Alan Swanson 2009-09-03 15:34:50 UTC
I encountered this problem too. It looks like the rngd init script was updated with /dev/hwrng but the package version was not incremented.

The Gentoo devs still need to increment the version with "-r1" so people know to update.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-09-03 20:47:26 UTC
Should be bumped now. Will refactor later.