Update buildroot 2020.02.01 (#622)
* Update buildroot 2020.02.01 Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix LN * Fix wpa Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix lint Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * fix-network Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix script Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
From 28c27e2001b709a9cae1db0aba2185ec86ba0454 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Vasko <mvasko@cesnet.cz>
|
||||
Date: Thu, 19 Dec 2019 14:01:00 +0100
|
||||
Subject: [PATCH 1/9] sysrepo-plugind CHANGE create plugins dir if it does not
|
||||
exist
|
||||
|
||||
Fixes #1719
|
||||
|
||||
[Patch from https://github.com/sysrepo/sysrepo/commit/28c27e2001b709a9cae1db0aba2185ec86ba0454]
|
||||
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
|
||||
---
|
||||
src/executables/sysrepo-plugind.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/src/executables/sysrepo-plugind.c b/src/executables/sysrepo-plugind.c
|
||||
index 6b11bad6..ddb41c26 100644
|
||||
--- a/src/executables/sysrepo-plugind.c
|
||||
+++ b/src/executables/sysrepo-plugind.c
|
||||
@@ -225,6 +225,18 @@ load_plugins(struct srpd_plugin_s **plugins, int *plugin_count)
|
||||
plugins_dir = SRPD_PLUGINS_PATH;
|
||||
}
|
||||
|
||||
+ /* create the directory if it does not exist */
|
||||
+ if (access(plugins_dir, F_OK) == -1) {
|
||||
+ if (errno != ENOENT) {
|
||||
+ error_print(0, "Checking plugins dir existence failed (%s).", strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (mkdir(plugins_dir, 00777) == -1) {
|
||||
+ error_print(0, "Creating plugins dir \"%s\" failed (%s).", plugins_dir, strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
dir = opendir(plugins_dir);
|
||||
if (!dir) {
|
||||
error_print(0, "Opening \"%s\" directory failed (%s).", plugins_dir, strerror(errno));
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
From 353faffe13852c4204f158b5d4301405bd222c44 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Vasko <mvasko@cesnet.cz>
|
||||
Date: Fri, 20 Dec 2019 13:40:35 +0100
|
||||
Subject: [PATCH 9/9] sysrpeo-plugind BUGFIX create plugins dir recursively
|
||||
|
||||
Refs #1719
|
||||
|
||||
[Patch from https://github.com/sysrepo/sysrepo/commit/353faffe13852c4204f158b5d4301405bd222c44]
|
||||
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
|
||||
---
|
||||
src/executables/sysrepo-plugind.c | 30 +++++++++++++++++++++++++++++-
|
||||
1 file changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/executables/sysrepo-plugind.c b/src/executables/sysrepo-plugind.c
|
||||
index ddb41c26..ca22140e 100644
|
||||
--- a/src/executables/sysrepo-plugind.c
|
||||
+++ b/src/executables/sysrepo-plugind.c
|
||||
@@ -206,6 +206,34 @@ daemon_init(int debug, sr_log_level_t log_level)
|
||||
sr_log_syslog("sysrepo-plugind", log_level);
|
||||
}
|
||||
|
||||
+/* from src/common.c */
|
||||
+int
|
||||
+sr_mkpath(const char *path, mode_t mode)
|
||||
+{
|
||||
+ char *p, *dup;
|
||||
+
|
||||
+ dup = strdup(path);
|
||||
+ for (p = strchr(dup + 1, '/'); p; p = strchr(p + 1, '/')) {
|
||||
+ *p = '\0';
|
||||
+ if (mkdir(dup, mode) == -1) {
|
||||
+ if (errno != EEXIST) {
|
||||
+ *p = '/';
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ *p = '/';
|
||||
+ }
|
||||
+ free(dup);
|
||||
+
|
||||
+ if (mkdir(path, mode) == -1) {
|
||||
+ if (errno != EEXIST) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
load_plugins(struct srpd_plugin_s **plugins, int *plugin_count)
|
||||
{
|
||||
@@ -231,7 +259,7 @@ load_plugins(struct srpd_plugin_s **plugins, int *plugin_count)
|
||||
error_print(0, "Checking plugins dir existence failed (%s).", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
- if (mkdir(plugins_dir, 00777) == -1) {
|
||||
+ if (sr_mkpath(plugins_dir, 00777) == -1) {
|
||||
error_print(0, "Creating plugins dir \"%s\" failed (%s).", plugins_dir, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
||||
34
buildroot/package/sysrepo/Config.in
Normal file
34
buildroot/package/sysrepo/Config.in
Normal file
@@ -0,0 +1,34 @@
|
||||
config BR2_PACKAGE_SYSREPO
|
||||
bool "sysrepo"
|
||||
depends on BR2_USE_MMU
|
||||
depends on !BR2_STATIC_LIBS
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
|
||||
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" # host-protobuf
|
||||
select BR2_PACKAGE_LIBAVL
|
||||
select BR2_PACKAGE_LIBEV
|
||||
select BR2_PACKAGE_LIBYANG
|
||||
select BR2_PACKAGE_PCRE
|
||||
select BR2_PACKAGE_PCRE_UCP
|
||||
select BR2_PACKAGE_PROTOBUF_C
|
||||
help
|
||||
Sysrepo is an YANG-based configuration and operational state
|
||||
data store for Unix/Linux applications.
|
||||
|
||||
https://github.com/sysrepo
|
||||
|
||||
if BR2_PACKAGE_SYSREPO
|
||||
|
||||
config BR2_PACKAGE_SYSREPO_EXAMPLES
|
||||
bool "enable examples"
|
||||
help
|
||||
Enable sysrepo examples.
|
||||
|
||||
endif
|
||||
|
||||
comment "sysrepo needs a toolchain w/ C++, NPTL, dynamic library, gcc >= 4.8"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP \
|
||||
|| !BR2_TOOLCHAIN_HAS_THREADS_NPTL
|
||||
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
|
||||
53
buildroot/package/sysrepo/S51sysrepo-plugind
Normal file
53
buildroot/package/sysrepo/S51sysrepo-plugind
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="sysrepo-plugind"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
SYSREPO_PLUGIND_ARGS=""
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
start-stop-daemon -S -q -x "/usr/bin/$DAEMON" \
|
||||
-- $SYSREPO_PLUGIND_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p $PIDFILE
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
# we do not support real reload .. just restart
|
||||
restart
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
2
buildroot/package/sysrepo/sysrepo.hash
Normal file
2
buildroot/package/sysrepo/sysrepo.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
sha256 be405a33b1713d1114f3c092a6349b25a2de2a0f43a15dc6984c029f70230b3b sysrepo-1.3.21.tar.gz
|
||||
sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE
|
||||
34
buildroot/package/sysrepo/sysrepo.mk
Normal file
34
buildroot/package/sysrepo/sysrepo.mk
Normal file
@@ -0,0 +1,34 @@
|
||||
################################################################################
|
||||
#
|
||||
# sysrepo
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SYSREPO_VERSION = 1.3.21
|
||||
SYSREPO_SITE = $(call github,sysrepo,sysrepo,v$(SYSREPO_VERSION))
|
||||
SYSREPO_INSTALL_STAGING = YES
|
||||
SYSREPO_LICENSE = Apache-2.0
|
||||
SYSREPO_LICENSE_FILES = LICENSE
|
||||
SYSREPO_DEPENDENCIES = libev libavl libyang pcre protobuf-c host-sysrepo
|
||||
HOST_SYSREPO_DEPENDENCIES = host-libev host-libavl host-libyang host-pcre host-protobuf-c
|
||||
|
||||
SYSREPO_CONF_OPTS = \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_EXAMPLES=$(if $(BR2_PACKAGE_SYSREPO_EXAMPLES),ON,OFF)
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
SYSREPO_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
|
||||
endif
|
||||
|
||||
define SYSREPO_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 755 -D package/sysrepo/S51sysrepo-plugind \
|
||||
$(TARGET_DIR)/etc/init.d/S51sysrepo-plugind
|
||||
endef
|
||||
|
||||
HOST_SYSREPO_CONF_OPTS = \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DREPO_PATH=$(TARGET_DIR)/etc/sysrepo
|
||||
|
||||
$(eval $(cmake-package))
|
||||
$(eval $(host-cmake-package))
|
||||
Reference in New Issue
Block a user