initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
From 676abde95bab10e1d26e91682772514010143343 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Seiderer <ps.report@gmx.net>
|
||||
Date: Sun, 21 Mar 2021 17:00:08 +0100
|
||||
Subject: [PATCH] Check for sys/auxv.h before using it.
|
||||
|
||||
- fixes uclibc-ng compile (does not provide sys/auxv.h header file)
|
||||
|
||||
Fixes:
|
||||
|
||||
haveged.c:22:10: fatal error: sys/auxv.h: No such file or directory
|
||||
22 | #include <sys/auxv.h>
|
||||
| ^~~~~~~~~~~~
|
||||
|
||||
[Upstream: https://github.com/jirka-h/haveged/pull/59]
|
||||
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
src/haveged.c | 4 ++++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c172a10..a0263f5 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -125,6 +125,7 @@ AC_CHECK_HEADERS(stdio.h)
|
||||
AC_CHECK_HEADERS(stdlib.h)
|
||||
AC_CHECK_HEADERS(string.h)
|
||||
AC_CHECK_HEADERS(sys/ioctl.h)
|
||||
+AC_CHECK_HEADERS(sys/auxv.h)
|
||||
AC_CHECK_HEADERS(sys/mman.h)
|
||||
AC_CHECK_HEADERS(sys/types.h)
|
||||
AC_CHECK_HEADERS(sys/socket.h)
|
||||
diff --git a/src/haveged.c b/src/haveged.c
|
||||
index b9cb77b..dad3072 100644
|
||||
--- a/src/haveged.c
|
||||
+++ b/src/haveged.c
|
||||
@@ -19,7 +19,9 @@
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "config.h"
|
||||
+#if defined(HAVE_SYS_AUXV_H)
|
||||
#include <sys/auxv.h>
|
||||
+#endif
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
@@ -135,8 +137,10 @@ int main(int argc, char **argv)
|
||||
{
|
||||
volatile char *path = strdup(argv[0]);
|
||||
volatile char *arg0 = argv[0];
|
||||
+#if defined(HAVE_SYS_AUXV_H)
|
||||
if (path[0] != '/')
|
||||
path = (char*)getauxval(AT_EXECFN);
|
||||
+#endif
|
||||
static const char* cmds[] = {
|
||||
"b", "buffer", "1", SETTINGR("Buffer size [KW], default: ",COLLECT_BUFSIZE),
|
||||
"d", "data", "1", SETTINGR("Data cache size [KB], with fallback to: ", GENERIC_DCACHE ),
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -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 938cb494bcad7e4f24e61eb50fab4aa0acbc3240c80f3ad5c6cf7e6e922618c3 haveged-1.9.14.tar.gz
|
||||
sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING
|
||||
@@ -0,0 +1,45 @@
|
||||
################################################################################
|
||||
#
|
||||
# haveged
|
||||
#
|
||||
################################################################################
|
||||
|
||||
HAVEGED_VERSION = 1.9.14
|
||||
HAVEGED_SITE = $(call github,jirka-h,haveged,v$(HAVEGED_VERSION))
|
||||
HAVEGED_LICENSE = GPL-3.0+
|
||||
HAVEGED_LICENSE_FILES = COPYING
|
||||
HAVEGED_SELINUX_MODULES = entropyd
|
||||
# patch touching configure.ac
|
||||
HAVEGED_AUTORECONF = YES
|
||||
|
||||
# '--disable-init' as buildroot ships its own sysv/systemd init files
|
||||
HAVEGED_CONF_OPTS = \
|
||||
--enable-daemon \
|
||||
--disable-diagnostic \
|
||||
--disable-init \
|
||||
--disable-nistest \
|
||||
--disable-enttest \
|
||||
--disable-olt \
|
||||
--enable-tune
|
||||
|
||||
ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
|
||||
HAVEGED_CONF_OPTS += --enable-clock_gettime
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
|
||||
HAVEGED_CONF_OPTS += --enable-threads
|
||||
else
|
||||
HAVEGED_CONF_OPTS += --disable-threads
|
||||
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