From 45261cc295fb0bb5ad35047f6a61721bce930611 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 2 Apr 2012 16:19:59 +0000 Subject: [PATCH] [package] add haveged I've checked the haveged makefile now, it only relies on librt, so the attached patch should have no issues under any platform. Signed-off-by: Oliver Smith SVN-Revision: 31161 --- utils/haveged/Makefile | 41 ++++++++++++++++++++++++++++++++ utils/haveged/files/haveged.init | 16 +++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 utils/haveged/Makefile create mode 100644 utils/haveged/files/haveged.init diff --git a/utils/haveged/Makefile b/utils/haveged/Makefile new file mode 100644 index 0000000000..b963e4a0b5 --- /dev/null +++ b/utils/haveged/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: Makefile 1 2012-01-12 03:50:18Z Olipro $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=haveged +PKG_VERSION:=1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.issihosts.com/$(PKG_NAME) +PKG_MD5SUM:=39a03d4b8a4225706f78dbef3f623b0e + +#ensure this is consistent with the dir in the tarball!!! +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/haveged + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Feeds the kernel entropy pool by timing CPU loops. + DEPENDS:=+librt + URL:=http://www.issihosts.com/haveged/ +endef + +define Package/haveged/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/haveged.init $(1)/etc/init.d/haveged + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/haveged $(1)/sbin/ +endef + +$(eval $(call BuildPackage,haveged)) diff --git a/utils/haveged/files/haveged.init b/utils/haveged/files/haveged.init new file mode 100644 index 0000000000..129d95149a --- /dev/null +++ b/utils/haveged/files/haveged.init @@ -0,0 +1,16 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org + +START=98 + +HAVEGED_THRESHOLD=1024 +HAVEGED_DCACHE=32 +HAVEGED_ICACHE=32 + +start() { + service_start /sbin/haveged -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1 +} + +stop() { + service_stop /sbin/haveged +} -- 2.30.2