Initial Commit
- initial default booting image
This commit is contained in:
30
package/redis/0001-uclibc.patch
Normal file
30
package/redis/0001-uclibc.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
redis-001-uclibc.patch: This patch fixes redis so that it can be compiled
|
||||
against uclibc. Patch originates from:
|
||||
|
||||
Support cross-compiling for uClibc targets
|
||||
https://github.com/antirez/redis/pull/537
|
||||
Mike Steinert, mike.steinert@gmail.com
|
||||
|
||||
Signed-off-by: Daniel Price <daniel.price@gmail.com>
|
||||
[Martin: adapt to 3.0.3]
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
[Titouan: adapt to 5.0.4]
|
||||
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
|
||||
[Fabrice: update for 6.0.9]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
[Titouan: adapt to 7.2.1]
|
||||
Signed-off-by: Titouan Christophe <titouanchristophe@gmail.com>
|
||||
|
||||
=========================================================================
|
||||
diff -ur old/src/config.h new/src/config.h
|
||||
--- old/src/config.h 2012-10-26 07:20:24.000000000 -0700
|
||||
+++ new/src/config.h 2012-10-31 13:41:51.206309564 -0700
|
||||
@@ -71,7 +71,7 @@
|
||||
#endif
|
||||
|
||||
/* Test for backtrace() */
|
||||
-#if defined(__APPLE__) || (defined(__linux__) && defined(__GLIBC__)) || \
|
||||
+#if defined(__APPLE__) || (defined(__linux__) && defined(__GLIBC__) && !defined(__UCLIBC__)) || \
|
||||
defined(__FreeBSD__) || ((defined(__OpenBSD__) || defined(__NetBSD__) || defined(__sun)) && defined(USE_BACKTRACE))\
|
||||
|| defined(__DragonFly__) || (defined(__UCLIBC__) && defined(__UCLIBC_HAS_BACKTRACE__))
|
||||
#define HAVE_BACKTRACE 1
|
||||
35
package/redis/0002-largefile-conditional-define.patch
Normal file
35
package/redis/0002-largefile-conditional-define.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
Define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS conditionally
|
||||
|
||||
In order to avoid ugly warnings at compile time, only define
|
||||
_LARGEFILE_SOURCE and _FILE_OFFSET_BITS if they have not already been
|
||||
defined through the build command line.
|
||||
|
||||
Avoids:
|
||||
|
||||
In file included from redis.h:33:0,
|
||||
from migrate.c:1:
|
||||
fmacros.h:45:0: warning: "_LARGEFILE_SOURCE" redefined
|
||||
<command-line>:0:0: note: this is the location of the previous definition
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
[Dario: make the patch to be applied with fuzz factor 0]
|
||||
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
||||
|
||||
Index: redis-2.6.11/src/fmacros.h
|
||||
===================================================================
|
||||
--- redis-2.6.11.orig/src/fmacros.h 2013-03-25 22:09:15.000000000 +0100
|
||||
+++ redis-2.6.11/src/fmacros.h 2013-03-25 22:09:40.000000000 +0100
|
||||
@@ -55,8 +55,13 @@
|
||||
#define _POSIX_C_SOURCE 199506L
|
||||
#endif
|
||||
|
||||
+#ifndef _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE_SOURCE
|
||||
+#endif
|
||||
+
|
||||
+#ifndef _FILE_OFFSET_BITS
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
+#endif
|
||||
|
||||
/* deprecate unsafe functions
|
||||
*
|
||||
@@ -0,0 +1,29 @@
|
||||
From f79d1d1bf9e6f54b67e5482602084fbff7fd9cc9 Mon Sep 17 00:00:00 2001
|
||||
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
Date: Fri, 28 Oct 2016 12:50:34 -0300
|
||||
Subject: [PATCH] redis.conf: adjust defaults for buildroot
|
||||
|
||||
Based on Martin Bark's patch hence archlinux package.
|
||||
We just need to specify a proper db directory.
|
||||
|
||||
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
---
|
||||
redis.conf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/redis.conf b/redis.conf
|
||||
index 22e00bc..3bb0430 100644
|
||||
--- a/redis.conf
|
||||
+++ b/redis.conf
|
||||
@@ -244,7 +244,7 @@ dbfilename dump.rdb
|
||||
# The Append Only File will also be created inside this directory.
|
||||
#
|
||||
# Note that you must specify a directory here, not a file name.
|
||||
-dir ./
|
||||
+dir /var/lib/redis/
|
||||
|
||||
################################# REPLICATION #################################
|
||||
|
||||
--
|
||||
2.7.3
|
||||
|
||||
23
package/redis/Config.in
Normal file
23
package/redis/Config.in
Normal file
@@ -0,0 +1,23 @@
|
||||
config BR2_PACKAGE_REDIS
|
||||
bool "redis"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
depends on !BR2_STATIC_LIBS # dlfcn.h
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # _Atomic keyword
|
||||
depends on BR2_TOOLCHAIN_HAS_ATOMIC
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # pthread_setname_np()
|
||||
depends on BR2_INSTALL_LIBSTDCPP # fastfloat bundled dep is in C++
|
||||
help
|
||||
Redis is an open source (BSD licensed), in-memory data
|
||||
structure store, used as a database, cache and message
|
||||
broker. It supports data structures such as strings,
|
||||
hashes, lists, sets, sorted sets with range queries,
|
||||
bitmaps, hyperloglogs, geospatial indexes with radius
|
||||
queries and streams.
|
||||
|
||||
http://www.redis.io
|
||||
|
||||
comment "redis needs a toolchain w/ gcc>=4.9, dynamic library, nptl, C++"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_TOOLCHAIN_HAS_ATOMIC
|
||||
depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS_NPTL \
|
||||
|| !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || !BR2_INSTALL_LIBSTDCPP
|
||||
38
package/redis/S50redis
Normal file
38
package/redis/S50redis
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# start redis
|
||||
#
|
||||
|
||||
start() {
|
||||
printf "Starting redis: "
|
||||
umask 077
|
||||
start-stop-daemon -S -q -c redis:redis -b \
|
||||
--exec /usr/bin/redis-server -- /etc/redis.conf
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
stop() {
|
||||
printf "Stopping redis: "
|
||||
/usr/bin/redis-cli shutdown
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
5
package/redis/redis.hash
Normal file
5
package/redis/redis.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# From https://github.com/redis/redis-hashes/blob/master/README
|
||||
sha256 60166c95ab7aedaa9dfe516de685be0a4dd87be95ded59ba429df14c13f1b663 redis-8.10.1.tar.gz
|
||||
|
||||
# Locally calculated
|
||||
sha256 4a0e416b9537688f30dfe69ddaceb2ca64d96b7df02a0a6760d376890ddc4e40 LICENSE.txt
|
||||
74
package/redis/redis.mk
Normal file
74
package/redis/redis.mk
Normal file
@@ -0,0 +1,74 @@
|
||||
################################################################################
|
||||
#
|
||||
# redis
|
||||
#
|
||||
################################################################################
|
||||
|
||||
REDIS_VERSION = 8.10.1
|
||||
REDIS_SITE = https://download.redis.io/releases
|
||||
REDIS_LICENSE = \
|
||||
AGPL-3.0 or SSPL-1.0 or RSAL-2.0 (core); \
|
||||
MIT and BSD family licenses (Bundled components)
|
||||
REDIS_LICENSE_FILES = LICENSE.txt
|
||||
REDIS_CPE_ID_VENDOR = redis
|
||||
REDIS_SELINUX_MODULES = redis
|
||||
|
||||
define REDIS_USERS
|
||||
redis -1 redis -1 * /var/lib/redis /bin/false - Redis Server
|
||||
endef
|
||||
|
||||
# Uses __atomic_fetch_add_4. Adding -latomic to LDFLAGS does not work,
|
||||
# because LDFLAGS is used before the list of object files. We need to
|
||||
# add -latomic to FINAL_LIBS to provide -latomic at the correct place
|
||||
# in the linking command.
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
define REDIS_FIX_MAKEFILE
|
||||
$(SED) 's/FINAL_LIBS=-lm/FINAL_LIBS=-lm -latomic/' $(@D)/src/Makefile
|
||||
endef
|
||||
REDIS_POST_PATCH_HOOKS = REDIS_FIX_MAKEFILE
|
||||
endif
|
||||
|
||||
# Redis doesn't support DESTDIR (yet, see
|
||||
# https://github.com/antirez/redis/pull/609). We set PREFIX
|
||||
# instead.
|
||||
REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
|
||||
PREFIX=$(TARGET_DIR)/usr MALLOC=libc WARNINGS=
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
|
||||
REDIS_DEPENDENCIES += systemd
|
||||
REDIS_BUILDOPTS += USE_SYSTEMD=yes
|
||||
else
|
||||
REDIS_BUILDOPTS += USE_SYSTEMD=no
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
|
||||
REDIS_DEPENDENCIES += libopenssl
|
||||
REDIS_BUILDOPTS += BUILD_TLS=yes
|
||||
else
|
||||
REDIS_BUILDOPTS += BUILD_TLS=no
|
||||
endif
|
||||
|
||||
define REDIS_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D) build redis
|
||||
endef
|
||||
|
||||
define REDIS_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D) \
|
||||
LDCONFIG=true install
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(REDIS_BUILDOPTS) -C $(@D) \
|
||||
sync-redis-conf
|
||||
$(INSTALL) -D -m 0644 $(@D)/redis-full.conf \
|
||||
$(TARGET_DIR)/etc/redis.conf
|
||||
endef
|
||||
|
||||
define REDIS_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 0755 -D package/redis/S50redis \
|
||||
$(TARGET_DIR)/etc/init.d/S50redis
|
||||
endef
|
||||
|
||||
define REDIS_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 0644 package/redis/redis.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/redis.service
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
24
package/redis/redis.service
Normal file
24
package/redis/redis.service
Normal file
@@ -0,0 +1,24 @@
|
||||
[Unit]
|
||||
Description=Redis data structure server
|
||||
Documentation=https://redis.io/documentation
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=redis
|
||||
Group=redis
|
||||
ExecStart=/usr/bin/redis-server --supervised systemd --daemonize no
|
||||
TimeoutStartSec=5
|
||||
TimeoutStopSec=5
|
||||
CapabilityBoundingSet=
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
NoNewPrivileges=true
|
||||
RuntimeDirectory=redis
|
||||
RuntimeDirectoryMode=755
|
||||
LimitNOFILE=10032
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user