OneRNG not working after reinstalling onerng_3.6-1_all.deb

sanmai alexey at kopytko.com
Thu Feb 20 02:43:30 GMT 2020


Since this is the post that comes up in Google, I'm going to add here what I found.

I found that in the more recent versions of Udev the program that used to start OneRNG, gets called multiple times. E.g. this is what I see in logs:

systemd-udevd[43808]: 3-1.6: Process '/sbin/onerng.sh 3-1.6' failed with exit code 1.
systemd-udevd[43808]: 3-1.6: Process '/sbin/onerng.sh 3-1.6' failed with exit code 1.
systemd-udevd[43808]: 3-1.6:1.0: Process '/sbin/onerng.sh 3-1.6:1.0' failed with exit code 1.
systemd-udevd[43809]: 3-1.6:1.1: Process '/sbin/onerng.sh 3-1.6:1.1' failed with exit code 1.
systemd-udevd[43808]: 3-1.6:1.0: Process '/sbin/onerng.sh 3-1.6:1.0' failed with exit code 1.
systemd-udevd[43809]: 3-1.6:1.1: Process '/sbin/onerng.sh 3-1.6:1.1' failed with exit code 1.

That's not the problem per itself, because the program can successfully avoid invalid arguments, but I also found that Udev would happily start it at least twice with a valid argument, and when you start the program with a valid argument it will try to verify the firmware and fail, because each of the running programs will get only about a half of the firmware. With primitive logging that I added I see:

root: OneRNG firmware size is 162232
OneRNG: firmware verification failed: Bad image
root: OneRNG firmware size is 165716
OneRNG: firmware verification failed: Short image

It is just:

+logger OneRNG firmware size is $(stat -c%s $t)
 python /sbin/onerng_verify.py $t 

The workaround is to disable firmware verification with ONERNG_VERIFY_FIRMWARE="0"

But there's a proper solution: add SUBSYSTEM=="tty" to limit the scope of the Udev rules. Like so:

- ACTION=="add", ...
+ ACTION=="add", SUBSYSTEM=="tty",  ...

Then the starting program will get called just once.

I wish I could send a PR with this change, but for lack of that option here you have this post.


More information about the Discuss mailing list