浏览代码

haveged: import from oldpackages. no changes

Hannu Nyman 10 年前
父节点
当前提交
fce33219bf
共有 2 个文件被更改,包括 83 次插入0 次删除
  1. 67
    0
      utils/haveged/Makefile
  2. 16
    0
      utils/haveged/files/haveged.init

+ 67
- 0
utils/haveged/Makefile 查看文件

@@ -0,0 +1,67 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+# $Id: Makefile 1 2012-01-12 03:50:18Z Olipro $
8
+
9
+include $(TOPDIR)/rules.mk
10
+
11
+PKG_NAME:=haveged
12
+PKG_VERSION:=1.9.1
13
+PKG_RELEASE:=1
14
+
15
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16
+PKG_SOURCE_URL:=http://www.issihosts.com/$(PKG_NAME)
17
+PKG_MD5SUM:=015ff58cd10607db0e0de60aeca2f5f8
18
+
19
+#ensure this is consistent with the dir in the tarball!!!
20
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21
+
22
+PKG_BUILD_PARALLEL:=1
23
+
24
+include $(INCLUDE_DIR)/package.mk
25
+
26
+define Package/haveged/template
27
+  SECTION:=utils
28
+  CATEGORY:=Utilities
29
+  TITLE:=Feeds the kernel entropy pool by timing CPU loops.
30
+  URL:=http://www.issihosts.com/haveged/
31
+endef
32
+
33
+define Package/haveged
34
+  $(call Package/haveged/template)
35
+  DEPENDS:=+libhavege
36
+endef
37
+
38
+define Package/libhavege
39
+  $(call Package/haveged/template)
40
+  TITLE:=Library for haveged
41
+endef
42
+
43
+CONFIGURE_ARGS+= \
44
+      --enable-daemon=yes
45
+      --enable-threads=no
46
+
47
+define Build/InstallDev
48
+	$(INSTALL_DIR) $(1)/usr/include
49
+	$(CP) $(PKG_BUILD_DIR)/src/havege.h $(1)/usr/include/
50
+	$(INSTALL_DIR) $(1)/usr/lib
51
+	$(CP) $(PKG_BUILD_DIR)/src/.libs/libhavege.{a,so*} $(1)/usr/lib/
52
+endef
53
+
54
+define Package/haveged/install
55
+	$(INSTALL_DIR) $(1)/etc/init.d
56
+	$(INSTALL_BIN) ./files/haveged.init $(1)/etc/init.d/haveged
57
+	$(INSTALL_DIR) $(1)/usr/sbin
58
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/.libs/haveged $(1)/usr/sbin/
59
+endef
60
+
61
+define Package/libhavege/install
62
+	$(INSTALL_DIR) $(1)/usr/lib
63
+	$(CP) $(PKG_BUILD_DIR)/src/.libs/libhavege.so* $(1)/usr/lib/
64
+endef
65
+
66
+$(eval $(call BuildPackage,haveged))
67
+$(eval $(call BuildPackage,libhavege))

+ 16
- 0
utils/haveged/files/haveged.init 查看文件

@@ -0,0 +1,16 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2012 OpenWrt.org
3
+
4
+START=98
5
+
6
+HAVEGED_THRESHOLD=1024
7
+HAVEGED_DCACHE=32
8
+HAVEGED_ICACHE=32
9
+
10
+start() {
11
+	service_start /usr/sbin/haveged -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1
12
+}
13
+
14
+stop() {
15
+	service_stop /usr/sbin/haveged
16
+}