import urandom-seed and urngd for v19.07

This commit is contained in:
coolsnowwolf 2020-02-01 18:35:27 +08:00
parent 2289184a62
commit bffe4e4f82
9 changed files with 100 additions and 3 deletions

View File

@ -13,7 +13,7 @@ __target_inc=1
DEVICE_TYPE?=router
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd \
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd urandom-seed urngd \
block-mount coremark kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget \
default-settings luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-vsftpd luci-app-ssr-plus \

View File

@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_RELEASE:=198
PKG_RELEASE:=199
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ubox
PKG_RELEASE:=3
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git

View File

@ -0,0 +1,32 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=urandom-seed
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+getrandom
TITLE:=/etc/urandom.seed handling for OpenWrt
URL:=http://openwrt.org/
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,urandom-seed))

View File

@ -0,0 +1,48 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=urngd
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/urngd.git
PKG_SOURCE_DATE:=2020-01-21
PKG_SOURCE_VERSION:=c7f7b6b65b82eda4675b42d8cd28d76ea7aebf1a
PKG_MIRROR_HASH:=2d31025b79fe130c579d6c3f4bf4dc12abc43a7319b20a5cdca24ae363ec70f3
PKG_LICENSE:=GPL-2.0 BSD-3-Clause
PKG_LICENSE_FILES:=
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Base system
TITLE:=OpenWrt non-physical true random number generator based on timing jitter
DEPENDS:=+libubox
endef
define Package/$(PKG_NAME)/description
urngd is OpenWrt's micro non-physical true random number generator based on
timing jitter.
Using the Jitter RNG core, the rngd provides an entropy source that feeds into
the Linux /dev/random device if its entropy runs low. It updates the
/dev/random entropy estimator such that the newly provided entropy unblocks
/dev/random.
The seeding of /dev/random also ensures that /dev/urandom benefits from
entropy. Especially during boot time, when the entropy of Linux is low, the
Jitter RNGd provides a source of sufficient entropy.
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/sbin/$(PKG_NAME)
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,17 @@
#!/bin/sh /etc/rc.common
START=00
USE_PROCD=1
NAME=urngd
PROG=/sbin/urngd
start_service() {
procd_open_instance
procd_set_param command "$PROG"
procd_close_instance
}
reload_service() {
procd_send_signal $PROG
}