mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
rngd: update initskript and add hwrngtty support
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -13,8 +13,18 @@
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user