4

I have a Beagleblone Black with an ARMv7 SoC. /proc/cpuinfo says the hardware is Generic AM33XX. It is running Debian and the 4.1.15-ti-rt-r40 kernel.

I run a lot of stress tests as part of my testing regime. The Beagleboard is suffering entropy depletion in /dev/random. In blocking mode it takes minutes to read a handful of bytes. For example, it took 646 seconds to generate 10 bytes.

The machine has rng-tools installed, which usually keeps /dev/random in good working order. Or it does so on other Debian platforms like including my CubieTruck and Wandboard. I guess the entropy daemon has some trouble on this platform.

The question is kind of broad because I am not sure of the approach. I don't know if I should be using another package to ensure entropy, or if I need another program or driver. Or maybe something else.

My question is, how can I keep /dev/random in good working order on the Beaglebone?


Dmesg shows a hardware random number generator:

[21.308396] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20

And the kernel was configured to provide the driver as a module:

$ cat /boot/config-4.1.15-ti-rt-r40 | grep HW_RANDOM_OMAP
CONFIG_HW_RANDOM_OMAP=m

$ uname -a
Linux beaglebone 4.1.15-ti-rt-r40 #1 SMP PREEMPT RT Thu Jan 7 23:32:08 UTC 2016armv7l GNU/Linux

$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 2 (v7l)
BogoMIPS        : 996.14
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc08
CPU revision    : 2

Hardware        : Generic AM33XX (Flattened Device Tree)
Revision        : 0000
Serial          : 0000000000000000
3
  • 2
    I'm voting to close this question as off-topic because as this is really a generic Linux/Unix question. It would probably be better asked on unix.stackexchange.com
    – hardillb
    Oct 14, 2018 at 12:00
  • 2
    also are you 100% sure that the rng-tools daemon is running?
    – hardillb
    Oct 14, 2018 at 12:02
  • yes, but is rngd running?
    – hardillb
    Oct 14, 2018 at 16:05

1 Answer 1

3

The local work-around for me was run rng-tools directly from rc.local:

$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

if [ -e /usr/sbin/rngd ]; then
    /usr/sbin/rngd -r /dev/hwrng -f
fi

exit 0

A bug was also filed against Debian: Issue 911043, rng-tools does not perform as expected on Beaglebone Black with OMAP hw rng.

I'm going to leave the question open in case anyone knows the real fix for the systemd problems.


The statement in @MariusMatutiae's answer at How can I run a command after boot? was very true:

In [the systemd] case, you should learn how to start a service to be run by systemctl, but this may be more than you bargained for with your simple question.

I've wasted over 4 hours trying to get this working using systemd methods and controls. I guess I should not feel bad since the distro could not get it to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.