]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
rngd: update initskript and add hwrngtty support
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 6 Dec 2018 21:33:05 +0000 (22:33 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 6 Dec 2018 21:33:05 +0000 (22:33 +0100)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/rootfiles/core/126/filelists/files
config/udev/90-hwrng.rules
src/initscripts/system/rngd

index ce4e5176819cd602789659e1ec55e95db3d971f4..90534d725899987ac3c7994bec0af36f813aa976 100644 (file)
@@ -1,4 +1,6 @@
 etc/system-release
 etc/issue
+etc/rc.d/init.d/rngd
+lib/udev/rules.d/90-hwrng.rules
 srv/web/ipfire/cgi-bin/credits.cgi
 var/ipfire/langs
index a9397900913342c3df4ffe755100286eccdec702..cbc555c11049a646d7c62a3ffb83b83f35c86b91 100644 (file)
@@ -1 +1,16 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM!="tty", GOTO="ipfire_hwrng_end"
+KERNEL!="ttyACM[0-9]*", GOTO="ipfire_hwrng_end"
+
+SUBSYSTEMS=="usb-serial", ENV{.ID_PORT}="$attr{port_number}"
+
+IMPORT{builtin}="usb_id"
+ENV{ID_SERIAL}=="", GOTO="ipfire_hwrng_end"
+SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACE_NUM}="$attr{bInterfaceNumber}"
+ENV{ID_USB_INTERFACE_NUM}=="", GOTO="ipfire_hwrng_end"
+
+ATTRS{manufacturer}=="IPFire.org", ATTRS{product}=="Random Number Generator*", ENV{.ID_PORT}=="", SYMLINK+="hwrngtty" RUN+="/bin/stty raw -echo -ixoff -F /dev/hwrngtty 115200" RUN+="/etc/rc.d/init.d/rngd udev-event"
+
+LABEL="ipfire_hwrng_end"
 ACTION=="add|remove", KERNEL=="hw_random", RUN+="/etc/rc.d/init.d/rngd udev-event"
index 91b70a7b4f7dfcf7ca37bde69c13148e90bd9f6e..0f95fde80ad34f918055d9303e3f94c423bd843b 100644 (file)
 
 case "${1}" in
        start)
+               if pidofproc -s /usr/sbin/rngd; then
+                       boot_mesg "Random Number Generator Daemon is already running..."
+                       echo_ok;
+                       exit 0
+               fi
+               if [ -e /dev/hwrngtty ]; then
+                       HWRNG=/dev/hwrngtty
+               else
+                       HWRNG=/dev/hwrng
+               fi
                boot_mesg "Starting Random Number Generator Daemon..."
-               loadproc /usr/sbin/rngd --quiet
+               loadproc /usr/sbin/rngd -r $HWRNG --quiet
                ;;
 
        stop)