Browse Source

rng-tools: Fixup Makefile and initscript

- typo in path of uci-defaults scripts
- fix init script when there is no rngd config
- convert init script to procd

Signed-off-by: Stefan Hellermann <stefan@the2masters.de>
lilik-openwrt-22.03
Stefan Hellermann 8 years ago
parent
commit
dc445cc242
2 changed files with 19 additions and 17 deletions
  1. +3
    -3
      utils/rng-tools/Makefile
  2. +16
    -14
      utils/rng-tools/files/rngd.init

+ 3
- 3
utils/rng-tools/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=rng-tools PKG_NAME:=rng-tools
PKG_VERSION:=5 PKG_VERSION:=5
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/gkernel/rng-tools/$(PKG_VERSION)/ PKG_SOURCE_URL:=@SF/gkernel/rng-tools/$(PKG_VERSION)/
@ -52,8 +52,8 @@ CONFIGURE_ARGS += \
define Package/rng-tools/install define Package/rng-tools/install
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/rngd.init $(1)/etc/init.d/rngd $(INSTALL_BIN) ./files/rngd.init $(1)/etc/init.d/rngd
$(INSTALL_DIR) $(1)/etc/uci_defaults
$(INSTALL_BIN) ./files/rngd.uci_defaults $(1)/etc/uci_defaults/rngd
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/rngd.uci_defaults $(1)/etc/uci-defaults/rngd
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rngtest $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/rngtest $(1)/usr/bin/
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/sbin


+ 16
- 14
utils/rng-tools/files/rngd.init View File

@ -3,22 +3,24 @@
START=98 START=98
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)
USE_PROCD=1
PROG=/sbin/rngd
: ${RNGD_FILLWATER:=4000}
start_service() {
local enabled=$(uci -q get system.@rngd[0].enabled)
local precmd=$(uci -q get system.@rngd[0].precmd)
local device=$(uci -q get system.@rngd[0].device)
local watermark=$(uci -q get system.@rngd[0].fill_watermark)
echo PRECMD=\'$RNGD_PRECMD\'
[ "$enabled" = "1" ] || return
start() {
[ 1 -eq "$RNGD_ENABLED" ] && {
[ -z "${RNGD_PRECMD}" ] || ${RNGD_PRECMD} ${RNGD_DEVICE}
service_start /sbin/rngd -r ${RNGD_DEVICE} -W ${RNGD_FILLWATER}
}
}
[ -z "$precmd" ] || ${precmd} ${device}
[ -z "$device" ] || device="-r ${device}"
[ -z "$watermark" ] || watermark="-W ${watermark}"
stop() {
service_stop /sbin/rngd
procd_open_instance
procd_set_param command "$PROG" -f ${device} ${watermark}
procd_set_param stderr 1
procd_close_instance
} }

Loading…
Cancel
Save