Browse Source

Merge pull request #12088 from lucize/sysrepofix

sysrepo: update to 1.4.2
lilik-openwrt-22.03
Rosen Penev 5 years ago
committed by GitHub
parent
commit
1376a5fe66
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 55 additions and 141 deletions
  1. +21
    -2
      libs/libyang/Makefile
  2. +24
    -46
      net/sysrepo/Makefile
  3. +9
    -9
      net/sysrepo/files/libsysrepo.default
  4. +1
    -9
      net/sysrepo/files/sysrepo.init
  5. +0
    -24
      net/sysrepo/patches/002-remove-buildtime-module-install.patch
  6. +0
    -23
      net/sysrepo/patches/004-disable-sysrepod-autostart.patch
  7. +0
    -28
      net/sysrepo/patches/005-fix-struct-ucred-define.patch

+ 21
- 2
libs/libyang/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libyang PKG_NAME:=libyang
PKG_VERSION:=1.0.130 PKG_VERSION:=1.0.130
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/CESNET/libyang/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/CESNET/libyang/tar.gz/v$(PKG_VERSION)?
@ -34,6 +34,14 @@ define Package/libyang
DEPENDS:=+libpcre +libpthread DEPENDS:=+libpcre +libpthread
endef endef
define Package/libyang-cpp
SECTION:=libs
CATEGORY:=Libraries
TITLE:=YANG data modeling C++ language library
URL:=https://github.com/CESNET/libyang
DEPENDS:=+libyang +libstdcpp
endef
define Package/yanglint define Package/yanglint
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
@ -47,7 +55,12 @@ define Package/libyang/description
The library is used e.g. in libnetconf2, Netopeer2 or sysrepo projects. The library is used e.g. in libnetconf2, Netopeer2 or sysrepo projects.
endef endef
CMAKE_OPTIONS += -DENABLE_LYD_PRIV:BOOL=ON
CMAKE_OPTIONS += \
-DENABLE_LYD_PRIV:BOOL=ON \
-DCMAKE_BUILD_TYPE:String="Release" \
-DGEN_LANGUAGE_BINDINGS=ON \
-DGEN_PYTHON_BINDINGS=OFF
define Package/libyang/install define Package/libyang/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
@ -60,10 +73,16 @@ define Package/libyang/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/user_types/* $(1)/usr/lib/libyang/user_types $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/user_types/* $(1)/usr/lib/libyang/user_types
endef endef
define Package/libyang-cpp/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang-cpp.so* $(1)/usr/lib/
endef
define Package/yanglint/install define Package/yanglint/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yanglint $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yanglint $(1)/usr/bin/
endef endef
$(eval $(call BuildPackage,libyang)) $(eval $(call BuildPackage,libyang))
$(eval $(call BuildPackage,libyang-cpp))
$(eval $(call BuildPackage,yanglint)) $(eval $(call BuildPackage,yanglint))

+ 24
- 46
net/sysrepo/Makefile View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=sysrepo PKG_NAME:=sysrepo
PKG_VERSION:=0.7.8
PKG_RELEASE:=2
PKG_VERSION:=1.4.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=d3066c1776a6727b96bbb3517eb646d0bb6037e8e1addcbe873cae590493843e
PKG_HASH:=d84d4f092feab83b0a39fef5d0d62bc6ed1f0f8aa274329f2cbf0a95a6528d8a
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr> PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_LICENSE:=Apache-2.0 PKG_LICENSE:=Apache-2.0
@ -33,7 +33,7 @@ define Package/libsysrepo
CATEGORY:=Libraries CATEGORY:=Libraries
TITLE:=YANG-based data store library TITLE:=YANG-based data store library
URL:=https://www.sysrepo.org/ URL:=https://www.sysrepo.org/
DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +libpthread
DEPENDS:=+libyang +libatomic +libprotobuf-c +libev +libredblack +librt +libpthread
endef endef
define Package/python3-sysrepo define Package/python3-sysrepo
@ -42,7 +42,7 @@ define Package/python3-sysrepo
SUBMENU:=Python SUBMENU:=Python
TITLE:=YANG-based data store library - Python 3 bindings TITLE:=YANG-based data store library - Python 3 bindings
URL:=https://www.sysrepo.org/ URL:=https://www.sysrepo.org/
DEPENDS:=+libsysrepo +libstdcpp +python3-base
DEPENDS:=+libsysrepo +libstdcpp +python3-base +libyang-cpp
endef endef
define Package/sysrepo define Package/sysrepo
@ -76,46 +76,27 @@ endef
SWIG_VERSION:=4.0.1 SWIG_VERSION:=4.0.1
CMAKE_OPTIONS += \ CMAKE_OPTIONS += \
-DUSE_AVL_LIB:BOOL=FALSE \
-DENABLE_TESTS:BOOL=FALSE \ -DENABLE_TESTS:BOOL=FALSE \
-DBUILD_EXAMPLES:BOOL=FALSE \ -DBUILD_EXAMPLES:BOOL=FALSE \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE="Package" \
-DREPOSITORY_LOC:PATH=/etc/sysrepo \ -DREPOSITORY_LOC:PATH=/etc/sysrepo \
-DENABLE_NACM:BOOL=FALSE \
-DREQUEST_TIMEOUT=6 \
-DLONG_REQUEST_TIMEOUT=30 \
-DCOMMIT_VERIFY_TIMEOUT=20 \
-DOPER_DATA_PROVIDE_TIMEOUT=4 \
-DNOTIF_AGE_TIMEOUT=120 \
-DNOTIF_TIME_WINDOW=20 \
-DUSE_SR_MEM_MGMT=0 \
-DFILE_FORMAT_EXT:STRING=xml \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \ -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
-DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
-DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/share/swig/$(SWIG_VERSION) \
-DSWIG_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/swig \ -DSWIG_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/swig \
-DCALL_TARGET_BINS_DIRECTLY=OFF \ -DCALL_TARGET_BINS_DIRECTLY=OFF \
-DGEN_PYTHON_BINDINGS:BOOL=TRUE \
-DGEN_PYTHON_VERSION=3 \
-DGEN_PYTHON3_TESTS:BOOL=FALSE
-DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
-DGEN_PYTHON_BINDINGS:BOOL=TRUE
define Package/libsysrepo/install define Package/libsysrepo/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/sysrepo/yang/internal
$(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-module-dependencies.yang $(1)/etc/sysrepo/yang/internal
$(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-notification-store.yang $(1)/etc/sysrepo/yang/internal
$(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-persistent-data.yang $(1)/etc/sysrepo/yang/internal
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysrepo.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/sysrepo/yang $(INSTALL_DIR) $(1)/etc/sysrepo/yang
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-acm@2018-02-14.yang $(1)/etc/sysrepo/yang/ietf-netconf-acm@2018-02-14.yang
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06.yang
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/nc-notifications.yang $(1)/etc/sysrepo/yang/nc-notifications@2008-07-14.yang
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/notifications.yang $(1)/etc/sysrepo/yang/notifications@2008-07-14.yang
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf@2011-06-01.yang $(1)/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang
$(INSTALL_DIR) $(1)/etc/sysrepo/data/internal
$(INSTALL_DIR) $(1)/etc/sysrepo/data/notifications
$(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-with-defaults.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-origin.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/sysrepo.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
@ -123,31 +104,28 @@ endef
define Package/python3-sysrepo/install define Package/python3-sysrepo/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/swig/libSysrepo-cpp.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysrepo-cpp.so* $(1)/usr/lib
$(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR) $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/sysrepo.py $(1)$(PYTHON3_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/_sysrepo.so $(1)$(PYTHON3_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/bindings/python/sysrepo.py $(1)$(PYTHON3_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/bindings/python/_sysrepo.so $(1)$(PYTHON3_PKG_DIR)
endef endef
define Package/sysrepo/install define Package/sysrepo/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sysrepo-plugind $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d/ $(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
endef endef
define Package/sysrepoctl/install define Package/sysrepoctl/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepoctl $(1)/bin/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sysrepoctl $(1)/usr/bin/
endef endef
define Package/sysrepocfg/install define Package/sysrepocfg/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sysrepocfg $(1)/usr/bin/
endef endef
$(eval $(call BuildPackage,libsysrepo)) $(eval $(call BuildPackage,libsysrepo))


+ 9
- 9
net/sysrepo/files/libsysrepo.default View File

@ -3,29 +3,29 @@
# Warning, problems can occur if the device restarts in the middle of this uci-default script # Warning, problems can occur if the device restarts in the middle of this uci-default script
if [ -x /bin/sysrepoctl ]; then if [ -x /bin/sysrepoctl ]; then
match=$(sysrepoctl -l | grep "notifications ")
match=$(sysrepoctl -l | grep "ietf-netconf-notifications ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/notifications@2008-07-14.yang -p 666
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-notifications.yang -p 666
fi fi
match=$(sysrepoctl -l | grep "nc-notifications ")
match=$(sysrepoctl -l | grep "ietf-netconf-with-default ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/nc-notifications@2008-07-14.yang -p 666
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-with-defaults.yang -p 666
fi fi
match=$(sysrepoctl -l | grep "ietf-netconf-acm ")
match=$(sysrepoctl -l | grep "ietf-origin ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-acm@2018-02-14.yang -p 644
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-origin.yang -p 644
fi fi
match=$(sysrepoctl -l | grep "ietf-netconf-notifications ")
match=$(sysrepoctl -l | grep "sysrepo ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06.yang -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/sysrepo.yang -p 600
fi fi
match=$(sysrepoctl -l | grep "ietf-netconf ") match=$(sysrepoctl -l | grep "ietf-netconf ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf.yang -p 600
fi fi
sysrepoctl -m ietf-netconf -e writable-running sysrepoctl -m ietf-netconf -e writable-running
sysrepoctl -m ietf-netconf -e candidate sysrepoctl -m ietf-netconf -e candidate


+ 1
- 9
net/sysrepo/files/sysrepo.init View File

@ -4,16 +4,9 @@ START=60
STOP=10 STOP=10
USE_PROCD=1 USE_PROCD=1
PROG_DAEMON=/bin/sysrepod
PROG_PLUGIN=/bin/sysrepo-plugind
PROG_PLUGIN=/usr/bin/sysrepo-plugind
start_service() { start_service() {
procd_open_instance
procd_set_param command ${PROG_DAEMON}
procd_append_param command -d -l 0
procd_set_param respawn
procd_close_instance
procd_open_instance procd_open_instance
procd_set_param command ${PROG_PLUGIN} procd_set_param command ${PROG_PLUGIN}
procd_append_param command -d -l 0 procd_append_param command -d -l 0
@ -25,6 +18,5 @@ stop_service()
{ {
kill -9 `ps | grep netopeer2-server | grep -v grep | awk '{print $1}'` >/dev/null 2>&1 kill -9 `ps | grep netopeer2-server | grep -v grep | awk '{print $1}'` >/dev/null 2>&1
service_stop ${PROG_PLUGIN} service_stop ${PROG_PLUGIN}
service_stop ${PROG_DAEMON}
rm -rf /var/run/sysrepo-subscriptions/* rm -rf /var/run/sysrepo-subscriptions/*
} }

+ 0
- 24
net/sysrepo/patches/002-remove-buildtime-module-install.patch View File

@ -1,24 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -335,7 +335,7 @@ install (FILES ${INTERNAL_YANGS} DESTINATION ${INTERNAL_SCHEMA_SEARCH_DIR})
# install NACM YANG module
if(ENABLE_NACM)
- INSTALL_YANG("ietf-netconf-acm" "@2018-02-14" "644")
+# INSTALL_YANG("ietf-netconf-acm" "@2018-02-14" "644")
endif(ENABLE_NACM)
# generate and install pkg-config file
@@ -356,9 +356,9 @@ if(WITH_SYSTEMD)
FILES_MATCHING PATTERN "*.service")
endif()
-INSTALL_YANG("ietf-netconf-notifications" "" "666")
-INSTALL_YANG("nc-notifications" "" "666")
-INSTALL_YANG("notifications" "" "666")
+#INSTALL_YANG("ietf-netconf-notifications" "" "666")
+#INSTALL_YANG("nc-notifications" "" "666")
+#INSTALL_YANG("notifications" "" "666")
# uninstall
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/uninstall.cmake")

+ 0
- 23
net/sysrepo/patches/004-disable-sysrepod-autostart.patch View File

@ -1,23 +0,0 @@
--- a/src/clientlib/client_library.c
+++ b/src/clientlib/client_library.c
@@ -396,13 +396,13 @@ sr_connect(const char *app_name, const sr_conn_options_t opts, sr_conn_ctx_t **c
if (opts & SR_CONN_DAEMON_REQUIRED) {
if ((opts & SR_CONN_DAEMON_START) && (0 == getuid())) {
/* sysrepo daemon start requested and process is running under root privileges */
- SR_LOG_DBG_MSG("Sysrepo daemon not detected, starting it.");
- ret = system("sysrepod");
- if (0 == ret) {
- SR_LOG_INF_MSG("Sysrepo daemon has been started.");
- } else {
- SR_LOG_WRN("Unable to start sysrepo daemon, error code=%d.", ret);
- }
+ //SR_LOG_DBG_MSG("Sysrepo daemon not detected, starting it.");
+ //ret = system("sysrepod");
+ //if (0 == ret) {
+ // SR_LOG_INF_MSG("Sysrepo daemon has been started.");
+ //} else {
+ // SR_LOG_WRN("Unable to start sysrepo daemon, error code=%d.", ret);
+ //}
/* retry to connect again in any case */
rc = cl_socket_connect(connection, SR_DAEMON_SOCKET);
CHECK_RC_LOG_GOTO(rc, cleanup, "Unable to connect to sysrepod: %s.", sr_strerror(rc));

+ 0
- 28
net/sysrepo/patches/005-fix-struct-ucred-define.patch View File

@ -1,28 +0,0 @@
--- a/src/common/sr_utils.c
+++ b/src/common/sr_utils.c
@@ -506,14 +506,24 @@ sr_fd_set_nonblock(int fd)
#if defined(SO_PEERCRED)
+#if defined(__GLIBC__)
#if !defined(SCM_CREDENTIALS)
-/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
struct ucred {
pid_t pid; /* process ID of the sending process */
uid_t uid; /* user ID of the sending process */
gid_t gid; /* group ID of the sending process */
};
#endif /* !defined(SCM_CREDENTIALS) */
+#else
+#if !defined(_GNU_SOURCE)
+struct ucred {
+ pid_t pid; /* process ID of the sending process */
+ uid_t uid; /* user ID of the sending process */
+ gid_t gid; /* group ID of the sending process */
+};
+/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
+#endif /* !defined(__GNU_SOURCE) */
+#endif /* defined(__GLIBC__) */
int
sr_get_peer_eid(int fd, uid_t *uid, gid_t *gid)

Loading…
Cancel
Save