mirror of
https://gitee.com/open-loongarch/buildroot.git
synced 2026-10-25 21:07:11 +08:00
init src 1d072180a
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
config BR2_PACKAGE_HAVEGED
|
||||
bool "haveged"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
help
|
||||
The haveged project is an attempt to provide an easy-to-use,
|
||||
unpredictable random number generator based upon an adaptation
|
||||
of the HAVEGE algorithm.
|
||||
|
||||
http://www.issihosts.com/haveged/
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting haveged: "
|
||||
start-stop-daemon -S -x /usr/sbin/haveged -- -w 1024 -r 0
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping haveged: "
|
||||
start-stop-daemon -K -x /usr/sbin/haveged
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart|reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 d17bd22fa1745daca5ac72e014ed3b0fe5720da4c115953124b1bf2a0aa2b04b haveged-1.9.13.tar.gz
|
||||
sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING
|
||||
@@ -0,0 +1,27 @@
|
||||
################################################################################
|
||||
#
|
||||
# haveged
|
||||
#
|
||||
################################################################################
|
||||
|
||||
HAVEGED_VERSION = 1.9.13
|
||||
HAVEGED_SITE = $(call github,jirka-h,haveged,v$(HAVEGED_VERSION))
|
||||
HAVEGED_LICENSE = GPL-3.0+
|
||||
HAVEGED_LICENSE_FILES = COPYING
|
||||
HAVEGED_SELINUX_MODULES = entropyd
|
||||
|
||||
ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
|
||||
HAVEGED_CONF_OPTS += --enable-clock_gettime=yes
|
||||
endif
|
||||
|
||||
define HAVEGED_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 755 -D package/haveged/S21haveged \
|
||||
$(TARGET_DIR)/etc/init.d/S21haveged
|
||||
endef
|
||||
|
||||
define HAVEGED_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 package/haveged/haveged.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/haveged.service
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
@@ -0,0 +1,22 @@
|
||||
[Unit]
|
||||
# inspiration from upstream init.d/service.fedora
|
||||
Description=Entropy Daemon based on the HAVEGE algorithm
|
||||
Documentation=man:haveged(8) http://www.issihosts.com/haveged/
|
||||
DefaultDependencies=no
|
||||
# This would wait for filesystems, but we only need /dev/random, which
|
||||
# is certainly available after systemd initialised
|
||||
# After=systemd-tmpfiles-setup-dev.service
|
||||
Before=sysinit.target shutdown.target systemd-journald.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/haveged -w 1024 -v 1 --Foreground
|
||||
Restart=always
|
||||
SuccessExitStatus=137 143
|
||||
|
||||
# Only simple isolation methods that don't pull in dependencies
|
||||
CapabilityBoundingSet=CAP_SYS_ADMIN
|
||||
SecureBits=noroot-locked
|
||||
ProtectSystem=full
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
Reference in New Issue
Block a user