Thank you for the details. I started by removing all udev rules I had created. I then rebooted the system with the TrueRNG disconnected. After the system had booted, I ran /bin/stty -F /dev/ttyACM0
, and got this:
speed 9600 baud; line = 0;
-brkint -imaxbel
Then, I re-added this for a rule:
SUBSYSTEM=="tty", ATTRS{product}=="TrueRNG", SYMLINK+="hwrng", RUN+="/bin/stty raw -echo -ixoff -F /dev/%k speed 3000000"
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f5fe", ENV{ID_MM_DEVICE_IGNORE}="1"
Now, if I leave the TrueRNG connected and reboot, all comes up properly, including the stty settings and rngd (which is started during boot, not as part of the udev rule. However, if I boot up without it being plugged in, the symlink is created, but the stty settings are not modified. I don’t understand why, but that is how it is working. If I plug it in and then manually run the commands in the “RUN” directive, all works as it should. Removing the “RUN” directive from the “SUBSYSTEM” line and re-adding the “ACTION” line does not accomplish anything:
#SUBSYSTEM=="tty", ATTRS{product}=="TrueRNG", SYMLINK+="hwrng"
#ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f5fe", ENV{ID_MM_DEVICE_IGNORE}="1"
#ACTION=="add|remove", KERNEL=="ttyACM%n", RUN+="/bin/stty raw -echo -ixoff -F /dev/%k speed 3000000; /etc/rc.d/init.d/rngd udev-event"
Perhaps I should just leave it at that, but it just seems to me that a USB device ought to properly function when hot-plugged.