mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
rng-tools: uci-fy, default to doing nothing
Enabling the default configuration will pipe /dev/urandom back into /dev/random ala the current package behavior. Because this amounts to disabling the in-kernel entropy estimation, default disabled. While here, uci-paramaterize the high watermark. While here, add a pre-command hook for real RNGs that need 'stty raw' or other such hooks. (e.g. the TrueRNG devices) As offered in github openwrt/packages#3422, take over maintainership. See github openwrt/packages#3142. Signed-off-by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
This commit is contained in:
@@ -3,12 +3,20 @@
|
||||
|
||||
START=98
|
||||
|
||||
RNGD_AMOUNT=4000
|
||||
RNGD_DEVICE="/dev/urandom"
|
||||
# Use /dev/urandom as source, as hardware sources like /dev/hwrng are usually not present
|
||||
RNGD_FILLWATER=$(uci -q get system.@rngd[0].fill_watermark)
|
||||
RNGD_DEVICE=$(uci -q get system.@rngd[0].device)
|
||||
RNGD_ENABLED=$(uci -q get system.@rngd[0].enabled)
|
||||
RNGD_PRECMD=$(uci -q get system.@rngd[0].precmd)
|
||||
|
||||
: ${RNGD_FILLWATER:=4000}
|
||||
|
||||
echo PRECMD=\'$RNGD_PRECMD\'
|
||||
|
||||
start() {
|
||||
service_start /sbin/rngd -r $RNGD_DEVICE -W $RNGD_AMOUNT
|
||||
[ 1 -eq "$RNGD_ENABLED" ] && {
|
||||
[ -z "${RNGD_PRECMD}" ] || ${RNGD_PRECMD} ${RNGD_DEVICE}
|
||||
service_start /sbin/rngd -r ${RNGD_DEVICE} -W ${RNGD_FILLWATER}
|
||||
}
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
Reference in New Issue
Block a user