uspd: replaced by bbfdm

This commit is contained in:
Vivek Kumar Dutta 2023-04-17 17:18:35 +05:30
parent 842d3b416d
commit fdc123c60b
3 changed files with 0 additions and 181 deletions

View file

@ -1,96 +0,0 @@
#
# Copyright (C) 2019 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=uspd
PKG_VERSION:=2.2.29
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
PKG_SOURCE_VERSION:=75c3538a9fbaf22e8df1a64eb363b4a8be6b9494
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/uspd/default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend
DEPENDS:=+USE_GLIBC:librt +libubox +ubus +libbbf_api +@BBFDM_ENABLE_JSON_PLUGIN +@BBFDM_ENABLE_DOTSO_PLUGIN \
+@BBF_TR181 +@BBF_TR104 +@BBF_TR143
endef
define Package/uspd-mbedtls
$(Package/uspd/default)
TITLE += (mbedtls)
DEPENDS += +PACKAGE_uspd-mbedtls:libbbf_dm-mbedtls
VARIANT:=mbedtls
DEFAULT_VARIANT:=1
endef
define Package/uspd-openssl
$(Package/uspd/default)
TITLE += (openssl)
DEPENDS += +PACKAGE_uspd-openssl:libbbf_dm-openssl
CONFLICTS := uspd-mbedtls
VARIANT:=openssl
endef
define Package/uspd-wolfssl
$(Package/uspd/default)
TITLE += (wolfssl)
DEPENDS += +PACKAGE_uspd-wolfssl:libbbf_dm-wolfssl
CONFLICTS := uspd-mbedtls uspd-openssl
VARIANT:=wolfssl
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE \
-Wall -Werror \
-DUSPD_MAX_MSG_LEN="10485760"
TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
ifeq ($(BUILD_VARIANT),openssl)
MAKE_FLAGS += USE_OPENSSL="yes"
endif
ifeq ($(BUILD_VARIANT),wolfssl)
MAKE_FLAGS += USE_WOLFSSL="yes"
endif
ifeq ($(BUILD_VARIANT),mbedtls)
MAKE_FLAGS += USE_MBEDTLS="yes"
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/uspd/* $(PKG_BUILD_DIR)/
endef
endif
define Package/uspd/default/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/etc/init.d/uspd $(1)/etc/init.d/uspd
$(INSTALL_CONF) ./files/etc/config/uspd $(1)/etc/config/uspd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uspd $(1)/usr/sbin/
endef
Package/uspd-openssl/install = $(Package/uspd/default/install)
Package/uspd-wolfssl/install = $(Package/uspd/default/install)
Package/uspd-mbedtls/install = $(Package/uspd/default/install)
$(eval $(call BuildPackage,uspd-openssl))
$(eval $(call BuildPackage,uspd-wolfssl))
$(eval $(call BuildPackage,uspd-mbedtls))

View file

@ -1,6 +0,0 @@
config uspd 'usp'
option granularitylevel '0'
option debug '0'
option loglevel '1'
option refresh_time '10'
option transaction_timeout '10'

View file

@ -1,79 +0,0 @@
#!/bin/sh /etc/rc.common
START=96
STOP=10
USE_PROCD=1
PROG=/usr/sbin/uspd
validate_uspd_usp_section()
{
uci_validate_section uspd uspd "usp" \
'enabled:bool:true' \
'granularitylevel:uinteger' \
'debug:bool:false' \
'loglevel:uinteger' \
'sock:string' \
'transaction_timeout:string'
}
configure_uspd()
{
local enabled debug sock transaction_timeout
config_load uspd
validate_uspd_usp_section || {
log "Validation of usp section failed"
return 1;
}
[ "${enabled}" -eq 0 ] && return 0
procd_set_param command ${PROG}
if [ "${debug}" -eq 1 ]; then
procd_set_param stdout 1
procd_set_param stderr 1
fi
if [ -f "${sock}" ]; then
procd_append_param command -s "${sock}"
fi
if [ -n "${transaction_timeout}" ]; then
procd_append_param command -t "${transaction_timeout}"
fi
}
apply_sysctl_configuration() {
local sysctl_conf
sysctl_conf="/etc/bbfdm/sysctl.conf"
[ -f "${sysctl_conf}" ] || touch "${sysctl_conf}"
sysctl -e -p "${sysctl_conf}" >&-
}
start_service() {
local sysctl_reload
ubus -t 5 wait_for network.device
[ "$?" -eq 0 ] && sysctl_reload=1
procd_open_instance usp
configure_uspd
procd_set_param respawn
procd_close_instance
[ "${sysctl_reload}" -eq 1 ] && apply_sysctl_configuration
}
reload_service() {
apply_sysctl_configuration
}
service_triggers()
{
procd_add_reload_trigger "uspd" "network"
}